Compare commits
149 Commits
v1.36.07(4
...
v1.40.08(4
| Author | SHA1 | Date | |
|---|---|---|---|
| 05bc6e3fbe | |||
| 38dc5e134c | |||
| 76cf6c7d66 | |||
| 21100d517c | |||
| 37f83cd642 | |||
| f29f832387 | |||
| dd523ed6d8 | |||
| 879cfc5f7e | |||
| 83a6dd29f2 | |||
| cc85d83267 | |||
| 5d427a258e | |||
| 75e0a13f10 | |||
| 0862727176 | |||
| 6c02fcc9d5 | |||
| cd38c1b301 | |||
| c822f14a10 | |||
| 76683cb80c | |||
| 3041498ff1 | |||
| 66e0ce15cb | |||
| e12da84fa3 | |||
| bd4f28eb6d | |||
| c25b2e6cb5 | |||
| b86a1eb1bd | |||
| a9b5483005 | |||
| 29c181cff1 | |||
| 614da5ec5a | |||
| 5342f96076 | |||
| 479950df14 | |||
| 51fa32d48d | |||
| e491c56f3f | |||
| 5c505e2fe1 | |||
| 67e88d01e7 | |||
| 9454614af6 | |||
| 535a095b0a | |||
| c6457ccf1c | |||
| 3f470df462 | |||
| af5c5338b7 | |||
| e832db3214 | |||
| 8b432d1b19 | |||
| d33eb81968 | |||
| be60cdb971 | |||
| 062f877777 | |||
| 5187564250 | |||
| fc22c119f6 | |||
| dd8b696862 | |||
| 99a5e162de | |||
| 84dcf30aac | |||
| 388c0641cf | |||
| 40f2c86eec | |||
| 34bd0109c0 | |||
| b4199f38aa | |||
| 299e066436 | |||
| 0098fdaf5a | |||
| 76d26765ef | |||
| c5b6e80aaf | |||
| a1b3517b07 | |||
| bd3fdd9ab1 | |||
| 377950c978 | |||
| d17e528158 | |||
| a0c9c40ab5 | |||
| 175f9e226b | |||
| 5f2a2d96e9 | |||
| 3a167befae | |||
| 364c627f2d | |||
| c0a9477000 | |||
| f1f56b97d6 | |||
| 4a79b6c1bf | |||
| 3fddb6bcf7 | |||
| 435b6d753a | |||
| f0e1cf7f0b | |||
| 7049552f16 | |||
| 4e53189d56 | |||
| 9aa38b6fca | |||
| 5745d249f0 | |||
| 089ca061a7 | |||
| 725372befe | |||
| 6a84828506 | |||
| 1c0dc8c6f2 | |||
| 59350f768e | |||
| 0ebcf934ff | |||
| 20c934a28e | |||
| b6abeee972 | |||
| 7ecf9e4807 | |||
| 8030a90e8e | |||
| 61810c44c7 | |||
| d64bc584f0 | |||
| 4f4dea9097 | |||
| 707c852377 | |||
| 0ae1ac87d5 | |||
| f03fe78ed3 | |||
| 77cf6ac4db | |||
| 48d1a34c52 | |||
| 258f150dbb | |||
| 14783dfef5 | |||
| e62e5d11f0 | |||
| 648d908e95 | |||
| db3eb1b062 | |||
| fb2bed2dbf | |||
| f45010650a | |||
| 6022cfea1f | |||
| 1ceb8c9cf9 | |||
| 3c86db62c0 | |||
| 49687efc16 | |||
| 62835878a6 | |||
| 02cd92f2dd | |||
| 1014043c53 | |||
| bd087fbf73 | |||
| 12a1ce1654 | |||
| fbb7d414f1 | |||
| a09ed92945 | |||
| 0194a5a49d | |||
| 112110e10f | |||
| 8045d8b4e9 | |||
| d839d94d34 | |||
| 5728481a94 | |||
| 4b1632c265 | |||
| b95863d66d | |||
| 2e360e8104 | |||
| 7c52a692e3 | |||
| 17e3b8856c | |||
| 550cf3506e | |||
| 243d0d1d30 | |||
| 98649e3a42 | |||
| 9dabbee1c7 | |||
| 1c9f4de437 | |||
| b6bd8d5e01 | |||
| 502ff6f684 | |||
| 50e58446b4 | |||
| f8df1ffa96 | |||
| adf80ae3f5 | |||
| d81f623ee6 | |||
| 84c6b7099b | |||
| 965a60b6e8 | |||
| 4ba1b847e7 | |||
| f5ad8e8b64 | |||
| 4863b31bb6 | |||
| 8411b0fc17 | |||
| 6541f17555 | |||
| 143a6c9e9c | |||
| 8ef216318e | |||
| 946d3e6593 | |||
| 0bdc3a0638 | |||
| 49782755bc | |||
| 2c5fb3ba48 | |||
| bf732a1182 | |||
| a73ecc1e81 | |||
| 818351f1d0 | |||
| 27577d10cf | |||
| 09dd2ef31e |
27
.idea/appInsightsSettings.xml
generated
Normal file
27
.idea/appInsightsSettings.xml
generated
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AppInsightsSettings">
|
||||
<option name="selectedTabId" value="Android Vitals" />
|
||||
<option name="tabSettings">
|
||||
<map>
|
||||
<entry key="Firebase Crashlytics">
|
||||
<value>
|
||||
<InsightsFilterSettings>
|
||||
<option name="connection">
|
||||
<ConnectionSetting>
|
||||
<option name="appId" value="it.integry.integrywmsnative" />
|
||||
<option name="mobileSdkAppId" value="1:963231271247:android:6d73ab369f33c450" />
|
||||
<option name="projectId" value="wmsfirebaseproject-64854" />
|
||||
<option name="projectNumber" value="963231271247" />
|
||||
</ConnectionSetting>
|
||||
</option>
|
||||
<option name="signal" value="SIGNAL_UNSPECIFIED" />
|
||||
<option name="timeIntervalDays" value="THIRTY_DAYS" />
|
||||
<option name="visibilityType" value="ALL" />
|
||||
</InsightsFilterSettings>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
13
.idea/deploymentTargetDropDown.xml
generated
Normal file
13
.idea/deploymentTargetDropDown.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<value>
|
||||
<entry key="Prod_Android.WMS.app">
|
||||
<State />
|
||||
</entry>
|
||||
<entry key="app">
|
||||
<State />
|
||||
</entry>
|
||||
</value>
|
||||
</component>
|
||||
</project>
|
||||
97
.idea/fileTemplates/Android Activity.java
generated
Normal file
97
.idea/fileTemplates/Android Activity.java
generated
Normal file
@@ -0,0 +1,97 @@
|
||||
#set( $regex = "([a-z])([A-Z]+)")
|
||||
#set( $replacement = "$1_$2")
|
||||
#set( $dashName = $NAME.replaceAll($regex, $replacement).toLowerCase())
|
||||
#set( $variableName = $NAME.replace($NAME.substring(0, 1), $NAME.substring(0, 1).toLowerCase()))
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||
|
||||
public class ${NAME}Activity extends BaseActivity {
|
||||
|
||||
/*
|
||||
- Create the following layout resource file [activity_${dashName}.xml]
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
|
||||
<data>
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
|
||||
|
||||
|
||||
|
||||
- Create an entry in AndroidManifest.xml
|
||||
Fix the android:name tag with current path
|
||||
|
||||
<activity
|
||||
android:name="${NAME}Activity"
|
||||
android:label="@string/activity_${dashName}_title"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light" />
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@Inject
|
||||
${NAME}ViewModel mViewModel;
|
||||
|
||||
//private Activity${NAME}Binding mBindings;
|
||||
|
||||
//Pass here all external parameters
|
||||
public static void startActivity(Context context) {
|
||||
Intent myIntent = new Intent(context, ${NAME}Activity.class);
|
||||
|
||||
//String keyExtraItem = DataCache.addItem(var);
|
||||
//myIntent.putExtra("keyExtraItem", keyExtraItem);
|
||||
|
||||
context.startActivity(myIntent);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
//mBindings = DataBindingUtil.setContentView(this, R.layout.activity_${dashName});
|
||||
//mBindings.setLifecycleOwner(this);
|
||||
|
||||
|
||||
/*
|
||||
- Add following lines into MainApplicationComponent
|
||||
|
||||
[a] into @Component
|
||||
${NAME}Module.class
|
||||
|
||||
[b] into interface body
|
||||
${NAME}Component.Factory ${variableName}Component();
|
||||
*/
|
||||
MainApplication.appComponent
|
||||
.${variableName}Component()
|
||||
.create()
|
||||
.inject(this);
|
||||
}
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Activity.java.child.0.java
generated
Normal file
12
.idea/fileTemplates/Android Activity.java.child.0.java
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = ${NAME}Component.class)
|
||||
public class ${NAME}Module {
|
||||
|
||||
@Provides
|
||||
${NAME}ViewModel provides${NAME}ViewModel() {
|
||||
return new ${NAME}ViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Activity.java.child.1.java
generated
Normal file
12
.idea/fileTemplates/Android Activity.java.child.1.java
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface ${NAME}Component {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
${NAME}Component create();
|
||||
}
|
||||
|
||||
void inject(${NAME}Activity ${NAME}Activity);
|
||||
}
|
||||
3
.idea/fileTemplates/Android Activity.java.child.2.java
generated
Normal file
3
.idea/fileTemplates/Android Activity.java.child.2.java
generated
Normal file
@@ -0,0 +1,3 @@
|
||||
public class ${NAME}ViewModel {
|
||||
|
||||
}
|
||||
125
.idea/fileTemplates/Android Dialog.java
generated
Normal file
125
.idea/fileTemplates/Android Dialog.java
generated
Normal file
@@ -0,0 +1,125 @@
|
||||
#set( $regex = "([a-z])([A-Z]+)")
|
||||
#set( $replacement = "$1_$2")
|
||||
#set( $dashName = $NAME.replaceAll($regex, $replacement).toLowerCase())
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
|
||||
public class Dialog${NAME}View extends BaseDialogFragment {
|
||||
|
||||
/*
|
||||
Create the following layout resource file [dialog_${dashName}.xml]
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="16dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
style="@style/MaterialAlertDialog.Material3.Title.Icon.CenterStacked"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:src="@drawable/ic_error_white_24dp"
|
||||
app:tint="?colorPrimary" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/title_text"
|
||||
style="@style/MaterialAlertDialog.Material3.Title.Text.CenterStacked"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="Title here" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/description_text"
|
||||
style="@style/TextAppearance.Material3.BodyMedium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="Description here" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</layout>
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@Inject
|
||||
Dialog${NAME}ViewModel mViewModel;
|
||||
|
||||
//private Dialog${NAME}Binding mBindings;
|
||||
private Context mContext;
|
||||
|
||||
//Pass here all external parameters
|
||||
public static Dialog${NAME}View newInstance() {
|
||||
return new Dialog${NAME}View();
|
||||
}
|
||||
|
||||
private Dialog${NAME}View() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
this.mContext = requireContext();
|
||||
|
||||
//mBindings = Dialog${NAME}Binding.inflate(LayoutInflater.from(this.mContext), null, false);
|
||||
//mBindings.setLifecycleOwner(this);
|
||||
|
||||
|
||||
/*
|
||||
- Add following lines into MainApplicationComponent
|
||||
|
||||
[a] into @Component
|
||||
Dialog${NAME}Module.class
|
||||
|
||||
[b] into interface body
|
||||
Dialog${NAME}Component.Factory dialog${NAME}Component();
|
||||
*/
|
||||
MainApplication.appComponent
|
||||
.dialog${NAME}Component()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
setCancelable(false);
|
||||
|
||||
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
|
||||
.setView(mBindings.getRoot())
|
||||
.setCancelable(isCancelable())
|
||||
.create();
|
||||
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
alertDialog.setOnShowListener(this);
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Dialog.java.child.0.java
generated
Normal file
12
.idea/fileTemplates/Android Dialog.java.child.0.java
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = Dialog${NAME}Component.class)
|
||||
public class Dialog${NAME}Module {
|
||||
|
||||
@Provides
|
||||
Dialog${NAME}ViewModel providesDialog${NAME}ViewModel() {
|
||||
return new Dialog${NAME}ViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Dialog.java.child.1.java
generated
Normal file
12
.idea/fileTemplates/Android Dialog.java.child.1.java
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface Dialog${NAME}Component {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
Dialog${NAME}Component create();
|
||||
}
|
||||
|
||||
void inject(Dialog${NAME}View dialog${NAME}View);
|
||||
}
|
||||
3
.idea/fileTemplates/Android Dialog.java.child.2.java
generated
Normal file
3
.idea/fileTemplates/Android Dialog.java.child.2.java
generated
Normal file
@@ -0,0 +1,3 @@
|
||||
public class Dialog${NAME}ViewModel {
|
||||
|
||||
}
|
||||
82
.idea/fileTemplates/Android Fragment.java
generated
Normal file
82
.idea/fileTemplates/Android Fragment.java
generated
Normal file
@@ -0,0 +1,82 @@
|
||||
#set( $regex = "([a-z])([A-Z]+)")
|
||||
#set( $replacement = "$1_$2")
|
||||
#set( $dashName = $NAME.replaceAll($regex, $replacement).toLowerCase())
|
||||
#set( $variableName = $NAME.replace($NAME.substring(0, 1), $NAME.substring(0, 1).toLowerCase()))
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
|
||||
public class ${NAME}Fragment extends BaseFragment {
|
||||
|
||||
/*
|
||||
- Create the following layout resource file [fragment_${dashName}.xml]
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
|
||||
<data>
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@Inject
|
||||
${NAME}ViewModel mViewModel;
|
||||
|
||||
//private Fragment${NAME}Binding mBindings;
|
||||
|
||||
|
||||
public ${NAME}Fragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static ${NAME}Fragment newInstance() {
|
||||
return new ${NAME}Fragment();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
setRetainInstance(true);
|
||||
|
||||
//mBindings = Fragment${NAME}Binding.inflate(inflater, container, false);
|
||||
//mBindings.setLifecycleOwner(this);
|
||||
|
||||
|
||||
/*
|
||||
- Add following lines into MainApplicationComponent
|
||||
|
||||
[a] into @Component
|
||||
${NAME}Module.class
|
||||
|
||||
[b] into interface body
|
||||
${NAME}Component.Factory ${variableName}Component();
|
||||
*/
|
||||
MainApplication.appComponent
|
||||
.${variableName}Component()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
}
|
||||
3
.idea/fileTemplates/Android Fragment.java.child.0.java
generated
Normal file
3
.idea/fileTemplates/Android Fragment.java.child.0.java
generated
Normal file
@@ -0,0 +1,3 @@
|
||||
public class ${NAME}ViewModel {
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Fragment.java.child.1.java
generated
Normal file
12
.idea/fileTemplates/Android Fragment.java.child.1.java
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface ${NAME}Component {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
${NAME}Component create();
|
||||
}
|
||||
|
||||
void inject(${NAME}Fragment ${NAME}Fragment);
|
||||
}
|
||||
12
.idea/fileTemplates/Android Fragment.java.child.2.java
generated
Normal file
12
.idea/fileTemplates/Android Fragment.java.child.2.java
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = ${NAME}Component.class)
|
||||
public class ${NAME}Module {
|
||||
|
||||
@Provides
|
||||
${NAME}ViewModel provides${NAME}ViewModel() {
|
||||
return new ${NAME}ViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
1
.idea/runConfigurations/app.xml
generated
1
.idea/runConfigurations/app.xml
generated
@@ -9,6 +9,7 @@
|
||||
<option name="ALL_USERS" value="false" />
|
||||
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||
<option name="CLEAR_APP_STORAGE" value="false" />
|
||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="" />
|
||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||
<option name="MODE" value="default_activity" />
|
||||
<option name="CLEAR_LOGCAT" value="false" />
|
||||
|
||||
@@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 400
|
||||
def appVersionName = '1.36.07'
|
||||
def appVersionCode = 425
|
||||
def appVersionName = '1.40.08'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -25,8 +25,8 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.all { output ->
|
||||
applicationVariants.configureEach { variant ->
|
||||
variant.outputs.configureEach { output ->
|
||||
output.outputFileName = "android-release.apk"
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ android {
|
||||
defaultConfig {
|
||||
applicationId "it.integry.integrywmsnative"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 33
|
||||
targetSdkVersion 34
|
||||
versionCode appVersionCode
|
||||
versionName appVersionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
@@ -88,11 +88,11 @@ android {
|
||||
abortOnError false
|
||||
}
|
||||
namespace 'it.integry.integrywmsnative'
|
||||
compileSdk 33
|
||||
compileSdk 34
|
||||
}
|
||||
|
||||
dependencies {
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
@@ -113,10 +113,10 @@ dependencies {
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.9.0'
|
||||
implementation 'com.google.android.material:material:1.10.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.3.1'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.3.2'
|
||||
|
||||
implementation('androidx.preference:preference-ktx:1.2.1') {
|
||||
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel'
|
||||
@@ -152,7 +152,7 @@ dependencies {
|
||||
implementation 'com.github.pedromassango:doubleClick:3.0'
|
||||
|
||||
//SQLite ROOM
|
||||
def room_version = "2.5.2"
|
||||
def room_version = "2.6.1"
|
||||
|
||||
implementation "androidx.room:room-runtime:$room_version"
|
||||
annotationProcessor "androidx.room:room-compiler:$room_version"
|
||||
|
||||
@@ -29,6 +29,8 @@ import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.sele
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsModule;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleComponent;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
||||
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaComponent;
|
||||
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaModule;
|
||||
import it.integry.integrywmsnative.gest.inventario.ElencoInventariComponent;
|
||||
import it.integry.integrywmsnative.gest.inventario.ElencoInventariModule;
|
||||
import it.integry.integrywmsnative.gest.inventario.bottom_sheet__inventario_actions.BottomSheetInventarioActionsComponent;
|
||||
@@ -67,6 +69,10 @@ import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMate
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeModule;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail.ProdRientroMerceOrderDetailComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.ProdRiposizionamentoDaProdComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.ProdRiposizionamentoDaProdModule;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dialogs.info_giacenza.DialogInfoGiacenzaComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dialogs.info_giacenza.DialogInfoGiacenzaModule;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeComponent;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeModule;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale_su_mag_prossimita.ProdVersamentoMaterialeInBufferComponent;
|
||||
@@ -104,6 +110,8 @@ import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetM
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.DialogAskLineaProdComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.DialogAskLineaProdModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_unknown_barcode_notes.DialogAskUnknownBarcodeNotesComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_unknown_barcode_notes.DialogAskUnknownBarcodeNotesModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageComponent;
|
||||
@@ -114,7 +122,8 @@ import it.integry.integrywmsnative.view.dialogs.choose_arts_from_mtbcolr_list.Di
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_mtbcolr_list.DialogChooseArtsFromMtbColrListModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialogComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_peso_lu.DialogInputPesoLUComponent;
|
||||
@@ -195,7 +204,12 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
DialogBindProductBarcodeWithPackageModule.class,
|
||||
DialogAskUnknownBarcodeNotesModule.class,
|
||||
ProdVersamentoMaterialeInBufferModule.class,
|
||||
DialogInputQuantityToReturnModule.class
|
||||
DialogInputQuantityToReturnModule.class,
|
||||
DialogInfoAggiuntiveLUModule.class,
|
||||
DialogAskLineaProdModule.class,
|
||||
ProdRiposizionamentoDaProdModule.class,
|
||||
DialogInfoGiacenzaModule.class,
|
||||
ArticoliInGiacenzaModule.class
|
||||
})
|
||||
public interface MainApplicationComponent {
|
||||
|
||||
@@ -281,8 +295,6 @@ public interface MainApplicationComponent {
|
||||
|
||||
DocInterniEditFormComponent.Factory docInterniEditFormComponent();
|
||||
|
||||
InfoAggiuntiveLUDialogComponent.Factory infoAggiuntiveLUDialogComponent();
|
||||
|
||||
DialogEditArticoloComponent.Factory dialogEditArticoloComponent();
|
||||
|
||||
DialogPrintOrderSSCCListComponent.Factory dialogPrintOrderSSCCListComponent();
|
||||
@@ -329,6 +341,16 @@ public interface MainApplicationComponent {
|
||||
|
||||
DialogInputQuantityToReturnComponent.Factory dialogInputQuantityToReturnComponent();
|
||||
|
||||
DialogInfoAggiuntiveLUComponent.Factory dialogInfoAggiuntiveLUComponent();
|
||||
|
||||
DialogAskLineaProdComponent.Factory dialogAskLineaProdComponent();
|
||||
|
||||
ProdRiposizionamentoDaProdComponent.Factory prodRiposizionamentoDaprodComponent();
|
||||
|
||||
DialogInfoGiacenzaComponent.Factory dialogInfoGiacenzaComponent();
|
||||
|
||||
ArticoliInGiacenzaComponent.Factory controlloGiacenzeComponent();
|
||||
|
||||
void inject(MainApplication mainApplication);
|
||||
|
||||
void inject(AppContext mainApplication);
|
||||
|
||||
@@ -16,6 +16,7 @@ import it.integry.integrywmsnative.core.context.AppContext;
|
||||
import it.integry.integrywmsnative.core.context.MainContext;
|
||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
||||
import it.integry.integrywmsnative.core.ean128.Ean128Service;
|
||||
import it.integry.integrywmsnative.core.menu.MenuRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.menu.MenuService;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
@@ -43,6 +44,7 @@ import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsum
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.sound.SoundAlertService;
|
||||
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
||||
@@ -102,6 +104,12 @@ public class MainApplicationModule {
|
||||
return colliDataRecoverService;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
Ean128Service provideEan128Service() {
|
||||
return new Ean128Service();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MenuService provideMenuService(MenuRESTConsumer menuRESTConsumer) {
|
||||
@@ -197,8 +205,8 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
BarcodeRESTConsumer provideBarcodeRESTConsumer() {
|
||||
return new BarcodeRESTConsumer();
|
||||
BarcodeRESTConsumer provideBarcodeRESTConsumer(Ean128Service ean128Service) {
|
||||
return new BarcodeRESTConsumer(ean128Service);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -291,4 +299,12 @@ public class MainApplicationModule {
|
||||
return new MagazzinoBufferRESTConsumer();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
SoundAlertService provideSoundAlertService() {
|
||||
SoundAlertService soundAlertService = new SoundAlertService(mApplication.getApplicationContext());
|
||||
soundAlertService.init();
|
||||
return soundAlertService;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class BarcodeManager {
|
||||
var scanMode = sharedPreferences.getString(MainSettingsFragment.KEY_TRIGGER_SCAN_MODE, null);
|
||||
var scanModeSetting = new Pair<String, Object>(BarcodeSetting.P_TRIGGER_SCAN_MODE, scanMode);
|
||||
additionalSettings.add(scanModeSetting);
|
||||
|
||||
|
||||
BarcodeManager.changeSettings(additionalSettings);
|
||||
|
||||
});
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package it.integry.integrywmsnative.core.base;
|
||||
|
||||
public interface Callable<I, O> {
|
||||
O call(I input);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package it.integry.integrywmsnative.core.base;
|
||||
|
||||
public interface CallableII<I, L, O> {
|
||||
O call(I input, L input2);
|
||||
}
|
||||
@@ -2,8 +2,10 @@ package it.integry.integrywmsnative.core.class_router.configs;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.MainAccettazioneBollaElencoFragment;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazioneOrdiniElencoFragment;
|
||||
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaFragment;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniFragment;
|
||||
import it.integry.integrywmsnative.gest.inventario.ElencoInventariFragment;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoFragment;
|
||||
@@ -13,6 +15,7 @@ import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.ProdFabbisogn
|
||||
import it.integry.integrywmsnative.gest.prod_linee_produzione.ProdLineeProduzioneFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.ProdRiposizionamentoDaProdFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeFragment;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale_su_mag_prossimita.ProdVersamentoMaterialeInBufferFragment;
|
||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaFragment;
|
||||
@@ -85,7 +88,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setTitleText(R.string.free_picking)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_picking_libero)
|
||||
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.VENDITA)))
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.free_picking, GestioneEnum.VENDITA, SettingsManager.iDB().isFlagAskClienteInPickingLibero(), false)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_resi_cliente)
|
||||
@@ -113,7 +116,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setTitleText(R.string.prod_ordine_lavorazione_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_lavorazione)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.PRODUZIONE, GestioneEnum.LAVORAZIONE, -1, null)))
|
||||
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.PRODUZIONE, GestioneEnum.LAVORAZIONE, -1, SettingsManager.iDB().isFlagProduzioneShowInfo() ? DialogInfoSituazioneArticoloView.class : null)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_free_lav_picking)
|
||||
@@ -121,7 +124,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setTitleText(R.string.free_lav_picking)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_libero)
|
||||
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.LAVORAZIONE)))
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.free_lav_picking, GestioneEnum.LAVORAZIONE, SettingsManager.iDB().isFlagAskClienteInPickingLibero(), false)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_prod_posizionamento_da_ord)
|
||||
@@ -170,6 +173,22 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_materiale)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(ProdVersamentoMaterialeInBufferFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_prod_versamento_su_ordine)
|
||||
.setCodMenu("MG068")
|
||||
.setTitleText(R.string.prod_versamento_su_ordine_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_su_ord)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.prod_versamento_su_ordine_title_fragment, GestioneEnum.LAVORAZIONE, false, true)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_prod_riposizionamento_da_ord)
|
||||
.setCodMenu("MG069")
|
||||
.setTitleText(R.string.prod_riposizionamento_da_prod_title)
|
||||
.setTitleIcon(R.drawable.ic_production_line_produzione)
|
||||
.setDrawerIcon(R.drawable.ic_black_load_shelf)
|
||||
.setFragmentFactory(ProdRiposizionamentoDaProdFragment::newInstance))
|
||||
).addGroup(
|
||||
new MenuGroup()
|
||||
.setGroupText(R.string.internal_handling)
|
||||
@@ -200,6 +219,13 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setDrawerIcon(R.drawable.ic_black_empty_box)
|
||||
.setFragmentFactory(ElencoInventariFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_articoli_in_giacenza)
|
||||
.setCodMenu("MG070")
|
||||
.setTitleText(R.string.articoli_in_giacenza_title)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_articoli_in_giacenza)
|
||||
.setDrawerIcon(R.drawable.ic_black_empty_box)
|
||||
.setFragmentFactory(ArticoliInGiacenzaFragment::newInstance))
|
||||
|
||||
).addGroup(
|
||||
new MenuGroup()
|
||||
|
||||
@@ -22,6 +22,7 @@ import javax.inject.Singleton;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityGson;
|
||||
|
||||
@Singleton
|
||||
public class ColliDataRecoverService {
|
||||
@@ -108,7 +109,7 @@ public class ColliDataRecoverService {
|
||||
|
||||
private void loadLocalFile() {
|
||||
InputStream inputStream;
|
||||
Gson gson = new Gson();
|
||||
Gson gson = UtilityGson.createObject();
|
||||
|
||||
try {
|
||||
inputStream = mApplicationContext.openFileInput(CommonConst.Files.RECOVER_COLLO_FILE);
|
||||
@@ -130,7 +131,7 @@ public class ColliDataRecoverService {
|
||||
private void updateLocalFile() {
|
||||
FileOutputStream outputStream;
|
||||
|
||||
Gson gson = new Gson();
|
||||
Gson gson = UtilityGson.createObject();
|
||||
String jsonText = gson.toJson(mtbColtsSessions);
|
||||
|
||||
try {
|
||||
|
||||
@@ -238,8 +238,11 @@ public class Converters {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
BigDecimal value = null;
|
||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||
value = new BigDecimal(s.toString());
|
||||
String newValueString = s.toString().trim();
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(newValueString))
|
||||
value = new BigDecimal(newValueString);
|
||||
|
||||
observableBigDecimal.set(value);
|
||||
}
|
||||
};
|
||||
@@ -247,7 +250,7 @@ public class Converters {
|
||||
view.addTextChangedListener(watcher);
|
||||
}
|
||||
BigDecimal newValue = observableBigDecimal.get();
|
||||
BigDecimal viewValue = view.getText().toString().trim().length() > 0 ? new BigDecimal(view.getText().toString()) : null;
|
||||
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
|
||||
|
||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||
view.setText(UtilityNumber.decimalToString(newValue));
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
package it.integry.integrywmsnative.core.ean128;
|
||||
|
||||
public enum Ean128AI {
|
||||
|
||||
|
||||
NULL, //Valore nullo (usato solo in logica)
|
||||
SSCC, //Numero sequenziale del collo n2+n18
|
||||
GTIN, //Codice EAN/UCC unità logistica n2+n14
|
||||
CONTENT, //Codice EAN/UCC dei prodotti contenuti all'interno di unità log n2+n14
|
||||
BATCH_LOT, //Numero del lotto di fabbricazione n2+an.20
|
||||
PROD_DATE, //Data di produzione (yymmdd) 0~50 (2000~2050) - 51~99 (1951~1999) n2+n6
|
||||
DUE_DATE, //Data di scadenza pagamento fattura n2+n6
|
||||
PACK_DATE, //Data di confezionamento n2+n6
|
||||
BEST_BEFORE,//Data minima di validità n2+n6
|
||||
EXPIRY, //Data massima di validità n2+n6
|
||||
VARIANT, //Variante di prodotto - uso interno aziendale n2+n2
|
||||
SERIAL, //Numero di serie n2+an.20
|
||||
QTY_DATE_BATCH, //Dati supplementari per prodotti farmaceutici n2+an.29
|
||||
ADDITIONAL_ID, //Numedi di identificazione supplementare del prodotto n3+an.30
|
||||
CUST_PART_NO, //Codice prodotto interno del cliente n3+an.30
|
||||
SECONDARY_SERIAL, //Numero di serie secondario n3+an.30
|
||||
REF_TO_SOURCE, //Entità di origine o marca auricolare n3+an.30
|
||||
VAR_COUNT, //Quantità variabile n2+n.8
|
||||
|
||||
//Misure commerciali e logistiche FORMATO: n4+n6
|
||||
NET_WEIGHT_KG, //Peso netto in Kg
|
||||
LENGTH_M, //Lunghezza o 1° dimensione, in mt, uso commerciale
|
||||
WIDTH_M, //Larghezza, diametro o 2° dimensione, in mt, uso commerciale
|
||||
HEIGHT_M, //Profondità, spessore, altezza o 3° dimensione, in mt, uso commerciale
|
||||
AREA_M2, //Superficie, in metriquadri, uso commerciale
|
||||
NET_VOLUME_L, //Volume, in litri, uso commerciale
|
||||
NET_VOLUME_M3, //Volume, in metricubi, uso commerciale
|
||||
NET_WEIGHT_LB, //Peso netto, in libbre, uso commerciale
|
||||
LENGTH_I, //Lunghezza o 1° dimensione, in pollici, uso commerciale
|
||||
LENGTH_F, //Lunghezza o 1° dimensione, in piedi, uso commerciale
|
||||
LENGTH_Y, //Lunghezza o 1° dimensione, in yards, uso commerciale
|
||||
WIDTH_I, //Larghezza, diametro o 2° dimensione, in pollici, uso commerciale
|
||||
WIDTH_F, //Larghezza, diametro o 2° dimensione, in piedi, uso commerciale
|
||||
WIDTH_Y, //Larghezza, diametro o 2° dimensione, in yards, uso commerciale
|
||||
HEIGHT_I, //Profondità, spessore, altezza o 3° dimensione, in pollici, uso commerciale
|
||||
HEIGHT_F, //Profondità, spessore, altezza o 3° dimensione, in piedi, uso commerciale
|
||||
HEIGHT_Y, //Profondità, spessore, altezza o 3° dimensione, in yards, uso commerciale
|
||||
CROSSWEIGHT_KG_LOG, //Peso lordo, in Kg, uso logistico
|
||||
LENGTH_M_LOG, //Lunghezza o 1° dimensione, in metri, uso logistico
|
||||
WIDTH_M_LOG, //Larghezza, diametro o 2° dimensione, in metri, uso logistico
|
||||
HEIGHT_M_LOG, //Profondità, spessore, altezza o 3° dimensione, in metri, uso logistico
|
||||
AREA_M2_LOG, //Superficie, in metriquadri, uso logistico
|
||||
VOLUME_L_LOG, //Volume lordo, in litri, uso logistico
|
||||
VOLUME_M3_LOG, //Volume lordo, in metricubi, uso logistico
|
||||
CROSSWEIGHT_LB_LOG, //Peso lordo, in libbre, uso logistico
|
||||
LENGTH_I_LOG, //Lunghezza o 1° dimensione, in pollici, uso logistico
|
||||
LENGTH_F_LOG, //Lunghezza o 1° dimensione, in piedi, uso logistico
|
||||
LENGTH_Y_LOG, //Lunghezza o 1° dimensione, in yards, uso logistico
|
||||
WIDTH_I_LOG, //Larghezza, diametro o 2° dimensione, in pollici, uso logistico
|
||||
WIDTH_F_LOG, //Larghezza, diametro o 2° dimensione, in piedi, uso logistico
|
||||
WIDTH_Y_LOG, //Larghezza, diametro o 2° dimensione, in yards, uso logistico
|
||||
HEIGHT_I_LOG, //Profondità, spessore, altezza o 3° dimensione, in pollici, uso logistico
|
||||
HEIGHT_F_LOG, //Profondità, spessore, altezza o 3° dimensione, in piedi, uso logistico
|
||||
HEIGHT_Y_LOG, //Profondità, spessore, altezza o 3° dimensione, in yards, uso logistico
|
||||
AREA_I2, //Superficie, in pollici quadrati, uso commerciale
|
||||
AREA_F2, //Superficie, in piedi quadrati, uso commerciale
|
||||
AREA_Y2, //Superficie, in yards quadrati, uso commerciale
|
||||
AREA_I2_LOG, //Superficie, in pollici quadrati, uso logistico
|
||||
AREA_F2_LOG, //Superficie, in piedi quadrati, uso logistico
|
||||
AREA_Y2_LOG, //Superficie, in yards quadrati, uso logistico
|
||||
NET_WEIGHT_T, //Peso netto, in once troy, uso commerciale
|
||||
NET_VOLUME_OZ, //Volume netto, in once (U.S.), uso commerciale
|
||||
NET_VOLUME_LB, //Volume netto, in quarti di gallone, uso commerciale
|
||||
NET_VOLUME_G, //Volume netto, in galloni (U.S.), uso commerciale
|
||||
VOLUME_Q_LOG, //Volume lordo, in quarti di gallone, uso logistico
|
||||
VOLUME_G_LOG, //Volume lordo, in galloni (U.S.), uso logistico
|
||||
NET_VOLUME_I3, //Volume netto, in pollici cubi, uso commerciale
|
||||
NET_VOLUME_F3, //Volume netto, in piedi cubi, uso commerciale
|
||||
NET_VOLUME_Y3, //Volume netto, in yards cubi, uso commerciale
|
||||
VOLUME_I3_LOG, //Volume lordo, in pollici cubi, uso logistico
|
||||
VOLUME_F3_LOG, //Volume lordo, in piedi cubi, uso logistico
|
||||
VOLUME_Y3_LOG, //Volume lordo, in yards cubi, uso logistico
|
||||
COUNT, //Quantità prodotti contenuti in un'unità logistica
|
||||
AMOUNT, //Importo da pagare singola area monetaria
|
||||
AMOUNT_ISO, //Importo da pagare con codice valuta ISO
|
||||
PRICE, //Importo da pagare singola unità monetaria (prodotti a peso variabile)
|
||||
PRICE_ISO, //Importo da pagare con codice valuta ISO (prodotti a peso variabile)
|
||||
ORDER_NUMBER, //Numero d'ordine d'acquisto cliente
|
||||
CONSIGNMENT, //Numero di consegna
|
||||
SHIPMENT_NO, //Numero di spedizione
|
||||
ROUTE, //Codice di smistamento pacchi
|
||||
SHIP_TO_LOC, //Codice di locazione EAN/UCC "Spedire a, Consegnare a"
|
||||
BILL_TO_LOC, //Codice di locazione EAN/UCC "Fatturare a"
|
||||
PURCHASE_FROM_LOC, //Codice di locazione EAN/UCC "Acquistato da"
|
||||
SHIP_FOR_LOC, //Codice di locazione EAN/UCC "Sperdire per, Consegnare per, Inoltrare a"
|
||||
LOC_NO, //Codice di locazione EAN/UCC: identificazione di una locazione fisica
|
||||
PAY_TO_LOC, //Codice di locazione EAN/UCC di chi emette la fattura
|
||||
SHIP_TO_POST, //Codice postale "Spedire a, Consegnare a" (nazionale)
|
||||
SHIP_TO_POST_ISO, //Codice postale "Spedire a, Consegnare a" con codice nazione ISO
|
||||
ORIGIN, //Paese di origine del prodotto
|
||||
COUNTRY_INITIAL_PROCESS, //Paese di lavorazione iniziale del prodotto con codice nazionale ISO
|
||||
COUNTRY_PROCESS, //Paese di lavorazione con codice nazionale ISO
|
||||
COUNTRY_DISASSEMBLY, //Paese di scomposizione con codice nazionale ISO
|
||||
COUNTRY_FULL_PROCESS,//Paese di lavorazione completa con codice nazionale ISO
|
||||
NSN, //Numero di stock NATO
|
||||
MEAT_CUT, //Carcasse animali e classificazione dei tagli UN/ECE
|
||||
PROCESSORS, //Numero di approvazione del laboratorio di lavorazione intermedio con codice nazionale ISO
|
||||
DIMENSIONS, //Prodotti in rotoli - larghezza, lunghezza, diametro interno, senso di svolgimento e giunte
|
||||
CMT_NO, //Numero sequenziale elettronico per applicazioni di telefonia cellulare
|
||||
GRAI, //Numero di identificazione per beni a rendere,
|
||||
GIAI, //Numero di identificazione globale per beni individuali
|
||||
PRICE_PER_UNIT, //Prezzo per unità di misura
|
||||
GCTIN, //Identificazione dei componenti di un prodotto
|
||||
IBAN, //Numero di contocorrente bancario internazionale
|
||||
PROD_TIME, //Data e ora di produzione
|
||||
GSRN, //Numedo Globale di Relazione di Servizio
|
||||
REF_NO, //Numero del bollettino di pagamento
|
||||
COUPON_1, //Codice esteso per i coupons, UCC
|
||||
COUPON_2, //Codice esteso per i coupons, UCC
|
||||
COUPON_3, //Codice esteso per i coupons, UCC
|
||||
INTERNAL_PART, //Informazioni concordate tra i partners commerciali
|
||||
INTERNAL_1, //Informazioni interne
|
||||
INTERNAL_2, //Informazioni interne
|
||||
INTERNAL_3, //Informazioni interne
|
||||
INTERNAL_4, //Informazioni interne
|
||||
INTERNAL_5, //Informazioni interne
|
||||
INTERNAL_6, //Informazioni interne
|
||||
INTERNAL_7, //Informazioni interne
|
||||
INTERNAL_8, //Informazioni interne
|
||||
INTERNAL_9, //Informazioni interne
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package it.integry.integrywmsnative.core.ean128;
|
||||
|
||||
public class Ean128AIModel implements Cloneable {
|
||||
|
||||
|
||||
public Ean128AI AI;
|
||||
|
||||
public String code;
|
||||
|
||||
public int dataLength;
|
||||
|
||||
public boolean flagVariableLength;
|
||||
|
||||
public boolean flagOnlyNumeric;
|
||||
|
||||
public int decimalDigits;
|
||||
|
||||
public Ean128AIModel(Ean128AI AI, String code, int dataLength, boolean flagVariableLength, boolean flagOnlyNumeric, int decimalDigits) {
|
||||
this.AI = AI;
|
||||
this.code = code;
|
||||
this.dataLength = dataLength;
|
||||
this.flagVariableLength = flagVariableLength;
|
||||
this.flagOnlyNumeric = flagOnlyNumeric;
|
||||
this.decimalDigits = decimalDigits;
|
||||
}
|
||||
|
||||
public Ean128AIModel(Ean128AI AI, String code, int dataLength, boolean flagVariableLength, boolean flagOnlyNumeric) {
|
||||
this.AI = AI;
|
||||
this.code = code;
|
||||
this.dataLength = dataLength;
|
||||
this.flagVariableLength = flagVariableLength;
|
||||
this.flagOnlyNumeric = flagOnlyNumeric;
|
||||
}
|
||||
|
||||
protected Object clone() throws CloneNotSupportedException {
|
||||
return super.clone();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
package it.integry.integrywmsnative.core.ean128;
|
||||
|
||||
import java.util.regex.MatchResult;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class Ean128AIModelBij {
|
||||
|
||||
private final Ean128AIModel[] _aiModelArray = new Ean128AIModel[]{
|
||||
new Ean128AIModel(Ean128AI.SSCC, "^00", 18, false, true),
|
||||
new Ean128AIModel(Ean128AI.GTIN, "^01", 14, false, true),
|
||||
new Ean128AIModel(Ean128AI.CONTENT, "^02", 14, false, true),
|
||||
new Ean128AIModel(Ean128AI.BATCH_LOT, "^10", 20, true, false),
|
||||
new Ean128AIModel(Ean128AI.PROD_DATE, "^11", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.DUE_DATE, "^12", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.PACK_DATE, "^13", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.BEST_BEFORE, "^15", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.EXPIRY, "^17", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VARIANT, "^20", 2, false, true),
|
||||
new Ean128AIModel(Ean128AI.SERIAL, "^21", 20, true, false),
|
||||
new Ean128AIModel(Ean128AI.QTY_DATE_BATCH, "^22", 29, true, false),
|
||||
new Ean128AIModel(Ean128AI.ADDITIONAL_ID, "^240", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.CUST_PART_NO, "^241", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.SECONDARY_SERIAL, "^250", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.REF_TO_SOURCE, "^251", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.VAR_COUNT, "^30", 8, true, true),
|
||||
new Ean128AIModel(Ean128AI.NET_WEIGHT_KG, "^310(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_M, "^311(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_M, "^312(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_M, "^313(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_M2, "^314(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_L, "^315(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_M3, "^316(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_WEIGHT_LB, "^320(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_I, "^321(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_F, "^322(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_Y, "^323(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_I, "^324(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_F, "^325(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_Y, "^326(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_I, "^327(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_F, "^328(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_Y, "^329(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.CROSSWEIGHT_KG_LOG, "^330(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_M_LOG, "^331(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_M_LOG, "^332(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_M_LOG, "^333(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_M2_LOG, "^334(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_L_LOG, "^335(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_M3_LOG, "^336(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.CROSSWEIGHT_LB_LOG, "^340(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_I_LOG, "^341(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_F_LOG, "^342(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_Y_LOG, "^343(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_I_LOG, "^344(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_F_LOG, "^345(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_Y_LOG, "^346(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_I_LOG, "^347(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_F_LOG, "^348(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_Y_LOG, "^349(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_I2, "^350(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_F2, "^351(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_Y2, "^352(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_I2_LOG, "^353(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_F2_LOG, "^354(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_Y2_LOG, "^355(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_WEIGHT_T, "^356(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_OZ, "^357(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_LB, "^360(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_G, "^361(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_Q_LOG, "^362(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_G_LOG, "^363(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_I3, "^364(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_F3, "^365(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_Y3, "^366(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_I3_LOG, "^367(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_F3_LOG, "^368(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_Y3_LOG, "^369(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUNT, "^37", 8, true, true),
|
||||
new Ean128AIModel(Ean128AI.AMOUNT, "^390(\\d{1})", 15, true, true),
|
||||
new Ean128AIModel(Ean128AI.AMOUNT_ISO, "^391(\\d{1})", 18, true, true),
|
||||
new Ean128AIModel(Ean128AI.PRICE, "^392(\\d{1})", 15, true, true),
|
||||
new Ean128AIModel(Ean128AI.PRICE_ISO, "^393(\\d{1})", 18, true, true),
|
||||
new Ean128AIModel(Ean128AI.ORDER_NUMBER, "^400", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.CONSIGNMENT, "^401", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.SHIPMENT_NO, "^402", 17, false, true),
|
||||
new Ean128AIModel(Ean128AI.ROUTE, "^403", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.SHIP_TO_LOC, "^410", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.BILL_TO_LOC, "^411", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.PURCHASE_FROM_LOC, "^412", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.SHIP_FOR_LOC, "^413", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.LOC_NO, "^414", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.PAY_TO_LOC, "^415", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.SHIP_TO_POST, "^420", 20, true, false),
|
||||
new Ean128AIModel(Ean128AI.SHIP_TO_POST_ISO, "^421", 12, true, false),
|
||||
new Ean128AIModel(Ean128AI.ORIGIN, "^422", 3, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUNTRY_INITIAL_PROCESS, "^423", 15, true, true),
|
||||
new Ean128AIModel(Ean128AI.COUNTRY_PROCESS, "^424", 3, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUNTRY_DISASSEMBLY, "^425", 3, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUNTRY_FULL_PROCESS, "^426", 3, false, true),
|
||||
new Ean128AIModel(Ean128AI.NSN, "^7001", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.MEAT_CUT, "^7002", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.DIMENSIONS, "^8001", 14, false, true),
|
||||
new Ean128AIModel(Ean128AI.CMT_NO, "^8002", 20, true, false),
|
||||
new Ean128AIModel(Ean128AI.GRAI, "^8003", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.GIAI, "^8004", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.PRICE_PER_UNIT, "^8005", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.GCTIN, "^8006", 18, false, false),
|
||||
new Ean128AIModel(Ean128AI.IBAN, "^8007", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.PROD_TIME, "^8008", 12, true, true),
|
||||
new Ean128AIModel(Ean128AI.GSRN, "^8018", 18, false, true),
|
||||
new Ean128AIModel(Ean128AI.REF_NO, "^8020", 25, true, false),
|
||||
new Ean128AIModel(Ean128AI.COUPON_1, "^8100", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUPON_2, "^8101", 10, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUPON_3, "^8102", 2, false, true),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_PART, "^90", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_1, "^91", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_2, "^92", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_3, "^93", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_4, "^94", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_5, "^95", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_6, "^96", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_7, "^97", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_8, "^98", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_9, "^99", 30, true, false)
|
||||
};
|
||||
|
||||
|
||||
public int checkAI(String aiToCheck) {
|
||||
int count = -1;
|
||||
|
||||
if (aiToCheck.length() > 1) {
|
||||
for (int i = 0; i < _aiModelArray.length; i++) {
|
||||
final String groupSeparatorCharInHexForRegex = "\\x1D";
|
||||
String codePattern = "";
|
||||
|
||||
if (aiToCheck.charAt(0) == (char) 29) {
|
||||
codePattern += groupSeparatorCharInHexForRegex;
|
||||
}
|
||||
|
||||
codePattern += _aiModelArray[i].code;
|
||||
|
||||
|
||||
Pattern pattern = Pattern.compile(codePattern, Pattern.CASE_INSENSITIVE);
|
||||
Matcher matcher = pattern.matcher(aiToCheck);
|
||||
|
||||
|
||||
if (matcher.find()) {
|
||||
count = i;
|
||||
MatchResult matchResult = matcher.toMatchResult();
|
||||
|
||||
if (matchResult.groupCount() >= 1) {
|
||||
String digitsString = matchResult.group(1);
|
||||
_aiModelArray[i].decimalDigits = Integer.parseInt(digitsString);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
public Ean128AIModel readAI(String aiToSearch) {
|
||||
|
||||
Ean128AIModel barcodeAIModel = null;
|
||||
|
||||
for (Ean128AIModel singleBarcodeAIModel : _aiModelArray) {
|
||||
final String groupSeparatorCharInHexForRegex = "\\x1D";
|
||||
String codePattern = "";
|
||||
|
||||
if (aiToSearch.charAt(0) == (char) 29) {
|
||||
codePattern += groupSeparatorCharInHexForRegex;
|
||||
}
|
||||
|
||||
codePattern += singleBarcodeAIModel.code;
|
||||
|
||||
|
||||
Pattern pattern = Pattern.compile(codePattern, Pattern.CASE_INSENSITIVE);
|
||||
Matcher matcher = pattern.matcher(aiToSearch);
|
||||
|
||||
if (matcher.matches()) {
|
||||
try {
|
||||
barcodeAIModel = (Ean128AIModel) singleBarcodeAIModel.clone();
|
||||
|
||||
MatchResult matchResult = matcher.toMatchResult();
|
||||
|
||||
if (matchResult.groupCount() > 1) {
|
||||
String digitsString = matchResult.group(1);
|
||||
barcodeAIModel.decimalDigits = Integer.parseInt(digitsString);
|
||||
}
|
||||
break;
|
||||
} catch (CloneNotSupportedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return barcodeAIModel;
|
||||
}
|
||||
|
||||
public Ean128AIModel getAI(int index) {
|
||||
return _aiModelArray[index];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package it.integry.integrywmsnative.core.ean128;
|
||||
|
||||
public class Ean128ISOValueModel<T> {
|
||||
|
||||
public String ISOCode;
|
||||
public T Value;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,331 @@
|
||||
package it.integry.integrywmsnative.core.ean128;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.base.Callable;
|
||||
import it.integry.integrywmsnative.core.base.CallableII;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
|
||||
public class Ean128Service {
|
||||
|
||||
public Ean128Model decode(BarcodeScanDTO barcodeScanDTO) throws Exception {
|
||||
byte[] inputEan128ByteArr = barcodeScanDTO.getStringValue().replaceAll("" + ((char) 29), "|").getBytes();
|
||||
Ean128AIModelBij ean128AIModelBij = new Ean128AIModelBij();
|
||||
|
||||
String aiCodeBuffer = "";
|
||||
|
||||
Ean128Model model = new Ean128Model();
|
||||
|
||||
for (int i = 0; i < inputEan128ByteArr.length; i++) {
|
||||
aiCodeBuffer += (char) inputEan128ByteArr[i];
|
||||
|
||||
if (aiCodeBuffer.startsWith("|")) {
|
||||
aiCodeBuffer = aiCodeBuffer.substring(1);
|
||||
}
|
||||
|
||||
if (aiCodeBuffer.length() <= 5) {
|
||||
int aiIndex = ean128AIModelBij.checkAI(aiCodeBuffer);
|
||||
|
||||
if (aiIndex != -1) {
|
||||
|
||||
Ean128AIModel aiModel = ean128AIModelBij.getAI(aiIndex);
|
||||
|
||||
StringBuilder aiValue = new StringBuilder();
|
||||
|
||||
if (!aiModel.flagVariableLength) {
|
||||
|
||||
for (int j = (i + 1); j < (i + 1) + aiModel.dataLength; j++) {
|
||||
aiValue.append((char) inputEan128ByteArr[j]);
|
||||
}
|
||||
|
||||
//aiValue = barcodeAsString.Substring(i + 1, aiModel.DataLength);
|
||||
i += aiModel.dataLength;
|
||||
} else {
|
||||
String tempBuffer = "";
|
||||
|
||||
i++;
|
||||
|
||||
while (i < inputEan128ByteArr.length && i < (aiModel.dataLength + i)) {
|
||||
byte currentChar = inputEan128ByteArr[i];
|
||||
|
||||
if (currentChar != 29 && currentChar != '|') { //Controllo carattere FNC1
|
||||
tempBuffer += (char) currentChar;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
aiValue = new StringBuilder(tempBuffer.replace("\r", "").replace("\n", ""));
|
||||
}
|
||||
|
||||
switch (aiModel.AI) {
|
||||
case SSCC -> {
|
||||
if (aiValue.length() > 0 && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
|
||||
aiValue = new StringBuilder(aiValue.substring(1));
|
||||
}
|
||||
model.Sscc = aiValue.toString();
|
||||
}
|
||||
case GTIN -> {
|
||||
if (aiValue.length() > 0 && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
|
||||
aiValue = new StringBuilder(aiValue.substring(1));
|
||||
}
|
||||
model.Gtin = aiValue.toString();
|
||||
}
|
||||
case CONTENT -> {
|
||||
if (aiValue.length() > 0 && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
|
||||
aiValue = new StringBuilder(aiValue.substring(1));
|
||||
}
|
||||
model.Content = aiValue.toString();
|
||||
}
|
||||
case BATCH_LOT -> model.BatchLot = aiValue.toString();
|
||||
case PROD_DATE -> model.ProdDate = convertToDateTime(aiValue.toString());
|
||||
case DUE_DATE -> model.DueDate = convertToDateTime(aiValue.toString());
|
||||
case PACK_DATE -> model.PackDate = convertToDateTime(aiValue.toString());
|
||||
case BEST_BEFORE ->
|
||||
model.BestBefore = UtilityDate.formatDate(convertToDateTime(aiValue.toString()), UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
|
||||
case EXPIRY -> model.Expiry = UtilityDate.formatDate(convertToDateTime(aiValue.toString()), UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
|
||||
case VARIANT -> model.Variant = aiValue.toString();
|
||||
case SERIAL -> model.Serial = aiValue.toString();
|
||||
case QTY_DATE_BATCH -> model.QtyDateBatch = aiValue.toString();
|
||||
case ADDITIONAL_ID -> model.AdditionalID = aiValue.toString();
|
||||
case CUST_PART_NO -> model.CustPartNumber = aiValue.toString();
|
||||
case SECONDARY_SERIAL -> model.SecondarySerial = aiValue.toString();
|
||||
case REF_TO_SOURCE -> model.RefToSource = aiValue.toString();
|
||||
case VAR_COUNT -> model.VarCount = aiValue.toString();
|
||||
case NET_WEIGHT_KG ->
|
||||
model.NetWeightKg = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_M ->
|
||||
model.LengthM = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_M ->
|
||||
model.WidthM = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_M ->
|
||||
model.HeightM = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_M2 ->
|
||||
model.AreaM2 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_L ->
|
||||
model.NetVolumeL = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_M3 ->
|
||||
model.NetVolumeM3 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_WEIGHT_LB ->
|
||||
model.NetWeightLb = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_I ->
|
||||
model.LengthI = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_F ->
|
||||
model.LengthF = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_Y ->
|
||||
model.LengthY = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_I ->
|
||||
model.WidthI = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_F ->
|
||||
model.WidthF = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_Y ->
|
||||
model.WidthY = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_I ->
|
||||
model.HeightI = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_F ->
|
||||
model.HeightF = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_Y ->
|
||||
model.HeightY = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case CROSSWEIGHT_KG_LOG ->
|
||||
model.CrossweightKgLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case CROSSWEIGHT_LB_LOG ->
|
||||
model.CrossweightLbLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_M_LOG ->
|
||||
model.LengthMLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_M_LOG ->
|
||||
model.WidthMLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_M_LOG ->
|
||||
model.HeigthMLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_M2_LOG ->
|
||||
model.AreaM2Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_L_LOG ->
|
||||
model.VolumeLLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_M3_LOG ->
|
||||
model.VolumeM3Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_I_LOG ->
|
||||
model.LengthILog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_F_LOG ->
|
||||
model.LengthFLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_Y_LOG ->
|
||||
model.LengthYLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_I_LOG ->
|
||||
model.WidthILog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_F_LOG ->
|
||||
model.WidthFLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_Y_LOG ->
|
||||
model.WidthYLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_I_LOG ->
|
||||
model.HeigthILog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_F_LOG ->
|
||||
model.HeigthFLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_Y_LOG ->
|
||||
model.HeigthYLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_I2 ->
|
||||
model.AreaI2 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_F2 ->
|
||||
model.AreaF2 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_Y2 ->
|
||||
model.AreaY2 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_I2_LOG ->
|
||||
model.AreaI2Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_F2_LOG ->
|
||||
model.AreaF2Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_Y2_LOG ->
|
||||
model.AreaY2Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_WEIGHT_T ->
|
||||
model.NetWeightT = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_OZ ->
|
||||
model.NetVolumeOz = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_LB ->
|
||||
model.NetVolumeLb = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_G ->
|
||||
model.NetVolumeG = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_Q_LOG ->
|
||||
model.VolumeQLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_G_LOG ->
|
||||
model.VolumeGLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_I3 ->
|
||||
model.NetVolumeI3 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_F3 ->
|
||||
model.NetVolumeF3 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_Y3 ->
|
||||
model.NetVolumeY3 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_I3_LOG ->
|
||||
model.VolumeI3Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_F3_LOG ->
|
||||
model.VolumeF3Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_Y3_LOG ->
|
||||
model.VolumeY3Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case COUNT -> model.Count = Integer.parseInt(aiValue.toString());
|
||||
case AMOUNT ->
|
||||
model.Amount = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AMOUNT_ISO ->
|
||||
model.AmountISO = convertToIsoValueModel(aiValue.toString(), aiModel.decimalDigits,
|
||||
Double::parseDouble,
|
||||
(input, input2) -> String.valueOf(convertToDecimalString(input, input2)));
|
||||
case PRICE ->
|
||||
model.Price = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case PRICE_ISO ->
|
||||
model.PriceISO = convertToIsoValueModel(aiValue.toString(), aiModel.decimalDigits,
|
||||
Double::parseDouble,
|
||||
(input, input2) -> String.valueOf(convertToDecimalString(input, input2)));
|
||||
case ORDER_NUMBER -> model.OrderNumber = aiValue.toString();
|
||||
case CONSIGNMENT -> model.Consignment = aiValue.toString();
|
||||
case SHIPMENT_NO -> model.ShipmentNo = aiValue.toString();
|
||||
case ROUTE -> model.Route = aiValue.toString();
|
||||
case SHIP_TO_LOC -> model.ShipToLoc = aiValue.toString();
|
||||
case BILL_TO_LOC -> model.BillToLoc = aiValue.toString();
|
||||
case PURCHASE_FROM_LOC -> model.PurchaseFromLoc = aiValue.toString();
|
||||
case SHIP_FOR_LOC -> model.ShipForLoc = aiValue.toString();
|
||||
case LOC_NO -> model.LocationNumber = aiValue.toString();
|
||||
case PAY_TO_LOC -> model.PayToLoc = aiValue.toString();
|
||||
case SHIP_TO_POST -> model.ShipToPost = aiValue.toString();
|
||||
case SHIP_TO_POST_ISO ->
|
||||
model.ShipToPostISO = convertToIsoValueModel(aiValue.toString(), 0,
|
||||
new Callable<String, String>() {
|
||||
@Override
|
||||
public String call(String input) {
|
||||
return input;
|
||||
}
|
||||
},
|
||||
new CallableII<String, Integer, String>() {
|
||||
@Override
|
||||
public String call(String input, Integer input2) {
|
||||
return input;
|
||||
}
|
||||
});
|
||||
case ORIGIN -> model.Origin = aiValue.toString();
|
||||
case COUNTRY_INITIAL_PROCESS ->
|
||||
model.ShipToPostISO = convertToIsoValueModel(aiValue.toString(), 0,
|
||||
input -> input,
|
||||
(input, input2) -> input);
|
||||
case COUNTRY_PROCESS -> model.CountryProcess = aiValue.toString();
|
||||
case COUNTRY_DISASSEMBLY -> model.CountryDisassembly = aiValue.toString();
|
||||
case COUNTRY_FULL_PROCESS -> model.CountryFullProcess = aiValue.toString();
|
||||
case NSN -> model.NSN = aiValue.toString();
|
||||
case MEAT_CUT -> model.MeatCut = aiValue.toString();
|
||||
case DIMENSIONS -> model.Dimensions = aiValue.toString();
|
||||
case CMT_NO -> model.CmtNo = aiValue.toString();
|
||||
case GRAI -> model.Grai = aiValue.toString();
|
||||
case GIAI -> model.Giai = aiValue.toString();
|
||||
case PRICE_PER_UNIT -> model.PricePerUnit = aiValue.toString();
|
||||
case GCTIN -> model.Gctin = aiValue.toString();
|
||||
case IBAN -> model.Iban = aiValue.toString();
|
||||
case PROD_TIME -> model.ProdTime = convertToDateTime(aiValue.toString());
|
||||
case GSRN -> model.Gsrn = aiValue.toString();
|
||||
case REF_NO -> model.RefNo = aiValue.toString();
|
||||
case COUPON_1 -> model.Coupon1 = aiValue.toString();
|
||||
case COUPON_2 -> model.Coupon2 = aiValue.toString();
|
||||
case COUPON_3 -> model.Coupon3 = aiValue.toString();
|
||||
case INTERNAL_PART -> model.InternalPart = aiValue.toString();
|
||||
case INTERNAL_1 -> model.Internal1 = aiValue.toString();
|
||||
case INTERNAL_2 -> model.Internal2 = aiValue.toString();
|
||||
case INTERNAL_3 -> model.Internal3 = aiValue.toString();
|
||||
case INTERNAL_4 -> model.Internal4 = aiValue.toString();
|
||||
case INTERNAL_5 -> model.Internal5 = aiValue.toString();
|
||||
case INTERNAL_6 -> model.Internal6 = aiValue.toString();
|
||||
case INTERNAL_7 -> model.Internal7 = aiValue.toString();
|
||||
case INTERNAL_8 -> model.Internal8 = aiValue.toString();
|
||||
case INTERNAL_9 -> model.Internal9 = aiValue.toString();
|
||||
default -> {
|
||||
}
|
||||
}
|
||||
|
||||
aiCodeBuffer = "";
|
||||
}
|
||||
} else {
|
||||
throw new Exception(String.format("Il barcode non è un EAN128 valido (%s)", new String(inputEan128ByteArr)));
|
||||
}
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
private float convertToDecimalString(String sourceString, int numberOfdecimalDigits) {
|
||||
|
||||
int divider = (int) Math.pow(10, numberOfdecimalDigits);
|
||||
|
||||
return Float.parseFloat(sourceString) / divider;
|
||||
}
|
||||
|
||||
private <T> Ean128ISOValueModel<T> convertToIsoValueModel(String sourceString, int numberOfDecimalDigits, Callable<String, T> castFunc, CallableII<String, Integer, String> splitFunc) {
|
||||
String isoCode = sourceString.substring(0, 3);
|
||||
|
||||
T value = castFunc.call(splitFunc.call(sourceString.substring(3), numberOfDecimalDigits));
|
||||
|
||||
Ean128ISOValueModel<T> isoModel = new Ean128ISOValueModel<T>();
|
||||
isoModel.ISOCode = isoCode;
|
||||
isoModel.Value = value;
|
||||
|
||||
return isoModel;
|
||||
}
|
||||
|
||||
private Date convertToDateTime(String sourceString) {
|
||||
int year = Integer.parseInt(sourceString.substring(0, 2));
|
||||
|
||||
//Se l'anno è minore di 50 indica 2000-2050 altrimenti 1951-1999
|
||||
int correctedYear = year <= 50 ? (2000 + year) : (1900 + year);
|
||||
|
||||
int month = Integer.parseInt(sourceString.substring(2, 4));
|
||||
int day = Integer.parseInt(sourceString.substring(4, 6));
|
||||
|
||||
Date d = null;
|
||||
|
||||
try {
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
|
||||
d = formatter.parse(day + "/" + month + "/" + correctedYear);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public final class InvalidCodMdepException extends Exception {
|
||||
public InvalidCodMdepException() {
|
||||
super(UtilityResources.getString(R.string.invalid_codmdep));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public class InvalidLineaProdBarcodeException extends Exception {
|
||||
|
||||
public InvalidLineaProdBarcodeException() {
|
||||
super(UtilityResources.getString(R.string.no_result_from_linea_prod_barcode));
|
||||
}
|
||||
|
||||
public InvalidLineaProdBarcodeException(String barcode) {
|
||||
super(UtilityResources.getString(R.string.no_result_from_linea_prod_barcode) + " (" + barcode + ")");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public class NoOrdersScheduledException extends Exception {
|
||||
|
||||
public NoOrdersScheduledException() {
|
||||
super(UtilityResources.getString(R.string.no_orders_scheduled));
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,11 @@ public class BaseActivity extends AppCompatActivity {
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
||||
try {
|
||||
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
||||
} catch (IllegalStateException ise) {
|
||||
//ignored
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.Date;
|
||||
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.UtilityString;
|
||||
|
||||
public class MtbColr extends EntityBase {
|
||||
|
||||
@@ -372,7 +373,7 @@ public class MtbColr extends EntityBase {
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
return UtilityString.isNull(descrizione, getMtbAart() != null ? UtilityString.isNull(getMtbAart().getDescrizioneEstesa(), getMtbAart().getDescrizione()) : null);
|
||||
}
|
||||
|
||||
public MtbColr setDescrizione(String descrizione) {
|
||||
|
||||
@@ -2,8 +2,11 @@ package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
|
||||
/**
|
||||
* Created by ValerioC on 06/03/2018.
|
||||
@@ -38,6 +41,8 @@ public class MvwSitArtUdcDetInventario {
|
||||
private BigDecimal pesoLordoKg;
|
||||
private String codJfas;
|
||||
private MtbAart mtbAart;
|
||||
private Integer numOrd;
|
||||
private Date dataOrd;
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
@@ -282,6 +287,21 @@ public class MvwSitArtUdcDetInventario {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumOrd() {
|
||||
return numOrd;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setNumOrd(Integer numOrd) {
|
||||
this.numOrd = numOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getQtaText(){
|
||||
String text = UtilityNumber.decimalToString(this.qtaCol);
|
||||
text += !UtilityString.isNullOrEmpty(this.untMis) ? "\n" + this.untMis : "";
|
||||
return text;
|
||||
}
|
||||
|
||||
public MtbColr toMtbColr() {
|
||||
return new MtbColr()
|
||||
.setCodJcom(getCodJcom())
|
||||
@@ -299,4 +319,13 @@ public class MvwSitArtUdcDetInventario {
|
||||
.setPesoLordoKg(getPesoLordoKg())
|
||||
.setUntMis(getUntMis());
|
||||
}
|
||||
|
||||
public Date getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setDataOrd(Date dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package it.integry.integrywmsnative.core.model.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.secondary.StatoPartitaMag;
|
||||
|
||||
public class StatoArticoloDTO {
|
||||
private String codMart;
|
||||
|
||||
@@ -17,7 +19,7 @@ public class StatoArticoloDTO {
|
||||
|
||||
private Integer ggUtili;
|
||||
|
||||
private Integer statoArt;
|
||||
private StatoPartitaMag statoArt;
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
@@ -82,11 +84,11 @@ public class StatoArticoloDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getStatoArt() {
|
||||
public StatoPartitaMag getStatoArt() {
|
||||
return statoArt;
|
||||
}
|
||||
|
||||
public StatoArticoloDTO setStatoArt(Integer statoArt) {
|
||||
public StatoArticoloDTO setStatoArt(StatoPartitaMag statoArt) {
|
||||
this.statoArt = statoArt;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -2,9 +2,10 @@ package it.integry.integrywmsnative.core.model.secondary;
|
||||
|
||||
public enum StatoPartitaMag {
|
||||
|
||||
IN_SCADENZA(1),
|
||||
SCADUTO(2),
|
||||
NON_IN_SCADENZA(3);
|
||||
SCADUTO(1),
|
||||
IN_SCADENZA(2),
|
||||
NON_IN_SCADENZA(3),
|
||||
DISATTIVO(4);
|
||||
|
||||
private final int text;
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ public enum ReportType {
|
||||
ETICHETTA_SSCC_LAVORAZIONE(1),
|
||||
@SerializedName("2")
|
||||
ETICHETTA_SSCC_SPEDIZIONE(2),
|
||||
@SerializedName("3")
|
||||
WMS_SPEDIZIONE_ETICHETTE_SSCC_ORD(3),
|
||||
@SerializedName("4")
|
||||
WMS_SPEDIZIONE_PACKING_LIST_ORD(4),
|
||||
@SerializedName("5")
|
||||
|
||||
@@ -78,14 +78,12 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
.setCodMarts(codMarts))
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||
analyzeAnswer(response, "getByCodMart", (m) -> {
|
||||
onComplete.run(response.body().getEntityList());
|
||||
}, onFailed);
|
||||
public void onResponse(Call<ServiceRESTResponse<List<MtbAart>>> call, Response<ServiceRESTResponse<List<MtbAart>>> response) {
|
||||
analyzeAnswer(response, "getByCodMart", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<MtbAart>> call, Throwable t) {
|
||||
public void onFailure(Call<ServiceRESTResponse<List<MtbAart>>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
@@ -112,26 +110,9 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public void getByCodMart(String codMartToFind, RunnableArgs<MtbAart> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
articoloRESTConsumer.getByCodMart(
|
||||
new RetrieveArticoloByCodMartRequestDTO()
|
||||
.setCodMarts(Collections.singletonList(codMartToFind)))
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||
analyzeAnswer(response, "getByCodMart", (m) -> {
|
||||
if (response.body().getEntityList() != null && !response.body().getEntityList().isEmpty()) {
|
||||
onComplete.run(response.body().getEntityList().get(0));
|
||||
} else onComplete.run(null);
|
||||
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<MtbAart>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
getByCodMarts(Collections.singletonList(codMartToFind), artList -> {
|
||||
onComplete.run(artList != null && !artList.isEmpty() ? artList.get(0) : null);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public interface ArticoloRESTConsumerService {
|
||||
Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> searchByBarcode(@Body() SearchArticoloByBarcodeRequestDTO searchArticoloByBarcodeRequest);
|
||||
|
||||
@POST("wms/articolo/retrieveByCodMart")
|
||||
Call<ServiceRESTResponse<MtbAart>> getByCodMart(@Body RetrieveArticoloByCodMartRequestDTO retrieveArticoloByCodMartRequest);
|
||||
Call<ServiceRESTResponse<List<MtbAart>>> getByCodMart(@Body RetrieveArticoloByCodMartRequestDTO retrieveArticoloByCodMartRequest);
|
||||
|
||||
@POST("wms/articolo/updateBarcodeImballo")
|
||||
Call<ServiceRESTResponse<Void>> updateBarcodeImballo(@Body UpdateBarcodeImballoRequestDTO updateBarcodeImballoRequest);
|
||||
|
||||
@@ -3,32 +3,24 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.ean128.Ean128Service;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
@Singleton
|
||||
public class BarcodeRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final Ean128Service ean128Service;
|
||||
|
||||
public BarcodeRESTConsumer(Ean128Service ean128Service) {
|
||||
this.ean128Service = ean128Service;
|
||||
}
|
||||
|
||||
public 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<>() {
|
||||
@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));
|
||||
}
|
||||
});
|
||||
try {
|
||||
onComplete.run(this.ean128Service.decode(barcodeObj));
|
||||
} catch (Exception e){
|
||||
onFailed.run(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.util.List;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.BuildConfig;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||
@@ -696,6 +697,11 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
public void printUL(PrintULRequestDTO printULRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
|
||||
colliMagazzinoRESTConsumerService.printUL(printULRequestDTO)
|
||||
|
||||
@@ -9,7 +9,6 @@ import java.util.List;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepo;
|
||||
|
||||
@Singleton
|
||||
@@ -28,27 +27,4 @@ public class DepositoRESTConsumer extends _BaseRESTConsumer {
|
||||
}.getType();
|
||||
this.systemRESTConsumer.processSql("SELECT * FROM mtb_depo", typeOfObjectsList, onComplete, onFailed);
|
||||
}
|
||||
|
||||
public void getDepoByCodMdep(String codMdep, RunnableArgs<MtbDepo> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
MtbDepo mtbDepo = new MtbDepo();
|
||||
mtbDepo.setCodMdep(codMdep);
|
||||
mtbDepo.setOperation(CommonModelConsts.OPERATION.SELECT);
|
||||
mtbDepo.setOnlyPkMaster(false);
|
||||
|
||||
this.entityRESTConsumer.selectEntity(mtbDepo, new ISimpleOperationCallback<>() {
|
||||
@Override
|
||||
public void onSuccess(List<MtbDepo> value) {
|
||||
if (value != null && value.size() > 0) {
|
||||
onComplete.run(value.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
onFailed.run(ex);
|
||||
}
|
||||
}, MtbDepo.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
if (response.body() != null) {
|
||||
if (response.body().getEsito() == EsitoType.OK) {
|
||||
Gson gson = new Gson();
|
||||
Gson gson = UtilityGson.createObject();
|
||||
T object = gson.fromJson(response.body().getEntity(), type);
|
||||
|
||||
callback.onSuccess(object);
|
||||
@@ -121,18 +121,19 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
@Deprecated
|
||||
public <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>>() {
|
||||
request.enqueue(new Callback<>() {
|
||||
@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();
|
||||
Gson gson = UtilityGson.createObject();
|
||||
List<JsonObject> jsons = response.body().getEntityList();
|
||||
|
||||
List<T> newList = new ArrayList<T>();
|
||||
|
||||
@@ -17,6 +17,7 @@ import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationIncomingItemDto;
|
||||
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationResponseDto;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.ArtsInGiacenzaDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
@@ -38,6 +39,48 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||
giacenzaRESTConsumerService.retrieveAvailableItems(posizione.getPosizione()).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Response<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> response) {
|
||||
analyzeAnswer(response, "getGiacenzeInPosizione", inventarioList -> {
|
||||
|
||||
if(inventarioList != null && !inventarioList.isEmpty()){
|
||||
List<String> codMarts = Stream.of(inventarioList)
|
||||
.map(x -> x.getCodMart().trim())
|
||||
.toList();
|
||||
|
||||
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||
for (var row : inventarioList) {
|
||||
|
||||
MtbAart foundMtbAart = null;
|
||||
Optional<MtbAart> mtbAartOpt = Stream.of(mtbAarts)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(row.getCodMart()))
|
||||
.findFirst();
|
||||
|
||||
if (mtbAartOpt.isPresent()) {
|
||||
foundMtbAart = mtbAartOpt.get();
|
||||
}
|
||||
|
||||
row.setMtbAart(foundMtbAart);
|
||||
}
|
||||
|
||||
onComplete.run(inventarioList);
|
||||
}, onFailed);
|
||||
}else{
|
||||
onComplete.run(new ArrayList<>());
|
||||
}
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getGiacenzeInPosizione(List<String> posizioni, boolean withTestataCollo, RunnableArgs<List<ArtsInGiacenzaDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
GiacenzaRESTConsumerService giacenzaRESTConsumerService = RESTBuilder.getService(GiacenzaRESTConsumerService.class);
|
||||
giacenzaRESTConsumerService.retrieveAvailableItems(posizioni, withTestataCollo).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> call, Response<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> response) {
|
||||
analyzeAnswer(response, "getGiacenzeInPosizione", inventarioList -> {
|
||||
|
||||
List<String> codMarts = Stream.of(inventarioList)
|
||||
@@ -45,18 +88,22 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||
.toList();
|
||||
|
||||
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||
for (var row : inventarioList) {
|
||||
for (var articoli : inventarioList) {
|
||||
List<MvwSitArtUdcDetInventario> mvwSitArtUdcDetInventario = articoli.getMvwSitArtUdcDetInventarioDTO();
|
||||
if (mvwSitArtUdcDetInventario != null && !mvwSitArtUdcDetInventario.isEmpty()){
|
||||
for (var row : mvwSitArtUdcDetInventario){
|
||||
MtbAart foundMtbAart = null;
|
||||
Optional<MtbAart> mtbAartOpt = Stream.of(mtbAarts)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(row.getCodMart()))
|
||||
.findFirst();
|
||||
|
||||
MtbAart foundMtbAart = null;
|
||||
Optional<MtbAart> mtbAartOpt = Stream.of(mtbAarts)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(row.getCodMart()))
|
||||
.findFirst();
|
||||
if (mtbAartOpt.isPresent()) {
|
||||
foundMtbAart = mtbAartOpt.get();
|
||||
}
|
||||
|
||||
if (mtbAartOpt.isPresent()) {
|
||||
foundMtbAart = mtbAartOpt.get();
|
||||
row.setMtbAart(foundMtbAart);
|
||||
}
|
||||
}
|
||||
|
||||
row.setMtbAart(foundMtbAart);
|
||||
}
|
||||
|
||||
onComplete.run(inventarioList);
|
||||
@@ -65,7 +112,7 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> call, Throwable t) {
|
||||
public void onFailure(Call<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2,11 +2,16 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.DtbDoct;
|
||||
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
||||
import it.integry.integrywmsnative.core.rest.model.LoadColliDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.giacenza.InstantItemSituationResponseDto;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.ArtsInGiacenzaDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface GiacenzaRESTConsumerService {
|
||||
@@ -15,6 +20,9 @@ public interface GiacenzaRESTConsumerService {
|
||||
Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> retrieveAvailableItems(
|
||||
@Query("posizione") String posizione);
|
||||
|
||||
@POST("wms/giacenza/availableItemsByPosizione")
|
||||
Call<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> retrieveAvailableItems(@Body List<String> posizioni, @Query("withTestataCollo") boolean withTestataCollo);
|
||||
|
||||
@GET("wms/giacenza/availableItemsByArticolo")
|
||||
Call<ServiceRESTResponse<List<MvwSitArtUdcDetInventario>>> retrieveAvailableItemsByArt(
|
||||
@Query("codMart") String codMart);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
@@ -10,6 +12,7 @@ import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.DtbOrdt;
|
||||
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
@@ -86,4 +89,20 @@ public class MagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void retrievePartitaMag(String partitaMag, String codMart, RunnableArgs<MtbPartitaMag> onComplete, RunnableArgs<Exception> onFailed){
|
||||
MagazzinoRESTConsumerService service = RESTBuilder.getService(MagazzinoRESTConsumerService.class);
|
||||
service.retrievePartitaMag(codMart, partitaMag)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<ServiceRESTResponse<MtbPartitaMag>> call, @NonNull Response<ServiceRESTResponse<MtbPartitaMag>> response) {
|
||||
analyzeAnswer(response, "retrievePartitaMag", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<ServiceRESTResponse<MtbPartitaMag>> call, @NonNull Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,11 +3,14 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.DtbOrdt;
|
||||
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface MagazzinoRESTConsumerService {
|
||||
|
||||
@@ -17,4 +20,8 @@ public interface MagazzinoRESTConsumerService {
|
||||
@POST("SM2SaveTerminalino")
|
||||
Call<List<ServiceRESTResponse<DtbOrdt>>> saveOrdine(@Body SaveDTO saveDTO);
|
||||
|
||||
@GET("wms/partita-magazzino/retrievePartitaMag")
|
||||
Call<ServiceRESTResponse<MtbPartitaMag>> retrievePartitaMag(@Query("codMart") String codMart,
|
||||
@Query("partitaMag") String partitaMag);
|
||||
|
||||
}
|
||||
|
||||
@@ -64,10 +64,10 @@ public class MesRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
public void getOrdiniLavorazione(Date dateStart, String flagEvaso, String codJfas, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public void getOrdiniLavorazione(String flagEvaso, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
||||
|
||||
mesRESTConsumerService.getOrdiniLavorazione(UtilityDate.formatDate(dateStart, UtilityDate.COMMONS_DATE_FORMATS.YMD_DASH), flagEvaso, codJfas)
|
||||
mesRESTConsumerService.getOrdiniLavorazione(flagEvaso)
|
||||
.enqueue(new Callback<ServiceRESTResponse<List<OrdineLavorazioneDTO>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
||||
|
||||
@@ -20,7 +20,7 @@ public interface MesRESTConsumerService {
|
||||
|
||||
|
||||
@GET("mes_v2/getOrdiniLavorazione")
|
||||
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazione(@Query("startDate") String startDate, @Query("flagEvaso") String flagEvaso, @Query("codJfas") String codJfas);
|
||||
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazione(@Query("flagEvaso") String flagEvaso);
|
||||
|
||||
@GET("mes_v2/getOrdiniLavorazione")
|
||||
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazione(@Query("startDate") String startDate, @Query("flagEvaso") String flagEvaso, @Query("codJfas") String codJfas, @Query("codAnag") String codAnag);
|
||||
|
||||
@@ -157,6 +157,10 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
public void printClosedOrders(PrintOrderCloseDTO dto, String codMdep, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class, 240);
|
||||
Call<ServiceRESTResponse<Object>> callable = printerService.printClosedOrders(codMdep, dto);
|
||||
|
||||
@@ -32,6 +32,7 @@ import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.system.RegisterDeviceRequestDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityGson;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
@@ -72,15 +73,7 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||
analyzeAnswer(response, "ProcessSql", o -> {
|
||||
Gson gson = new GsonBuilder()
|
||||
.registerTypeAdapter(Date.class, (JsonDeserializer<?>) (json, typeOfT, context) -> {
|
||||
try {
|
||||
return UtilityDate.recognizeDate(json.getAsString());
|
||||
} catch (Exception e) {
|
||||
throw new JsonParseException(e);
|
||||
}
|
||||
})
|
||||
.create();
|
||||
Gson gson = UtilityGson.createObject();
|
||||
|
||||
|
||||
String json = gson.toJson(o);
|
||||
|
||||
@@ -13,15 +13,13 @@ import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
|
||||
public class LocalDateDeserializer implements JsonDeserializer<LocalDate> {
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH);
|
||||
|
||||
|
||||
@Override
|
||||
public LocalDate deserialize(JsonElement element, Type arg1, JsonDeserializationContext arg2) throws JsonParseException {
|
||||
String date = element.getAsString();
|
||||
if (UtilityString.isNullOrEmpty(date)) return null;
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(UtilityString.determineDateFormat(date));
|
||||
|
||||
return LocalDate.parse(date, formatter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package it.integry.integrywmsnative.core.rest.deserializer;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.secondary.StatoPartitaMag;
|
||||
|
||||
public class StatoPartitaMagDeserializer implements JsonDeserializer<StatoPartitaMag> {
|
||||
@Override
|
||||
public StatoPartitaMag deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||
if (json.isJsonNull()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int text = json.getAsInt();
|
||||
return StatoPartitaMag.from(text);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
package it.integry.integrywmsnative.core.rest.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import it.integry.integrywmsnative.core.ean128.Ean128ISOValueModel;
|
||||
|
||||
public class Ean128Model {
|
||||
|
||||
@@ -16,13 +19,13 @@ public class Ean128Model {
|
||||
public String BatchLot;
|
||||
|
||||
///<summary>Data di produzione (yymmdd) 0~50 (2000~2050) - 51~99 (1951~1999)</summary>
|
||||
public String ProdString;
|
||||
public Date ProdDate;
|
||||
|
||||
///<summary>Data di scadenza pagamento fattura</summary>
|
||||
public String DueString;
|
||||
public Date DueDate;
|
||||
|
||||
///<summary>Data di confezionamento</summary>
|
||||
public String PackString;
|
||||
public Date PackDate;
|
||||
|
||||
///<summary>Data minima di validità</summary>
|
||||
public String BestBefore;
|
||||
@@ -37,7 +40,7 @@ public class Ean128Model {
|
||||
public String Serial;
|
||||
|
||||
///<summary>Dati supplementari per prodotti farmaceutici</summary>
|
||||
public String QtyStringBatch;
|
||||
public String QtyDateBatch;
|
||||
|
||||
///<summary>Numedi di identificazione supplementare del prodotto</summary>
|
||||
public String AdditionalID;
|
||||
@@ -216,9 +219,15 @@ public class Ean128Model {
|
||||
///<summary>Importo da pagare singola area monetaria</summary>
|
||||
public Float Amount;
|
||||
|
||||
///<summary>Importo da pagare con codice valuta ISO</summary>
|
||||
public Ean128ISOValueModel<Double> AmountISO;
|
||||
|
||||
///<summary>Importo da pagare singola unità monetaria (prodotti a peso variabile)</summary>
|
||||
public Float Price;
|
||||
|
||||
///<summary>Importo da pagare con codice valuta ISO (prodotti a peso variabile)</summary>
|
||||
public Ean128ISOValueModel<Double> PriceISO;
|
||||
|
||||
///<summary>Numero d'ordine d'acquisto cliente</summary>
|
||||
public String OrderNumber;
|
||||
|
||||
@@ -252,9 +261,15 @@ public class Ean128Model {
|
||||
///<summary>Codice postale "Spedire a, Consegnare a" (nazionale)</summary>
|
||||
public String ShipToPost;
|
||||
|
||||
///<summary>Codice postale "Spedire a, Consegnare a" con codice nazione ISO</summary>
|
||||
public Ean128ISOValueModel<String> ShipToPostISO;
|
||||
|
||||
///<summary>Paese di origine del prodotto</summary>
|
||||
public String Origin;
|
||||
|
||||
///<summary>Paese di lavorazione iniziale del prodotto con codice nazionale ISO</summary>
|
||||
public Ean128ISOValueModel<String> CountryInitialProcess;
|
||||
|
||||
///<summary>Paese di lavorazione con codice nazionale ISO</summary>
|
||||
public String CountryProcess;
|
||||
|
||||
@@ -292,7 +307,7 @@ public class Ean128Model {
|
||||
public String Iban;
|
||||
|
||||
///<summary>Data e ora di produzione</summary>
|
||||
public String ProdTime;
|
||||
public Date ProdTime;
|
||||
|
||||
///<summary>Numedo Globale di Relazione di Servizio</summary>
|
||||
public String Gsrn;
|
||||
@@ -313,7 +328,7 @@ public class Ean128Model {
|
||||
public String InternalPart;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal1; //USED FOR COD_MART
|
||||
public String Internal1;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal2;
|
||||
@@ -338,5 +353,4 @@ public class Ean128Model {
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal9;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ public class CreateUDCRequestDTO {
|
||||
private String serCollo;
|
||||
private String codAnag;
|
||||
private String codTcol;
|
||||
|
||||
private String barcodeUl;
|
||||
private String annotazioni;
|
||||
|
||||
private List<CreateUDCRequestOrderDTO> orders;
|
||||
@@ -60,6 +60,15 @@ public class CreateUDCRequestDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarcodeUl() {
|
||||
return barcodeUl;
|
||||
}
|
||||
|
||||
public CreateUDCRequestDTO setBarcodeUl(String barcodeUl) {
|
||||
this.barcodeUl = barcodeUl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAnnotazioni() {
|
||||
return annotazioni;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,11 @@ public class CreateUDSRequestDTO {
|
||||
private Integer numCollo;
|
||||
private String serCollo;
|
||||
private int causaleCollo;
|
||||
|
||||
private String codJfas;
|
||||
private String codAnag;
|
||||
private String codVdes;
|
||||
private String rifOrd;
|
||||
private boolean orderRequired;
|
||||
private List<CreateUDSRequestOrderDTO> orders;
|
||||
|
||||
public String getCodMdep() {
|
||||
@@ -67,6 +71,51 @@ public class CreateUDSRequestDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJfas() {
|
||||
return codJfas;
|
||||
}
|
||||
|
||||
public CreateUDSRequestDTO setCodJfas(String codJfas) {
|
||||
this.codJfas = codJfas;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public CreateUDSRequestDTO setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodVdes() {
|
||||
return codVdes;
|
||||
}
|
||||
|
||||
public CreateUDSRequestDTO setCodVdes(String codVdes) {
|
||||
this.codVdes = codVdes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRifOrd() {
|
||||
return rifOrd;
|
||||
}
|
||||
|
||||
public CreateUDSRequestDTO setRifOrd(String rifOrd) {
|
||||
this.rifOrd = rifOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isOrderRequired() {
|
||||
return orderRequired;
|
||||
}
|
||||
|
||||
public CreateUDSRequestDTO setOrderRequired(boolean orderRequired) {
|
||||
this.orderRequired = orderRequired;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<CreateUDSRequestOrderDTO> getOrders() {
|
||||
return orders;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package it.integry.integrywmsnative.core.rest.serializer;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
import com.google.gson.JsonSerializationContext;
|
||||
import com.google.gson.JsonSerializer;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.secondary.StatoPartitaMag;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
|
||||
public class StatoPartitaMagSerializer implements JsonSerializer<StatoPartitaMag> {
|
||||
@Override
|
||||
public JsonElement serialize(StatoPartitaMag src, Type typeOfSrc, JsonSerializationContext context) {
|
||||
return new JsonPrimitive(src.getText());
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,6 @@ public class DBSettingsModel {
|
||||
private boolean enableCheckPartitaMagCheckPickingV;
|
||||
private boolean flagMultiClienteOrdV;
|
||||
private boolean flagUseCodAnagAziendale;
|
||||
private String defaultCausaleRettificaGiacenze;
|
||||
private boolean flagAskClienteInPickingLibero;
|
||||
private boolean flagPickLiberoAllowEmptyCliente;
|
||||
|
||||
@@ -28,7 +27,6 @@ public class DBSettingsModel {
|
||||
private boolean flagCanAutoOpenNewULAccettazione;
|
||||
private boolean flagCanAddExtraQuantitySpedizione;
|
||||
private boolean flagEnableCheckDepositoSpedizione;
|
||||
private boolean flagUseNewPickingListSpedizione;
|
||||
private boolean flagVersamentoDirettoProduzione;
|
||||
private boolean flagAskPesoColloSpedizione;
|
||||
private boolean flagForceAllToColli;
|
||||
@@ -40,7 +38,6 @@ public class DBSettingsModel {
|
||||
private boolean flagOrdinaArticoliOnScan;
|
||||
private boolean flagConsentiFuoriPianoLogistico;
|
||||
private boolean flagConsentiOrdineSenzaGriglia;
|
||||
private String docInterniCheckFornitore;
|
||||
private String produzioneDefaultCodAnag;
|
||||
private boolean flagPrintPackingListOnOrderClose;
|
||||
private boolean flagPrintEtichetteOnOrderClose;
|
||||
@@ -55,6 +52,7 @@ public class DBSettingsModel {
|
||||
private boolean notifyLotStatus = false;
|
||||
|
||||
private boolean groupShippingByCommodityGroup = true;
|
||||
private boolean groupPoductionByCommodityGroup;
|
||||
private boolean showCodFornSpedizione = true;
|
||||
private boolean flagCanCreateInventario = true;
|
||||
private boolean flagCanAddUnknownItemsInventario = true;
|
||||
@@ -62,14 +60,21 @@ public class DBSettingsModel {
|
||||
private String commessaMagazzino;
|
||||
private boolean flagGeneraDocumentoSpedizione = false;
|
||||
private boolean flagIsInventarioCacheEnabled = false;
|
||||
private boolean flagAskPrintUlAccettazioneBolla = false;
|
||||
private boolean flagAskTipoColloAccettazioneBolla = false;
|
||||
private boolean flagAskVersamentoAutomaticoAccettazioneBolla = false;
|
||||
private boolean flagCanAddUnknownItemsAccettazioneBolla = false;
|
||||
private boolean flagCanAddUnknownBarcodesAccettazioneBolla = false;
|
||||
private boolean flagEnableFastPickAccettazioneBolla = false;
|
||||
private boolean flagDisableMandatoryTracciabilitaAccettazioneBolla = false;
|
||||
private boolean flagOverflowQuantityWarning = false;
|
||||
private boolean flagAccettazioneBollaAskPrintUl = false;
|
||||
private boolean flagAccettazioneBollaAskTipoCollo = false;
|
||||
private boolean flagAccettazioneBollaAskVersamentoAutomatico = false;
|
||||
private boolean flagAccettazioneBollaCanAddUnknownItems = false;
|
||||
private boolean flagAccettazioneBollaCanAddUnknownBarcodes = false;
|
||||
private boolean flagAccettazioneBollaEnableFastPick = false;
|
||||
private boolean flagAccettazioneBollaDisableMandatoryTracciabilita = false;
|
||||
private boolean flagAccettazioneBollaAllowULRecover = true;
|
||||
private boolean flagSpedizioneOverflowQuantityWarning = false;
|
||||
private String viewPosizioni;
|
||||
private boolean flagAccettazioneDeleteRowOnClose = false;
|
||||
private boolean flagAccettazioneAllowBarcodeFornitore = false;
|
||||
private boolean flagProduzioneShowInfo = false;
|
||||
private boolean flagAccettazioneBollaUseQtaOrd = true;
|
||||
private boolean flagWarningNewPartitaMag = false;
|
||||
|
||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||
return flagSpedizioneEnableFakeGiacenza;
|
||||
@@ -332,15 +337,6 @@ public class DBSettingsModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDocInterniCheckFornitore() {
|
||||
return docInterniCheckFornitore;
|
||||
}
|
||||
|
||||
public DBSettingsModel setDocInterniCheckFornitore(String docInterniCheckFornitore) {
|
||||
this.docInterniCheckFornitore = docInterniCheckFornitore;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAccettazioneUseQtaOrd() {
|
||||
return flagAccettazioneUseQtaOrd;
|
||||
}
|
||||
@@ -495,75 +491,146 @@ public class DBSettingsModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAskPrintUlAccettazioneBolla() {
|
||||
return flagAskPrintUlAccettazioneBolla;
|
||||
public boolean isFlagAccettazioneBollaAskPrintUl() {
|
||||
return flagAccettazioneBollaAskPrintUl;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAskPrintUlAccettazioneBolla(boolean flagAskPrintUlAccettazioneBolla) {
|
||||
this.flagAskPrintUlAccettazioneBolla = flagAskPrintUlAccettazioneBolla;
|
||||
public DBSettingsModel setFlagAccettazioneBollaAskPrintUl(boolean flagAccettazioneBollaAskPrintUl) {
|
||||
this.flagAccettazioneBollaAskPrintUl = flagAccettazioneBollaAskPrintUl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAskTipoColloAccettazioneBolla() {
|
||||
return flagAskTipoColloAccettazioneBolla;
|
||||
public boolean isFlagAccettazioneBollaAskTipoCollo() {
|
||||
return flagAccettazioneBollaAskTipoCollo;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAskTipoColloAccettazioneBolla(boolean flagAskTipoColloAccettazioneBolla) {
|
||||
this.flagAskTipoColloAccettazioneBolla = flagAskTipoColloAccettazioneBolla;
|
||||
public DBSettingsModel setFlagAccettazioneBollaAskTipoCollo(boolean flagAccettazioneBollaAskTipoCollo) {
|
||||
this.flagAccettazioneBollaAskTipoCollo = flagAccettazioneBollaAskTipoCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAskVersamentoAutomaticoAccettazioneBolla() {
|
||||
return flagAskVersamentoAutomaticoAccettazioneBolla;
|
||||
public boolean isFlagAccettazioneBollaAskVersamentoAutomatico() {
|
||||
return flagAccettazioneBollaAskVersamentoAutomatico;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAskVersamentoAutomaticoAccettazioneBolla(boolean flagAskVersamentoAutomaticoAccettazioneBolla) {
|
||||
this.flagAskVersamentoAutomaticoAccettazioneBolla = flagAskVersamentoAutomaticoAccettazioneBolla;
|
||||
public DBSettingsModel setFlagAccettazioneBollaAskVersamentoAutomatico(boolean flagAccettazioneBollaAskVersamentoAutomatico) {
|
||||
this.flagAccettazioneBollaAskVersamentoAutomatico = flagAccettazioneBollaAskVersamentoAutomatico;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagCanAddUnknownItemsAccettazioneBolla() {
|
||||
return flagCanAddUnknownItemsAccettazioneBolla;
|
||||
public boolean isFlagAccettazioneBollaCanAddUnknownItems() {
|
||||
return flagAccettazioneBollaCanAddUnknownItems;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagCanAddUnknownItemsAccettazioneBolla(boolean flagCanAddUnknownItemsAccettazioneBolla) {
|
||||
this.flagCanAddUnknownItemsAccettazioneBolla = flagCanAddUnknownItemsAccettazioneBolla;
|
||||
public DBSettingsModel setFlagAccettazioneBollaCanAddUnknownItems(boolean flagAccettazioneBollaCanAddUnknownItems) {
|
||||
this.flagAccettazioneBollaCanAddUnknownItems = flagAccettazioneBollaCanAddUnknownItems;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagCanAddUnknownBarcodesAccettazioneBolla() {
|
||||
return flagCanAddUnknownBarcodesAccettazioneBolla;
|
||||
public boolean isFlagAccettazioneBollaCanAddUnknownBarcodes() {
|
||||
return flagAccettazioneBollaCanAddUnknownBarcodes;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagCanAddUnknownBarcodesAccettazioneBolla(boolean flagCanAddUnknownBarcodesAccettazioneBolla) {
|
||||
this.flagCanAddUnknownBarcodesAccettazioneBolla = flagCanAddUnknownBarcodesAccettazioneBolla;
|
||||
public DBSettingsModel setFlagAccettazioneBollaCanAddUnknownBarcodes(boolean flagAccettazioneBollaCanAddUnknownBarcodes) {
|
||||
this.flagAccettazioneBollaCanAddUnknownBarcodes = flagAccettazioneBollaCanAddUnknownBarcodes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagEnableFastPickAccettazioneBolla() {
|
||||
return flagEnableFastPickAccettazioneBolla;
|
||||
public boolean isFlagAccettazioneBollaEnableFastPick() {
|
||||
return flagAccettazioneBollaEnableFastPick;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagEnableFastPickAccettazioneBolla(boolean flagEnableFastPickAccettazioneBolla) {
|
||||
this.flagEnableFastPickAccettazioneBolla = flagEnableFastPickAccettazioneBolla;
|
||||
public DBSettingsModel setFlagAccettazioneBollaEnableFastPick(boolean flagAccettazioneBollaEnableFastPick) {
|
||||
this.flagAccettazioneBollaEnableFastPick = flagAccettazioneBollaEnableFastPick;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagDisableMandatoryTracciabilitaAccettazioneBolla() {
|
||||
return flagDisableMandatoryTracciabilitaAccettazioneBolla;
|
||||
public boolean isFlagAccettazioneBollaDisableMandatoryTracciabilita() {
|
||||
return flagAccettazioneBollaDisableMandatoryTracciabilita;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagDisableMandatoryTracciabilitaAccettazioneBolla(boolean flagDisableMandatoryTracciabilitaAccettazioneBolla) {
|
||||
this.flagDisableMandatoryTracciabilitaAccettazioneBolla = flagDisableMandatoryTracciabilitaAccettazioneBolla;
|
||||
public DBSettingsModel setFlagAccettazioneBollaDisableMandatoryTracciabilita(boolean flagAccettazioneBollaDisableMandatoryTracciabilita) {
|
||||
this.flagAccettazioneBollaDisableMandatoryTracciabilita = flagAccettazioneBollaDisableMandatoryTracciabilita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagOverflowQuantityWarning() {
|
||||
return flagOverflowQuantityWarning;
|
||||
public boolean isFlagAccettazioneBollaAllowULRecover() {
|
||||
return flagAccettazioneBollaAllowULRecover;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagOverflowQuantityWarning(boolean flagOverflowQuantityWarning) {
|
||||
this.flagOverflowQuantityWarning = flagOverflowQuantityWarning;
|
||||
public DBSettingsModel setFlagAccettazioneBollaAllowULRecover(boolean flagAccettazioneBollaAllowULRecover) {
|
||||
this.flagAccettazioneBollaAllowULRecover = flagAccettazioneBollaAllowULRecover;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagSpedizioneOverflowQuantityWarning() {
|
||||
return flagSpedizioneOverflowQuantityWarning;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagSpedizioneOverflowQuantityWarning(boolean flagSpedizioneOverflowQuantityWarning) {
|
||||
this.flagSpedizioneOverflowQuantityWarning = flagSpedizioneOverflowQuantityWarning;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isGroupPoductionByCommodityGroup() {
|
||||
return groupPoductionByCommodityGroup;
|
||||
}
|
||||
|
||||
public DBSettingsModel setGroupPoductionByCommodityGroup(boolean groupPoductionByCommodityGroup) {
|
||||
this.groupPoductionByCommodityGroup = groupPoductionByCommodityGroup;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getViewPosizioni() {
|
||||
return viewPosizioni;
|
||||
}
|
||||
|
||||
public DBSettingsModel setViewPosizioni(String viewPosizioni) {
|
||||
this.viewPosizioni = viewPosizioni;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAccettazioneDeleteRowOnClose() {
|
||||
return flagAccettazioneDeleteRowOnClose;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAccettazioneDeleteRowOnClose(boolean flagAccettazioneDeleteRowOnClose) {
|
||||
this.flagAccettazioneDeleteRowOnClose = flagAccettazioneDeleteRowOnClose;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAccettazioneAllowBarcodeFornitore() {
|
||||
return flagAccettazioneAllowBarcodeFornitore;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAccettazioneAllowBarcodeFornitore(boolean flagAccettazioneAllowBarcodeFornitore) {
|
||||
this.flagAccettazioneAllowBarcodeFornitore = flagAccettazioneAllowBarcodeFornitore;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagProduzioneShowInfo() {
|
||||
return flagProduzioneShowInfo;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagProduzioneShowInfo(boolean flagProduzioneShowInfo) {
|
||||
this.flagProduzioneShowInfo = flagProduzioneShowInfo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAccettazioneBollaUseQtaOrd() {
|
||||
return flagAccettazioneBollaUseQtaOrd;
|
||||
}
|
||||
|
||||
public void setFlagAccettazioneBollaUseQtaOrd(boolean flagAccettazioneBollaUseQtaOrd) {
|
||||
this.flagAccettazioneBollaUseQtaOrd = flagAccettazioneBollaUseQtaOrd;
|
||||
}
|
||||
|
||||
public boolean isFlagWarningNewPartitaMag() {
|
||||
return flagWarningNewPartitaMag;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagWarningNewPartitaMag(boolean flagWarningNewPartitaMag) {
|
||||
this.flagWarningNewPartitaMag = flagWarningNewPartitaMag;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,6 +242,11 @@ public class SettingsManager {
|
||||
.setSection("ACCETTAZIONE")
|
||||
.setKeySection("FLAG_AUTO_OPEN_NEW_UL")
|
||||
.setSetter(dbSettingsModelIstance::setFlagCanAutoOpenNewULAccettazione));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE")
|
||||
.setKeySection("FLAG_DELETE_ROW_ON_CLOSE")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneDeleteRowOnClose));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
@@ -272,6 +277,23 @@ public class SettingsManager {
|
||||
.setSection("PRODUZIONE")
|
||||
.setKeySection("FILTER_FORNTIORE_PROD")
|
||||
.setSetter(dbSettingsModelIstance::setFilterFornitoreProd));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("PRODUZIONE")
|
||||
.setKeySection("FLAG_GROUP_BY_GRP_MERC")
|
||||
.setSetter(dbSettingsModelIstance::setGroupPoductionByCommodityGroup)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("PRODUZIONE")
|
||||
.setKeySection("FLAG_SHOW_INFO")
|
||||
.setSetter(dbSettingsModelIstance::setFlagProduzioneShowInfo)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("PRODUZIONE")
|
||||
.setKeySection("VIEW_POSIZIONI")
|
||||
.setSetter(dbSettingsModelIstance::setViewPosizioni));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
@@ -334,11 +356,6 @@ public class SettingsManager {
|
||||
.setSection("ORDINI_A")
|
||||
.setKeySection("FLAG_CONSENTI_ORDINE_SENZA_GRIGLIA")
|
||||
.setSetter(dbSettingsModelIstance::setFlagConsentiOrdineSenzaGriglia));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
|
||||
.setGestName("PVM")
|
||||
.setSection("DOC_INTERNI")
|
||||
.setKeySection("CHECK_FORNITORE")
|
||||
.setSetter(dbSettingsModelIstance::setDocInterniCheckFornitore));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE")
|
||||
@@ -432,49 +449,73 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_ASK_PRINT_UL")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAskPrintUlAccettazioneBolla)
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaAskPrintUl)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_ASK_TIPO_COLLO")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAskTipoColloAccettazioneBolla)
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaAskTipoCollo)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_ASK_VERSAMENTO_AUTOMATICO")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAskVersamentoAutomaticoAccettazioneBolla)
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaAskVersamentoAutomatico)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_CAN_ADD_UNKNOWN_ITEMS")
|
||||
.setSetter(dbSettingsModelIstance::setFlagCanAddUnknownItemsAccettazioneBolla)
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaCanAddUnknownItems)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_CAN_ADD_UNKNOWN_BARCODES")
|
||||
.setSetter(dbSettingsModelIstance::setFlagCanAddUnknownBarcodesAccettazioneBolla)
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaCanAddUnknownBarcodes)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_ENABLE_FAST_PICK")
|
||||
.setSetter(dbSettingsModelIstance::setFlagEnableFastPickAccettazioneBolla)
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaEnableFastPick)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_DISABLE_MANDATORY_TRACCIABILITA")
|
||||
.setSetter(dbSettingsModelIstance::setFlagDisableMandatoryTracciabilitaAccettazioneBolla)
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaDisableMandatoryTracciabilita)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_ALLOW_UL_RECOVER")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaAllowULRecover)
|
||||
.setDefaultValue(true));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_OVERFLOW_QUANTITY_WARNING")
|
||||
.setSetter(dbSettingsModelIstance::setFlagOverflowQuantityWarning)
|
||||
.setSetter(dbSettingsModelIstance::setFlagSpedizioneOverflowQuantityWarning)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE")
|
||||
.setKeySection("FLAG_ALLOW_BARCODE_FORNITORE")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneAllowBarcodeFornitore)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE_BOLLA")
|
||||
.setKeySection("FLAG_USE_QTA_ORD")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaUseQtaOrd)
|
||||
.setDefaultValue(true));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("SETUP")
|
||||
.setKeySection("FLAG_WARNING_NEW_PARTITA_MAG")
|
||||
.setSetter(dbSettingsModelIstance::setFlagWarningNewPartitaMag)
|
||||
.setDefaultValue(false));
|
||||
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package it.integry.integrywmsnative.core.sound;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.MediaPlayer;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
@Singleton
|
||||
public class SoundAlertService {
|
||||
|
||||
private final Context mApplicationContext;
|
||||
|
||||
private MediaPlayer successPlayer;
|
||||
private MediaPlayer warningPlayer;
|
||||
|
||||
public SoundAlertService(Context context) {
|
||||
this.mApplicationContext = context;
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void init() {
|
||||
successPlayer = MediaPlayer.create(this.mApplicationContext, R.raw.success_sound);
|
||||
warningPlayer = MediaPlayer.create(this.mApplicationContext, R.raw.warning_sound);
|
||||
}
|
||||
|
||||
public void success() {
|
||||
if (successPlayer != null) {
|
||||
successPlayer.start();
|
||||
}
|
||||
}
|
||||
|
||||
public void warning() {
|
||||
if (warningPlayer != null) {
|
||||
warningPlayer.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,7 @@ public class UpdatesManager {
|
||||
|
||||
private void installAPK(String downloadURL) {
|
||||
|
||||
String destination = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/";
|
||||
File destination = mContext.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS);
|
||||
|
||||
var progressDialogBuilder = new DialogProgressView("Download", null, false);
|
||||
progressDialogBuilder.show(mContext.getSupportFragmentManager(), "tag");
|
||||
@@ -74,10 +74,10 @@ public class UpdatesManager {
|
||||
intent = new Intent(Intent.ACTION_INSTALL_PACKAGE);
|
||||
fileLoc = GenericFileProvider.getUriForFile(mContext,
|
||||
mContext.getApplicationContext().getPackageName() + ".core.update.GenericFileProvider",
|
||||
new File(destPath));
|
||||
destPath);
|
||||
} else {
|
||||
intent = new Intent(Intent.ACTION_VIEW);
|
||||
fileLoc = Uri.fromFile(new File(destPath));
|
||||
fileLoc = Uri.fromFile(destPath);
|
||||
}
|
||||
|
||||
intent.setDataAndType(fileLoc, "application/vnd.android.package-archive");
|
||||
|
||||
@@ -15,23 +15,20 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
public class FileDownloader {
|
||||
|
||||
private String urlString;
|
||||
private String destFolder;
|
||||
private File destFolder;
|
||||
|
||||
private RunnableArgs<Integer> onProgressUpdate;
|
||||
private RunnableArgs<String> onDownloadCompleted;
|
||||
private RunnableArgs<File> onDownloadCompleted;
|
||||
|
||||
|
||||
public void download() throws Exception {
|
||||
InputStream input = null;
|
||||
OutputStream output = null;
|
||||
HttpURLConnection connection = null;
|
||||
String destPathFile;
|
||||
File downloadFile = null;
|
||||
|
||||
try {
|
||||
File direct = new File(destFolder);
|
||||
if (!direct.exists()) {
|
||||
direct.mkdirs();
|
||||
}
|
||||
if (!destFolder.exists()) destFolder.mkdirs();
|
||||
|
||||
URL url = new URL(urlString);
|
||||
connection = (HttpURLConnection) url.openConnection();
|
||||
@@ -46,13 +43,12 @@ public class FileDownloader {
|
||||
int downloadedBytes = 0;
|
||||
|
||||
String title = URLUtil.guessFileName(String.valueOf(url), null, null);
|
||||
downloadFile = new File(destFolder, title);
|
||||
|
||||
destPathFile = destFolder + title;
|
||||
if (downloadFile.exists())
|
||||
downloadFile.delete();
|
||||
|
||||
if (new File(destPathFile).exists())
|
||||
new File(destPathFile).delete();
|
||||
|
||||
output = new FileOutputStream(destPathFile);
|
||||
output = new FileOutputStream(downloadFile);
|
||||
|
||||
byte[] buf = new byte[1024];
|
||||
int len;
|
||||
@@ -79,7 +75,7 @@ public class FileDownloader {
|
||||
connection.disconnect();
|
||||
}
|
||||
|
||||
if (onDownloadCompleted != null) onDownloadCompleted.run(destPathFile);
|
||||
if (onDownloadCompleted != null) onDownloadCompleted.run(downloadFile);
|
||||
}
|
||||
|
||||
|
||||
@@ -92,11 +88,11 @@ public class FileDownloader {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDestFolder() {
|
||||
public File getDestFolder() {
|
||||
return destFolder;
|
||||
}
|
||||
|
||||
public FileDownloader setDestFolder(String destFolder) {
|
||||
public FileDownloader setDestFolder(File destFolder) {
|
||||
this.destFolder = destFolder;
|
||||
return this;
|
||||
}
|
||||
@@ -106,7 +102,7 @@ public class FileDownloader {
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileDownloader setOnDownloadCompleted(RunnableArgs<String> onDownloadCompleted) {
|
||||
public FileDownloader setOnDownloadCompleted(RunnableArgs<File> onDownloadCompleted) {
|
||||
this.onDownloadCompleted = onDownloadCompleted;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class UtilityBarcode {
|
||||
int currentYear = calendar.get(Calendar.YEAR);
|
||||
|
||||
String fullYear = "20" + UtilityBarcode.getAnnoColloFromULAnonima(barcode);
|
||||
return fullYear.equalsIgnoreCase("" + currentYear);
|
||||
return fullYear.equalsIgnoreCase(String.valueOf(currentYear));
|
||||
}
|
||||
|
||||
public static boolean isEtichetta128(BarcodeScanDTO barcodeScanDTO) {
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class UtilityDB {
|
||||
|
||||
@@ -32,4 +37,9 @@ public class UtilityDB {
|
||||
return valueString;
|
||||
}
|
||||
|
||||
public static String listValueToString(List<String> lista) {
|
||||
lista = Stream.of(lista).map(UtilityDB::valueToString).toList();
|
||||
return StringUtils.join(lista,",");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -184,6 +184,16 @@ public class UtilityDate {
|
||||
} else return null;
|
||||
}
|
||||
|
||||
public static String formatDate(String dateToFormat, String format) {
|
||||
if (dateToFormat != null) {
|
||||
LocalDateTime data = recognizeLocalDateTimeWithExceptionHandler(dateToFormat);
|
||||
if (data != null) {
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(format);
|
||||
return data.format(dateTimeFormatter);
|
||||
}else return null;
|
||||
} else return null;
|
||||
}
|
||||
|
||||
public static boolean isBeforeToday(LocalDateTime inputDate) {
|
||||
return inputDate != null && inputDate.toLocalDate().isBefore(getNow());
|
||||
}
|
||||
|
||||
@@ -7,10 +7,13 @@ import java.lang.reflect.Modifier;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.secondary.StatoPartitaMag;
|
||||
import it.integry.integrywmsnative.core.rest.deserializer.LocalDateDeserializer;
|
||||
import it.integry.integrywmsnative.core.rest.deserializer.LocalDateTimeDeserializer;
|
||||
import it.integry.integrywmsnative.core.rest.deserializer.StatoPartitaMagDeserializer;
|
||||
import it.integry.integrywmsnative.core.rest.serializer.LocalDateSerializer;
|
||||
import it.integry.integrywmsnative.core.rest.serializer.LocalDateTimeSerializer;
|
||||
import it.integry.integrywmsnative.core.rest.serializer.StatoPartitaMagSerializer;
|
||||
|
||||
public class UtilityGson {
|
||||
|
||||
@@ -22,6 +25,8 @@ public class UtilityGson {
|
||||
.registerTypeAdapter(LocalDate.class, new LocalDateSerializer())
|
||||
.registerTypeAdapter(LocalDateTime.class, new LocalDateTimeDeserializer())
|
||||
.registerTypeAdapter(LocalDateTime.class, new LocalDateTimeSerializer())
|
||||
.registerTypeAdapter(StatoPartitaMag.class, new StatoPartitaMagDeserializer())
|
||||
.registerTypeAdapter(StatoPartitaMag.class, new StatoPartitaMagSerializer())
|
||||
.create();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
|
||||
public class UtilitySHA1 {
|
||||
|
||||
|
||||
public static String getSha1Hex(String clearString)
|
||||
{
|
||||
try
|
||||
{
|
||||
MessageDigest messageDigest = MessageDigest.getInstance("SHA-1");
|
||||
messageDigest.update(clearString.getBytes(StandardCharsets.UTF_8));
|
||||
byte[] bytes = messageDigest.digest();
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
for (byte b : bytes)
|
||||
{
|
||||
buffer.append(Integer.toString((b & 0xff) + 0x100, 16).substring(1));
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
catch (Exception ignored)
|
||||
{
|
||||
ignored.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import java.util.regex.Pattern;
|
||||
public class UtilityString {
|
||||
|
||||
public static boolean isNullOrEmpty(String stringToCheck){
|
||||
return stringToCheck == null || stringToCheck.trim().length() == 0;
|
||||
return stringToCheck == null || stringToCheck.trim().isEmpty();
|
||||
}
|
||||
|
||||
public static String isNull(String stringToCheck, String alternativeString){
|
||||
@@ -23,7 +23,7 @@ public class UtilityString {
|
||||
}
|
||||
|
||||
public static String empty2null(String stringToCheck) {
|
||||
return (stringToCheck == null || stringToCheck.trim().length() == 0) ? null : stringToCheck.trim();
|
||||
return (stringToCheck == null || stringToCheck.trim().isEmpty()) ? null : stringToCheck.trim();
|
||||
}
|
||||
|
||||
public static String capitalizeWords(String capString){
|
||||
|
||||
@@ -16,8 +16,6 @@ public class SitBollaAccettazioneDTO {
|
||||
private BigDecimal qtaDoc;
|
||||
private BigDecimal qtaCnfDoc;
|
||||
private BigDecimal numCnfDoc;
|
||||
private BigDecimal qtaAccettata;
|
||||
private BigDecimal numCnfAccettata;
|
||||
private BigDecimal qtaDaAccettare;
|
||||
private BigDecimal numCnfDaAccettare;
|
||||
|
||||
@@ -111,24 +109,6 @@ public class SitBollaAccettazioneDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaAccettata() {
|
||||
return qtaAccettata;
|
||||
}
|
||||
|
||||
public SitBollaAccettazioneDTO setQtaAccettata(BigDecimal qtaAccettata) {
|
||||
this.qtaAccettata = qtaAccettata;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNumCnfAccettata() {
|
||||
return numCnfAccettata;
|
||||
}
|
||||
|
||||
public SitBollaAccettazioneDTO setNumCnfAccettata(BigDecimal numCnfAccettata) {
|
||||
this.numCnfAccettata = numCnfAccettata;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaDaAccettare() {
|
||||
return qtaDaAccettare;
|
||||
}
|
||||
|
||||
@@ -6,9 +6,11 @@ import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableString;
|
||||
import android.view.Gravity;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
@@ -37,6 +39,7 @@ 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.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUDCDTO;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||
@@ -50,7 +53,6 @@ import it.integry.integrywmsnative.databinding.ActivityAccettazioneBollaPickingB
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.rest.dto.SitBollaAccettazioneDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_elenco.rest.dto.TestataBollaAccettazioneDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_picking.dto.AccettazioneBollaPickingOrderBy;
|
||||
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUDCDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_picking.dto.PickingObjectDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_picking.ui.AccettazioneBollaPickingListAdapter;
|
||||
import it.integry.integrywmsnative.gest.accettazione_bolla_picking.ui.AccettazioneBollaPickingListModel;
|
||||
@@ -63,7 +65,7 @@ import it.integry.integrywmsnative.view.dialogs.ask_should_versamento_automatico
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_unknown_barcode_notes.DialogAskUnknownBarcodeNotesView;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageView;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLU;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUView;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
import it.integry.integrywmsnative.view.dialogs.versamento_automatico_ul_done.DialogVersamentoAutomaticoULDoneView;
|
||||
@@ -98,6 +100,10 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
private List<TestataBollaAccettazioneDTO> testataBolle;
|
||||
private List<SitBollaAccettazioneDTO> sitArts;
|
||||
|
||||
|
||||
private PopupMenu fabPopupMenu;
|
||||
|
||||
|
||||
//Pass here all external parameters
|
||||
public static void startActivity(Context context, List<TestataBollaAccettazioneDTO> testataBolle, List<SitBollaAccettazioneDTO> sitArts) {
|
||||
Intent myIntent = new Intent(context, AccettazioneBollaPickingActivity.class);
|
||||
@@ -121,7 +127,7 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
|
||||
mBindings = ActivityAccettazioneBollaPickingBinding.inflate(getLayoutInflater());
|
||||
mBindings.setLifecycleOwner(this);
|
||||
mBindings.setAccettazioneView(this);
|
||||
mBindings.setView(this);
|
||||
|
||||
setContentView(mBindings.getRoot());
|
||||
|
||||
@@ -145,8 +151,9 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
this.initBarcodeReader();
|
||||
this.initRecyclerView();
|
||||
// this.initFilters();
|
||||
this.initFab();
|
||||
|
||||
boolean useQtaBolla = SettingsManager.iDB().isFlagAccettazioneUseQtaOrd();
|
||||
boolean useQtaBolla = SettingsManager.iDB().isFlagAccettazioneBollaUseQtaOrd();
|
||||
|
||||
mViewModel.setListeners(this);
|
||||
mViewModel.init(
|
||||
@@ -204,6 +211,36 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void initFab() {
|
||||
fabPopupMenu = new PopupMenu(this, this.mBindings.accettazioneOrdineInevasoFab,
|
||||
(Gravity.END | Gravity.BOTTOM),
|
||||
androidx.appcompat.R.attr.popupMenuStyle,
|
||||
com.google.android.material.R.style.Widget_Material3_PopupMenu_ContextMenu);
|
||||
|
||||
fabPopupMenu.setForceShowIcon(true);
|
||||
fabPopupMenu.getMenuInflater().inflate(R.menu.accettazione_ordine_inevaso_fab_menu, fabPopupMenu.getMenu());
|
||||
|
||||
fabPopupMenu.getMenu().findItem(R.id.show_created_ul).setVisible(SettingsManager.iDB().isFlagAccettazioneBollaAllowULRecover());
|
||||
|
||||
fabPopupMenu.setOnMenuItemClickListener(item -> {
|
||||
int itemId = item.getItemId();
|
||||
|
||||
if (itemId == R.id.show_created_ul) {
|
||||
showCreatedUL();
|
||||
} else if (itemId == R.id.create_ul) {
|
||||
createNewLU();
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void showFabMenu() {
|
||||
fabPopupMenu.show();
|
||||
}
|
||||
|
||||
private void refreshList() {
|
||||
|
||||
runOnUiThread(() -> {
|
||||
@@ -315,15 +352,13 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
};
|
||||
|
||||
public void createNewLU() {
|
||||
this.mBindings.accettazioneOrdineInevasoFab.close(true);
|
||||
this.fabPopupMenu.dismiss();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.createNewLU(null, null, false, this::onLoadingEnded);
|
||||
}
|
||||
|
||||
public void showCreatedUL() {
|
||||
this.mBindings.accettazioneOrdineInevasoFab.close(true);
|
||||
|
||||
this.fabPopupMenu.dismiss();
|
||||
this.mViewModel.retrieveExistentLU(this::startListaBancaliRegistratiActivity);
|
||||
}
|
||||
|
||||
@@ -447,9 +482,8 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
|
||||
@Override
|
||||
public void onInfoAggiuntiveRequest(RunnableArgss<String, MtbTCol> onComplete) {
|
||||
runOnUiThread(() -> {
|
||||
DialogInfoAggiuntiveLU.newInstance(onComplete).show(getSupportFragmentManager(), "InfoAggiuntiveLUDialog");
|
||||
});
|
||||
DialogInfoAggiuntiveLUView.newInstance(onComplete, this::onLoadingEnded)
|
||||
.show(getSupportFragmentManager(), DialogInfoAggiuntiveLUView.class.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -492,7 +526,7 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||
.setCanLUBeClosed(true)
|
||||
.setCanOverflowOrderQuantity(canOverflowQuantity)
|
||||
.setDisableTracciabilitaCheck(SettingsManager.iDB().isFlagDisableMandatoryTracciabilitaAccettazioneBolla());
|
||||
.setDisableTracciabilitaCheck(SettingsManager.iDB().isFlagAccettazioneBollaDisableMandatoryTracciabilita());
|
||||
|
||||
if (!mDialogInputQuantityV2View.isVisible())
|
||||
mDialogInputQuantityV2View
|
||||
|
||||
@@ -356,7 +356,7 @@ public class AccettazioneBollaPickingViewModel {
|
||||
|
||||
|
||||
private void manageUnknownBarcode(String barcode, Runnable onComplete) {
|
||||
if (SettingsManager.iDB().isFlagCanAddUnknownBarcodesAccettazioneBolla()) {
|
||||
if (SettingsManager.iDB().isFlagAccettazioneBollaCanAddUnknownBarcodes()) {
|
||||
//TODO: Implementare popup che richiede delle note aggiuntive sul barcode scansionato
|
||||
this.sendOnUnknownBarcodeScanned(barcode, notes -> {
|
||||
this.manageDispatchBollaRow(new PickingObjectDTO()
|
||||
@@ -376,7 +376,7 @@ public class AccettazioneBollaPickingViewModel {
|
||||
|
||||
|
||||
private void manageNoArtFound(MtbAart mtbAart, PickDataDTO pickDataDTO) {
|
||||
if (SettingsManager.iDB().isFlagCanAddUnknownItemsAccettazioneBolla()) {
|
||||
if (SettingsManager.iDB().isFlagAccettazioneBollaCanAddUnknownItems()) {
|
||||
|
||||
this.manageDispatchBollaRow(new PickingObjectDTO()
|
||||
.setMtbAart(mtbAart)
|
||||
@@ -410,7 +410,7 @@ public class AccettazioneBollaPickingViewModel {
|
||||
}
|
||||
|
||||
private void manageInfoAggiuntiveRequest(RunnableArgss<String, MtbTCol> onComplete) {
|
||||
if (!SettingsManager.iDB().isFlagAskTipoColloAccettazioneBolla()) {
|
||||
if (!SettingsManager.iDB().isFlagAccettazioneBollaAskTipoCollo()) {
|
||||
onComplete.run(null, null);
|
||||
return;
|
||||
}
|
||||
@@ -420,15 +420,15 @@ public class AccettazioneBollaPickingViewModel {
|
||||
|
||||
public void manageDispatchBollaRow(final PickingObjectDTO pickingObjectDTO) {
|
||||
String partitaMag = null;
|
||||
if(pickingObjectDTO.getTempPickData() != null){
|
||||
if(pickingObjectDTO.getTempPickData().getManualPickDTO() != null){
|
||||
if(pickingObjectDTO.getTempPickData().getManualPickDTO().getMtbPartitaMag() != null){
|
||||
if (pickingObjectDTO.getTempPickData() != null) {
|
||||
if (pickingObjectDTO.getTempPickData().getManualPickDTO() != null) {
|
||||
if (pickingObjectDTO.getTempPickData().getManualPickDTO().getMtbPartitaMag() != null) {
|
||||
partitaMag = pickingObjectDTO.getTempPickData().getManualPickDTO().getMtbPartitaMag().getPartitaMag();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (SettingsManager.iDB().isFlagEnableFastPickAccettazioneBolla()) {
|
||||
if (SettingsManager.iDB().isFlagAccettazioneBollaEnableFastPick()) {
|
||||
this.saveNewRow(pickingObjectDTO,
|
||||
BigDecimal.ONE,
|
||||
pickingObjectDTO.getMtbAart().getQtaCnf(),
|
||||
@@ -550,11 +550,15 @@ public class AccettazioneBollaPickingViewModel {
|
||||
initialQtaTot = mtbAart.getQtaCnf();
|
||||
}
|
||||
|
||||
if (!this.mUseQtaBolla &&
|
||||
UtilityBigDecimal.greaterThan(pickingObjectDTO.getMtbAart().getColliPedana(), BigDecimal.ZERO) &&
|
||||
UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) {
|
||||
initialNumCnf = pickingObjectDTO.getMtbAart().getColliPedana();
|
||||
initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
|
||||
if (!this.mUseQtaBolla) {
|
||||
if (UtilityBigDecimal.greaterThan(pickingObjectDTO.getMtbAart().getColliPedana(), BigDecimal.ZERO) &&
|
||||
UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) {
|
||||
initialNumCnf = pickingObjectDTO.getMtbAart().getColliPedana();
|
||||
initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
|
||||
} else if(UtilityBigDecimal.greaterThan(initialNumCnf, BigDecimal.ONE) && pickingObjectDTO.getMtbAart().isFlagQtaCnfFissaBoolean()) {
|
||||
initialNumCnf = BigDecimal.ONE;
|
||||
initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
|
||||
}
|
||||
}
|
||||
|
||||
if (dataScad == null && pickingObjectDTO.getMtbAart().getGgScadPartita() != null && pickingObjectDTO.getMtbAart().getGgScadPartita() > 0) {
|
||||
@@ -603,7 +607,8 @@ public class AccettazioneBollaPickingViewModel {
|
||||
}
|
||||
|
||||
|
||||
public void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, LocalDate dataScad, boolean shouldCloseLU) {
|
||||
public void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal
|
||||
qtaCnf, BigDecimal qtaTot, String partitaMag, LocalDate dataScad, boolean shouldCloseLU) {
|
||||
if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) {
|
||||
resetMatchedRows();
|
||||
|
||||
@@ -691,7 +696,8 @@ public class AccettazioneBollaPickingViewModel {
|
||||
});
|
||||
}
|
||||
|
||||
private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, LocalDate dataScad, boolean shouldCloseLU) {
|
||||
private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal
|
||||
qtaCnf, BigDecimal qtaTot, String partitaMag, LocalDate dataScad, boolean shouldCloseLU) {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
MtbColr mtbColrClone = (MtbColr) mtbColrToUpdate.clone();
|
||||
@@ -802,7 +808,7 @@ public class AccettazioneBollaPickingViewModel {
|
||||
|
||||
private void manageVersamentoAutomatico(Runnable onComplete) {
|
||||
|
||||
if (!SettingsManager.iDB().isFlagAskVersamentoAutomaticoAccettazioneBolla()) {
|
||||
if (!SettingsManager.iDB().isFlagAccettazioneBollaAskVersamentoAutomatico()) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
@@ -825,7 +831,7 @@ public class AccettazioneBollaPickingViewModel {
|
||||
}
|
||||
|
||||
private void managePrintCollo(Runnable onComplete) {
|
||||
if (!mCurrentMtbColt.getDisablePrint() || !SettingsManager.iDB().isFlagAskPrintUlAccettazioneBolla()) {
|
||||
if (!mCurrentMtbColt.getDisablePrint() || !SettingsManager.iDB().isFlagAccettazioneBollaAskPrintUl()) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
@@ -998,12 +1004,14 @@ public class AccettazioneBollaPickingViewModel {
|
||||
if (this.mListener != null) mListener.onMtbColrDeleteRequest(onComplete);
|
||||
}
|
||||
|
||||
private void notifyVersamentoAutomaticoResult(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete) {
|
||||
private void notifyVersamentoAutomaticoResult(VersamentoAutomaticoULResponseDTO
|
||||
versamentoAutomaticoULResponseDTO, Runnable onComplete) {
|
||||
if (this.mListener != null)
|
||||
mListener.onULVersata(versamentoAutomaticoULResponseDTO, onComplete);
|
||||
}
|
||||
|
||||
private void sendOnUnknownBarcodeScanned(String barocde, RunnableArgs<String> onComplete, Runnable onAbort) {
|
||||
private void sendOnUnknownBarcodeScanned(String
|
||||
barocde, RunnableArgs<String> onComplete, Runnable onAbort) {
|
||||
if (this.mListener != null)
|
||||
mListener.onUnknownBarcodeScanned(barocde, onComplete, onAbort);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,9 @@ public class AccettazioneBollaPickingListAdapter extends SectionedRecyclerViewAd
|
||||
public void onBindItemViewHolder(final AccettazioneBollaPickingListAdapter.SingleItemViewHolder holder, final int position) {
|
||||
AccettazioneBollaPickingListModel pickingObjectDTO = this.mDataset.get(position);
|
||||
|
||||
if (pickingObjectDTO.getQtaEvasa().subtract(pickingObjectDTO.getQtaTot()).floatValue() >= 0) {
|
||||
if (pickingObjectDTO.getQtaEvasa().subtract(pickingObjectDTO.getQtaTot()).floatValue() > 0) {
|
||||
holder.mBinding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.blue_100));
|
||||
} else if (pickingObjectDTO.getQtaEvasa().subtract(pickingObjectDTO.getQtaTot()).floatValue() == 0) {
|
||||
holder.mBinding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.green_500_with_alpha));
|
||||
} else if (pickingObjectDTO.getQtaEvasa().floatValue() > 0) {
|
||||
holder.mBinding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.orange_600_with_alpha));
|
||||
|
||||
@@ -5,10 +5,12 @@ import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableString;
|
||||
import android.view.Gravity;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.preference.PreferenceManager;
|
||||
@@ -42,6 +44,7 @@ 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.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUDCDTO;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||
@@ -53,7 +56,6 @@ import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
||||
import it.integry.integrywmsnative.databinding.ActivityAccettazioneOrdineInevasoBinding;
|
||||
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUDCDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.dto.OrdineAccettazioneInevasoDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.dto.SitArtOrdDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.dto.AccettazioneOrdineInevasoOrderBy;
|
||||
@@ -73,7 +75,7 @@ import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFrag
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_should_versamento_automatico_ul.DialogAskShouldVersamentoAutomaticoULView;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLU;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUView;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
import it.integry.integrywmsnative.view.dialogs.versamento_automatico_ul_done.DialogVersamentoAutomaticoULDoneView;
|
||||
@@ -111,6 +113,8 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
|
||||
private boolean mShowSecondaryUntMis = true;
|
||||
|
||||
private PopupMenu fabPopupMenu;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -121,7 +125,7 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
|
||||
mBindings = DataBindingUtil.setContentView(this, R.layout.activity_accettazione_ordine_inevaso);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
mBindings.setAccettazioneView(this);
|
||||
mBindings.setView(this);
|
||||
|
||||
MainApplication.appComponent
|
||||
.accettazionePickingComponent()
|
||||
@@ -142,6 +146,7 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
this.initBarcodeReader();
|
||||
this.initRecyclerView();
|
||||
this.initFilters();
|
||||
this.initFab();
|
||||
|
||||
boolean useQtaOrd = SettingsManager.iDB().isFlagAccettazioneUseQtaOrd();
|
||||
|
||||
@@ -152,6 +157,28 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
useQtaOrd);
|
||||
}
|
||||
|
||||
private void initFab() {
|
||||
fabPopupMenu = new PopupMenu(this, this.mBindings.accettazioneOrdineInevasoFab,
|
||||
(Gravity.END | Gravity.BOTTOM),
|
||||
androidx.appcompat.R.attr.popupMenuStyle,
|
||||
com.google.android.material.R.style.Widget_Material3_PopupMenu_ContextMenu);
|
||||
|
||||
fabPopupMenu.setForceShowIcon(true);
|
||||
fabPopupMenu.getMenuInflater().inflate(R.menu.accettazione_ordine_inevaso_fab_menu, fabPopupMenu.getMenu());
|
||||
|
||||
fabPopupMenu.setOnMenuItemClickListener(item -> {
|
||||
int itemId = item.getItemId();
|
||||
|
||||
if (itemId == R.id.show_created_ul) {
|
||||
showCreatedUL();
|
||||
} else if (itemId == R.id.create_ul) {
|
||||
createNewLU();
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
private void initFilters() {
|
||||
|
||||
var onPredicateChanged = new OnGeneralChangedCallback() {
|
||||
@@ -678,18 +705,21 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
};
|
||||
|
||||
|
||||
public void showFabMenu() {
|
||||
fabPopupMenu.show();
|
||||
}
|
||||
|
||||
public void createNewLU() {
|
||||
this.mBindings.accettazioneOrdineInevasoFab.close(true);
|
||||
this.fabPopupMenu.dismiss();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.createNewLU(null, null, false, () -> {
|
||||
this.mViewModel.createNewLU(null, null, null, false, () -> {
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
}
|
||||
|
||||
public void showCreatedUL() {
|
||||
this.mBindings.accettazioneOrdineInevasoFab.close(true);
|
||||
|
||||
this.fabPopupMenu.dismiss();
|
||||
this.mViewModel.retrieveExistentLU(this::startListaBancaliRegistratiActivity);
|
||||
}
|
||||
|
||||
@@ -773,9 +803,12 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
|
||||
@Override
|
||||
public void onInfoAggiuntiveRequest(RunnableArgss<String, MtbTCol> onComplete) {
|
||||
runOnUiThread(() -> {
|
||||
DialogInfoAggiuntiveLU.newInstance(onComplete).show(getSupportFragmentManager(), "InfoAggiuntiveLUDialog");
|
||||
});
|
||||
// runOnUiThread(() -> {
|
||||
// DialogInfoAggiuntiveLU.newInstance(onComplete).show(getSupportFragmentManager(), "InfoAggiuntiveLUDialog");
|
||||
// });
|
||||
|
||||
DialogInfoAggiuntiveLUView.newInstance(onComplete, this::onLoadingEnded)
|
||||
.show(getSupportFragmentManager(), DialogInfoAggiuntiveLUView.class.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -896,6 +929,9 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
noLUPresent.set(true);
|
||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
||||
|
||||
|
||||
this.refreshList();
|
||||
|
||||
if (this.mShouldCloseActivity) super.onBackPressed();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.gest.accettazione_ordini_picking;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.ean128.Ean128Service;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliAccettazioneRESTConsumer;
|
||||
@@ -33,14 +34,15 @@ public class AccettazioneOrdiniPickingModule {
|
||||
PrinterRESTConsumer printerRESTConsumer,
|
||||
AccettazioneOrdiniPickingRESTConsumer accettazioneOrdiniPickingRESTConsumer,
|
||||
ColliAccettazioneRESTConsumer colliAccettazioneRESTConsumer,
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer) {
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
|
||||
Ean128Service ean128Service) {
|
||||
return new AccettazioneOrdiniPickingViewModel(articoloRESTConsumer,
|
||||
barcodeRESTConsumer,
|
||||
colliMagazzinoRESTConsumer,
|
||||
printerRESTConsumer,
|
||||
accettazioneOrdiniPickingRESTConsumer,
|
||||
colliAccettazioneRESTConsumer,
|
||||
colliLavorazioneRESTConsumer);
|
||||
colliLavorazioneRESTConsumer, ean128Service);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.ean128.Ean128Service;
|
||||
import it.integry.integrywmsnative.core.exception.AlreadyUsedAnonymousLabelException;
|
||||
import it.integry.integrywmsnative.core.exception.InvalidLUMultiGestioneException;
|
||||
import it.integry.integrywmsnative.core.exception.LUScanNotGrantedException;
|
||||
@@ -31,6 +32,7 @@ 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.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUDCDTO;
|
||||
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
@@ -40,6 +42,7 @@ import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsu
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliCaricoRESTConsumerInterface;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
|
||||
@@ -55,7 +58,6 @@ import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUDCDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.dto.OrdineAccettazioneInevasoDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.dto.SitArtOrdDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.dto.HistoryMtbAartDTO;
|
||||
@@ -74,6 +76,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
private final AccettazioneOrdiniPickingRESTConsumer mAccettazioneOrdiniPickingRESTConsumer;
|
||||
private final ColliAccettazioneRESTConsumer mColliAccettazioneRESTConsumer;
|
||||
private final ColliLavorazioneRESTConsumer mColliLavorazioneRESTConsumer;
|
||||
private final Ean128Service mEan128Service;
|
||||
|
||||
private ColliCaricoRESTConsumerInterface mColliCaricoRESTConsumer;
|
||||
|
||||
@@ -95,7 +98,8 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
PrinterRESTConsumer printerRESTConsumer,
|
||||
AccettazioneOrdiniPickingRESTConsumer accettazioneOrdiniPickingRESTConsumer,
|
||||
ColliAccettazioneRESTConsumer colliAccettazioneRESTConsumer,
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer) {
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
|
||||
Ean128Service ean128Service) {
|
||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||
@@ -103,6 +107,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
this.mAccettazioneOrdiniPickingRESTConsumer = accettazioneOrdiniPickingRESTConsumer;
|
||||
this.mColliAccettazioneRESTConsumer = colliAccettazioneRESTConsumer;
|
||||
this.mColliLavorazioneRESTConsumer = colliLavorazioneRESTConsumer;
|
||||
this.mEan128Service = ean128Service;
|
||||
}
|
||||
|
||||
|
||||
@@ -209,7 +214,11 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
//dell'etichetta anonima
|
||||
this.executeEtichettaAnonimaNotOpenedLU(barcodeScanDTO, onComplete);
|
||||
} else {
|
||||
this.processBarcodeNotOpenedLU(barcodeScanDTO, onComplete);
|
||||
if (SettingsManager.iDB().isFlagAccettazioneAllowBarcodeFornitore() && UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||
this.executeSSCCFornitore(barcodeScanDTO, onComplete);
|
||||
} else {
|
||||
this.processBarcodeNotOpenedLU(barcodeScanDTO, null, onComplete);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -221,6 +230,18 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
private void executeSSCCFornitore(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||
try {
|
||||
Ean128Model ean128Model = mEan128Service.decode(barcodeScanDTO);
|
||||
|
||||
//Nel caso trovo un SSCC lo aggiungo
|
||||
this.processBarcodeNotOpenedLU(barcodeScanDTO, ean128Model.Sscc, onComplete);
|
||||
|
||||
} catch (Exception e) {
|
||||
this.sendError(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void executeEtichettaAnonimaNotOpenedLU(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||
mColliMagazzinoRESTConsumer.getBySSCC(barcodeScanDTO.getStringValue(), true, false, mtbColt -> {
|
||||
|
||||
@@ -233,6 +254,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
try {
|
||||
numCollo = UtilityBarcode.getNumColloFromULAnonima(barcodeScanDTO.getStringValue());
|
||||
this.createNewLU(
|
||||
null,
|
||||
numCollo,
|
||||
CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE, true, onComplete);
|
||||
} catch (Exception ex) {
|
||||
@@ -246,12 +268,17 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private void processBarcodeNotOpenedLU(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||
private void processBarcodeNotOpenedLU(BarcodeScanDTO barcodeScanDTO, String customSSCC, Runnable onComplete) {
|
||||
this.createNewLU(
|
||||
customSSCC,
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
() -> processBarcodeAlreadyOpenedLU(barcodeScanDTO, onComplete));
|
||||
() -> {
|
||||
if(UtilityString.isNullOrEmpty(customSSCC))
|
||||
processBarcodeAlreadyOpenedLU(barcodeScanDTO, onComplete);
|
||||
else onComplete.run();
|
||||
});
|
||||
}
|
||||
|
||||
private void processBarcodeAlreadyOpenedLU(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||
@@ -260,7 +287,6 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
//Cerco tramite etichetta ean 128 (che può indicarmi un articolo o una UL)
|
||||
this.executeEtichettaEanPeso(barcodeScanDTO, onComplete);
|
||||
|
||||
|
||||
} else if (UtilityBarcode.isEtichettaPosizione(barcodeScanDTO)) {
|
||||
//Applico filtro per posizione
|
||||
this.executeEtichettaPosizione(barcodeScanDTO, onComplete);
|
||||
@@ -269,7 +295,6 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
//Cerco tramite etichetta ean 128 (che può indicarmi un articolo o una UL)
|
||||
this.executeEtichettaEan128(barcodeScanDTO, onComplete);
|
||||
|
||||
|
||||
} else {
|
||||
this.loadArticolo(barcodeScanDTO.getStringValue(), null, onComplete);
|
||||
}
|
||||
@@ -367,7 +392,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
public void createNewLU(Integer customNumCollo, String customSerCollo, boolean disablePrint, Runnable onComplete) {
|
||||
public void createNewLU(String customSSCC, Integer customNumCollo, String customSerCollo, boolean disablePrint, Runnable onComplete) {
|
||||
this.sendOnInfoAggiuntiveRequest((additionalNotes, tCol) -> {
|
||||
|
||||
final List<CreateUDCRequestOrderDTO> orders = Stream.of(this.mOrders)
|
||||
@@ -377,8 +402,8 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
.setDataOrd(UtilityDate.toLocalDate(x.getDataD()))
|
||||
.setNumOrd(x.getNumero());
|
||||
|
||||
if(x.getGestioneEnum() == GestioneEnum.PRODUZIONE) {
|
||||
if(x.isOrdTrasf())
|
||||
if (x.getGestioneEnum() == GestioneEnum.PRODUZIONE) {
|
||||
if (x.isOrdTrasf())
|
||||
createUDCRequestOrderDTO.setGestione(GestioneEnum.ACQUISTO.getText());
|
||||
else
|
||||
createUDCRequestOrderDTO.setGestione(GestioneEnum.LAVORAZIONE.getText());
|
||||
@@ -396,6 +421,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
.setCodTcol(tCol != null ? tCol.getCodTcol() : null)
|
||||
.setNumCollo(customNumCollo)
|
||||
.setSerCollo(customSerCollo)
|
||||
.setBarcodeUl(customSSCC)
|
||||
.setOrders(orders);
|
||||
|
||||
this.mColliCaricoRESTConsumer.createUDC(createUDCRequestDTO, createdUDS -> {
|
||||
@@ -782,11 +808,40 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
}
|
||||
|
||||
private void postCloseOperations() {
|
||||
this.calculateQtaDaEvadere();
|
||||
this.mCurrentMtbColt = null;
|
||||
this.sendLUClosed();
|
||||
this.sendOnLoadingEnded();
|
||||
}
|
||||
|
||||
private void calculateQtaDaEvadere() {
|
||||
if (SettingsManager.iDB().isFlagAccettazioneDeleteRowOnClose()) {
|
||||
for (PickingObjectDTO pickingObjectDTO : this.mPickingList.getValue()) {
|
||||
List<MtbColr> withdrawMtbColrs = pickingObjectDTO.getWithdrawMtbColrs();
|
||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||
BigDecimal numCnf = BigDecimal.ZERO;
|
||||
|
||||
if (withdrawMtbColrs.size() > 0) {
|
||||
qtaEvasa = Stream.of(withdrawMtbColrs)
|
||||
.map(MtbColr::getQtaCol)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
numCnf = Stream.of(withdrawMtbColrs)
|
||||
.map(MtbColr::getNumCnf)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
|
||||
BigDecimal qtaDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getQtaDaEvadere();
|
||||
pickingObjectDTO.getSitArtOrdDTO().setQtaDaEvadere(qtaDaEvadere.subtract(qtaEvasa));
|
||||
|
||||
BigDecimal numCnfDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getNumCnfDaEvadere();
|
||||
pickingObjectDTO.getSitArtOrdDTO().setNumCnfDaEvadere(numCnfDaEvadere.subtract(numCnf));
|
||||
|
||||
pickingObjectDTO.setWithdrawMtbColrs(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteLU(Runnable onComplete) {
|
||||
DeleteULRequestDTO deleteULRequestDTO = new DeleteULRequestDTO()
|
||||
.setMtbColt(this.mCurrentMtbColt);
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package it.integry.integrywmsnative.gest.articoli_in_giacenza;
|
||||
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface ArticoliInGiacenzaComponent {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
ArticoliInGiacenzaComponent create();
|
||||
}
|
||||
|
||||
void inject(ArticoliInGiacenzaFragment ControlloGiacenzeFragment);
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package it.integry.integrywmsnative.gest.articoli_in_giacenza;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
import com.ravikoradiya.liveadapter.Type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
||||
import it.integry.integrywmsnative.databinding.FragmentArticoliInGiacenzaBinding;
|
||||
import it.integry.integrywmsnative.databinding.ListaGiacenzePerPosizioneModelBinding;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_position_of_lu.DialogAskPositionOfLUView;
|
||||
|
||||
public class ArticoliInGiacenzaFragment extends BaseFragment implements ITitledFragment, ArticoliInGiacenzaViewModel.Listener {
|
||||
@Inject
|
||||
ArticoliInGiacenzaViewModel mViewModel;
|
||||
private FragmentArticoliInGiacenzaBinding mBindings;
|
||||
private final ObservableArrayList<MvwSitArtUdcDetInventario> mItemsInventario = new ObservableArrayList<>();
|
||||
|
||||
public ArticoliInGiacenzaFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static ArticoliInGiacenzaFragment newInstance() {
|
||||
return new ArticoliInGiacenzaFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setRetainInstance(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.fragment_articoli_in_giacenza, container, false);
|
||||
|
||||
MainApplication.appComponent
|
||||
.controlloGiacenzeComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
mViewModel.setListener(this);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
mBindings.setView(this);
|
||||
mBindings.setViewmodel(mViewModel);
|
||||
|
||||
this.initRecyclerView();
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
private void initRecyclerView() {
|
||||
mViewModel.getMvwSitArtUdcDetInventario().observe(getViewLifecycleOwner(), data -> {
|
||||
mBindings.emptyView.setVisibility(data == null || data.isEmpty() ? View.VISIBLE : View.GONE);
|
||||
|
||||
this.refreshList(null);
|
||||
});
|
||||
|
||||
var itemType = new Type<MvwSitArtUdcDetInventario, ListaGiacenzePerPosizioneModelBinding>(R.layout.lista_giacenze_per_posizione_model, BR.item);
|
||||
|
||||
new LiveAdapter(mItemsInventario)
|
||||
.map(MvwSitArtUdcDetInventario.class, itemType)
|
||||
.into(this.mBindings.inventarioList);
|
||||
}
|
||||
|
||||
public void refreshList(List<MvwSitArtUdcDetInventario> filteredList) {
|
||||
List<MvwSitArtUdcDetInventario> tmpList;
|
||||
|
||||
if (filteredList != null) {
|
||||
tmpList = filteredList;
|
||||
} else {
|
||||
tmpList = mViewModel.getMvwSitArtUdcDetInventario().getValue();
|
||||
}
|
||||
this.mItemsInventario.clear();
|
||||
if (tmpList != null) {
|
||||
this.mItemsInventario.addAll(tmpList);
|
||||
}
|
||||
}
|
||||
|
||||
private void choosePosition(RunnableArgs<MtbDepoPosizione> onComplete) {
|
||||
DialogAskPositionOfLUView.makeBase(false, (status, mtbDepoPosizione) -> {
|
||||
|
||||
if (status == DialogConsts.Results.ABORT) {
|
||||
popMe();
|
||||
} else {
|
||||
onComplete.run(mtbDepoPosizione);
|
||||
}
|
||||
|
||||
}, this::onError)
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||
titleText.setText(context.getText(R.string.articoli_in_giacenza_title).toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
mViewModel.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
mViewModel.setListener(null);
|
||||
|
||||
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
||||
onPreDestroy.run();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestChoosePosition(RunnableArgs<MtbDepoPosizione> onComplete) {
|
||||
choosePosition(onComplete);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package it.integry.integrywmsnative.gest.articoli_in_giacenza;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||
|
||||
@Module(subcomponents = ArticoliInGiacenzaComponent.class)
|
||||
public class ArticoliInGiacenzaModule {
|
||||
|
||||
@Provides
|
||||
ArticoliInGiacenzaViewModel providesControlloGiacenzeViewModel(InventarioService inventarioService) {
|
||||
return new ArticoliInGiacenzaViewModel(inventarioService);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package it.integry.integrywmsnative.gest.articoli_in_giacenza;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.exception.ScannedPositionNotExistException;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
||||
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||
|
||||
public class ArticoliInGiacenzaViewModel {
|
||||
private final InventarioService mInventarioService;
|
||||
private final MutableLiveData<List<MvwSitArtUdcDetInventario>> mvwSitArtUdcDetInventario = new MutableLiveData<>();
|
||||
private Listener mListener;
|
||||
|
||||
public ArticoliInGiacenzaViewModel(InventarioService inventarioService){
|
||||
this.mInventarioService = inventarioService;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
this.sendRequestChoosePosition(this::setPosizione);
|
||||
}
|
||||
|
||||
private void setPosizione(MtbDepoPosizione posizione){
|
||||
if (posizione == null) {
|
||||
//Nessuna posizione trovata con questo barcode
|
||||
this.sendError(new ScannedPositionNotExistException());
|
||||
}else{
|
||||
this.sendOnLoadingStarted();
|
||||
mInventarioService.getInventarioDaPosizione(posizione, inventario -> {
|
||||
mvwSitArtUdcDetInventario.postValue(inventario);
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
}
|
||||
}
|
||||
|
||||
public MutableLiveData<List<MvwSitArtUdcDetInventario>> getMvwSitArtUdcDetInventario() {
|
||||
return mvwSitArtUdcDetInventario;
|
||||
}
|
||||
|
||||
public void setListener(Listener listener) {
|
||||
this.mListener = listener;
|
||||
}
|
||||
|
||||
private void sendError(Exception ex) {
|
||||
if (this.mListener != null) mListener.onError(ex);
|
||||
}
|
||||
|
||||
private void sendRequestChoosePosition(RunnableArgs<MtbDepoPosizione> onComplete) {
|
||||
if (this.mListener != null) mListener.onRequestChoosePosition(onComplete);
|
||||
}
|
||||
|
||||
private void sendOnLoadingStarted() {
|
||||
if (this.mListener != null) mListener.onLoadingStarted();
|
||||
}
|
||||
|
||||
private void sendOnLoadingEnded() {
|
||||
if (this.mListener != null) mListener.onLoadingEnded();
|
||||
}
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
void onError(Exception ex);
|
||||
void onRequestChoosePosition(RunnableArgs<MtbDepoPosizione> onComplete);
|
||||
}
|
||||
}
|
||||
@@ -178,6 +178,6 @@ public class DocInterniFragment extends BaseFragment implements ITitledFragment,
|
||||
@Override
|
||||
public void onDocumentEditRequest(SqlMtbColt document, List<DocumentoArtDTO> arts) {
|
||||
requireActivity()
|
||||
.startActivity(DocInterniEditFormActivity.newInstance(requireActivity(), document, arts, mViewModel.getTipoDoc()));
|
||||
.startActivity(DocInterniEditFormActivity.newInstance(requireActivity(), document, arts, mViewModel.getTipoDoc(), mDocInterniSetupDTO));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,9 @@ package it.integry.integrywmsnative.gest.contab_doc_interni.dialog;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.exception.DocumentRequiredException;
|
||||
@@ -34,24 +33,11 @@ public class DialogSelectDocInfoViewModel extends ViewModel {
|
||||
private final MutableLiveData<Boolean> noteRequired = new MutableLiveData<>(false);
|
||||
|
||||
public DialogSelectDocInfoViewModel() {
|
||||
tipoDoc.observeForever(val ->
|
||||
fornitoreRequired.postValue(
|
||||
val != null &&
|
||||
(val.getGestioneDoc().equals("T") ||
|
||||
val.getGestioneDoc().equals("A") ||
|
||||
(val.getGestioneDoc().equals("P") &&
|
||||
!val.getGestione().equals("L")))));
|
||||
tipoDoc.observeForever(val -> fornitoreRequired.postValue(val != null && (val.getGestioneDoc().equals("T") || val.getGestioneDoc().equals("A") || (val.getGestioneDoc().equals("P") && !val.getGestione().equals("L")))));
|
||||
|
||||
tipoDoc.observeForever(val ->
|
||||
documentRequired.postValue(
|
||||
val != null &&
|
||||
val.getGestioneDoc().equalsIgnoreCase("P") && !val.getGestione().equalsIgnoreCase("L")));
|
||||
tipoDoc.observeForever(val -> documentRequired.postValue(val != null && val.getGestioneDoc().equalsIgnoreCase("P") && !val.getGestione().equalsIgnoreCase("L")));
|
||||
|
||||
tipoDoc.observeForever(val ->
|
||||
noteRequired.postValue(
|
||||
val != null &&
|
||||
val.getGestioneDoc().equals("P") &&
|
||||
val.getGestione().equals("L")));
|
||||
tipoDoc.observeForever(val -> noteRequired.postValue(val != null && val.getGestioneDoc().equals("P") && val.getGestione().equals("L")));
|
||||
}
|
||||
|
||||
public MutableLiveData<List<FornitoreDTO>> getAvailableFornitori() {
|
||||
@@ -60,18 +46,15 @@ public class DialogSelectDocInfoViewModel extends ViewModel {
|
||||
|
||||
public void setFornitori(List<FornitoreDTO> fornitori) {
|
||||
tipoDoc.observeForever(val -> {
|
||||
availableFornitori.postValue(Stream.of(fornitori)
|
||||
.filter(forn -> {
|
||||
if (val.getGestioneDoc().equalsIgnoreCase("T")) {
|
||||
return forn.getTipoAnag().equalsIgnoreCase("D") &&
|
||||
forn.getGestioneAnag().equalsIgnoreCase(
|
||||
val.getGestione().equalsIgnoreCase("V") ? "V" : "L"
|
||||
);
|
||||
} else {
|
||||
return forn.getTipoAnag().equalsIgnoreCase("F");
|
||||
}
|
||||
})
|
||||
.toList());
|
||||
List<FornitoreDTO> availableFornitoriList = fornitori.stream().filter(forn -> {
|
||||
if (val.getGestioneDoc().equalsIgnoreCase("T")) {
|
||||
return forn.getTipoAnag().equalsIgnoreCase("D") && forn.getGestioneAnag().equalsIgnoreCase(val.getGestione().equalsIgnoreCase("V") ? "V" : "L");
|
||||
} else {
|
||||
return forn.getTipoAnag().equalsIgnoreCase("F");
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
availableFornitori.postValue(availableFornitoriList);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
public class CheckFornitoreDTO {
|
||||
|
||||
private String codDtip;
|
||||
private Boolean flagCheckPartitaMag;
|
||||
|
||||
public String getCodDtip() {
|
||||
return codDtip;
|
||||
}
|
||||
|
||||
public CheckFornitoreDTO setCodDtip(String codDtip) {
|
||||
this.codDtip = codDtip;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getFlagCheckPartitaMag() {
|
||||
return flagCheckPartitaMag;
|
||||
}
|
||||
|
||||
public CheckFornitoreDTO setFlagCheckPartitaMag(Boolean flagCheckPartitaMag) {
|
||||
this.flagCheckPartitaMag = flagCheckPartitaMag;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class FornitoreDTO {
|
||||
|
||||
|
||||
@@ -13,6 +15,8 @@ public class FornitoreDTO {
|
||||
|
||||
private String gestioneAnag;
|
||||
|
||||
private List<CheckFornitoreDTO> checkFornitoreDTO;
|
||||
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
@@ -57,4 +61,13 @@ public class FornitoreDTO {
|
||||
public String getLabel() {
|
||||
return this.codAnag + (this.codVdes != null ? " - "+ this.codVdes : "") +" ( " + this.descrizione+" )";
|
||||
}
|
||||
|
||||
public List<CheckFornitoreDTO> getCheckFornitoreDTO() {
|
||||
return checkFornitoreDTO;
|
||||
}
|
||||
|
||||
public FornitoreDTO setCheckFornitoreDTO(List<CheckFornitoreDTO> checkFornitoreDTO) {
|
||||
this.checkFornitoreDTO = checkFornitoreDTO;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ public class SaveDTO {
|
||||
private ColloDTO colloDTO;
|
||||
private InventarioDTO inventarioDTO;
|
||||
|
||||
private String UUID;
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
@@ -112,4 +114,13 @@ public class SaveDTO {
|
||||
public void setInventarioDTO(InventarioDTO inventarioDTO) {
|
||||
this.inventarioDTO = inventarioDTO;
|
||||
}
|
||||
|
||||
public String getUUID() {
|
||||
return UUID;
|
||||
}
|
||||
|
||||
public SaveDTO setUUID(String UUID) {
|
||||
this.UUID = UUID;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ public class TipoDocDTO {
|
||||
private String descrizione;
|
||||
private String gestione;
|
||||
private String gestioneDoc;
|
||||
private boolean flagChkTracciabilita;
|
||||
private boolean requireNote = false;
|
||||
|
||||
public String getCodDtip() {
|
||||
@@ -52,4 +53,13 @@ public class TipoDocDTO {
|
||||
this.requireNote = requireNote;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagChkTracciabilita() {
|
||||
return flagChkTracciabilita;
|
||||
}
|
||||
|
||||
public TipoDocDTO setFlagChkTracciabilita(boolean flagChkTracciabilita) {
|
||||
this.flagChkTracciabilita = flagChkTracciabilita;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,11 @@ package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
@@ -26,7 +28,6 @@ import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColrDataSource;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.di.BindableInteger;
|
||||
import it.integry.integrywmsnative.core.di.BindableString;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||
@@ -37,11 +38,11 @@ import it.integry.integrywmsnative.core.model.MtbUntMis;
|
||||
import it.integry.integrywmsnative.core.rest.model.documento.DocumentoArtDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.databinding.ActivityContabDocInterniEditBinding;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipoDocDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsItemListModel;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsView;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.ui.DocumentRowsListAdapter;
|
||||
import it.integry.integrywmsnative.ui.FabMenuCustomAnimations;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalView;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||
import it.integry.integrywmsnative.view.dialogs.available_items.DialogAvailableItemListModel;
|
||||
@@ -55,6 +56,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
private static final String DATA_KEY_DOCUMENT = "document";
|
||||
private static final String DATA_KEY_PRODUCTS_LIST = "productsList";
|
||||
private static final String DATA_KEY_TIPO_DOC = "docType";
|
||||
private static final String DATA_KEY_DOC_INTERNI = "docInterniSetup";
|
||||
|
||||
@Inject
|
||||
MtbColrDataSource documentRowsRepository;
|
||||
@@ -75,18 +77,23 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
public BindableString codMgrp = new BindableString();
|
||||
public BindableString codAnag = new BindableString();
|
||||
public BindableInteger prodsCount = new BindableInteger(0);
|
||||
public BindableBoolean isDocumentExportable = new BindableBoolean(false);
|
||||
private final ObservableArrayList<SqlMtbColr> documentRowsObservableList = new ObservableArrayList<>();
|
||||
|
||||
public static Intent newInstance(Context context, SqlMtbColt document, List<DocumentoArtDTO> arts, TipoDocDTO tipoDoc) {
|
||||
|
||||
private PopupMenu fabPopupMenu;
|
||||
|
||||
public static Intent newInstance(Context context, SqlMtbColt document, List<DocumentoArtDTO> arts, TipoDocDTO tipoDoc, DocInterniSetupDTO mDocInterniSetupDTO) {
|
||||
Intent myIntent = new Intent(context, DocInterniEditFormActivity.class);
|
||||
|
||||
String doc = DataCache.addItem(document);
|
||||
String productsKey = DataCache.addItem(arts);
|
||||
String docType = DataCache.addItem(tipoDoc);
|
||||
String docInterniSetup = DataCache.addItem(mDocInterniSetupDTO);
|
||||
|
||||
myIntent.putExtra(DATA_KEY_DOCUMENT, doc);
|
||||
myIntent.putExtra(DATA_KEY_PRODUCTS_LIST, productsKey);
|
||||
myIntent.putExtra(DATA_KEY_TIPO_DOC, docType);
|
||||
myIntent.putExtra(DATA_KEY_DOC_INTERNI, docInterniSetup);
|
||||
return myIntent;
|
||||
}
|
||||
|
||||
@@ -103,16 +110,18 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
SqlMtbColt document = DataCache.retrieveItem(getIntent().getStringExtra(DATA_KEY_DOCUMENT));
|
||||
List<DocumentoArtDTO> productList = DataCache.retrieveItem(getIntent().getStringExtra(DATA_KEY_PRODUCTS_LIST));
|
||||
TipoDocDTO docType = DataCache.retrieveItem(getIntent().getStringExtra(DATA_KEY_TIPO_DOC));
|
||||
DocInterniSetupDTO docInterniSetupDTO = DataCache.retrieveItem(getIntent().getStringExtra(DATA_KEY_DOC_INTERNI));
|
||||
|
||||
this.initViewModel();
|
||||
this.viewModel.setDocInterniSetupDTO(docInterniSetupDTO);
|
||||
this.viewModel.setDocument(document);
|
||||
this.viewModel.setProductsList(productList);
|
||||
this.viewModel.setTipoDoc(docType);
|
||||
|
||||
|
||||
this.initView();
|
||||
this.initBindables();
|
||||
this.initRecyclerView();
|
||||
this.initFab();
|
||||
}
|
||||
|
||||
private void initBindables() {
|
||||
@@ -145,7 +154,8 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
setSupportActionBar(binding.toolbar);
|
||||
binding.toolbar.setTitle(R.string.edit_doc);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
FabMenuCustomAnimations.changeIconOnFocus(binding.closeActivityFab, R.drawable.ic_menu_24dp, R.drawable.ic_close_24dp);
|
||||
|
||||
// FabMenuCustomAnimations.changeIconOnFocus(binding.closeActivityFab, R.drawable.ic_menu_24dp, R.drawable.ic_close_24dp);
|
||||
|
||||
}
|
||||
|
||||
@@ -156,6 +166,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
|
||||
private void initRecyclerView() {
|
||||
this.viewModel.docRows.observe(this, this::refreshList);
|
||||
|
||||
DocumentRowsListAdapter listAdapter = new DocumentRowsListAdapter(this, documentRowsObservableList);
|
||||
listAdapter.setEmptyView(binding.scanArtSpinner);
|
||||
binding.documentRowsList.setAdapter(listAdapter);
|
||||
@@ -167,11 +178,58 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
});
|
||||
}
|
||||
|
||||
private void initFab() {
|
||||
fabPopupMenu = new PopupMenu(this, this.binding.mainFab,
|
||||
(Gravity.END | Gravity.BOTTOM),
|
||||
androidx.appcompat.R.attr.popupMenuStyle,
|
||||
com.google.android.material.R.style.Widget_Material3_PopupMenu_ContextMenu);
|
||||
|
||||
fabPopupMenu.setForceShowIcon(true);
|
||||
fabPopupMenu.getMenuInflater().inflate(R.menu.doc_interni_edit_fab_menu, fabPopupMenu.getMenu());
|
||||
|
||||
|
||||
fabPopupMenu.setOnMenuItemClickListener(item -> {
|
||||
int itemId = item.getItemId();
|
||||
|
||||
if (itemId == R.id.export_document) {
|
||||
viewModel.exportDocument();
|
||||
} else if (itemId == R.id.delete_document) {
|
||||
viewModel.deleteDocument();
|
||||
} else if (itemId == R.id.hold_document) {
|
||||
viewModel.holdDocument();
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
refreshFabMenu();
|
||||
}
|
||||
|
||||
private void refreshFabMenu() {
|
||||
fabPopupMenu.getMenu()
|
||||
.findItem(R.id.export_document)
|
||||
.setVisible(isDocumentExportable());
|
||||
}
|
||||
|
||||
public void showFabMenu() {
|
||||
fabPopupMenu.show();
|
||||
}
|
||||
|
||||
public void closeFabMenu() {
|
||||
fabPopupMenu.dismiss();
|
||||
}
|
||||
|
||||
private void refreshList(List<SqlMtbColr> sqlMtbColrs) {
|
||||
this.documentRowsObservableList.clear();
|
||||
this.documentRowsObservableList.addAll(this.viewModel.docRows.getValue());
|
||||
|
||||
this.prodsCount.set(this.viewModel.docRows.getValue().size());
|
||||
this.refreshFabMenu();
|
||||
}
|
||||
|
||||
private boolean isDocumentExportable() {
|
||||
return prodsCount.get() > 0;
|
||||
}
|
||||
|
||||
public void closeEdit() {
|
||||
this.onBackPressed();
|
||||
@@ -192,7 +250,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
super.onStart();
|
||||
SqlMtbColt document = this.viewModel.getDocument();
|
||||
if (document == null) {
|
||||
Toast.makeText(this, "Nesusn documento selezionato!", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(this, "Nessun documento selezionato!", Toast.LENGTH_SHORT).show();
|
||||
closeEdit();
|
||||
return;
|
||||
}
|
||||
@@ -224,7 +282,6 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
@Override
|
||||
public void onRowsChanged(List<SqlMtbColr> rows) {
|
||||
this.prodsCount.set(rows.size());
|
||||
this.isDocumentExportable.set(rows.size() > 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -277,7 +334,8 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
this.onLoadingStarted();
|
||||
this.viewModel.saveRow(row, resultDTO);
|
||||
})
|
||||
.setOnAbort(() -> {})
|
||||
.setOnAbort(() -> {
|
||||
})
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@@ -288,7 +346,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
|
||||
@Override
|
||||
public void onDocDeleted() {
|
||||
this.binding.closeActivityFab.close(true);
|
||||
this.closeFabMenu();
|
||||
this.closeEdit();
|
||||
}
|
||||
|
||||
@@ -332,7 +390,8 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
|
||||
DialogSelectDocRowsView.newInstance(dataset, data -> {
|
||||
this.viewModel.dispatchRowEdit((SqlMtbColr) data.getOriginalModel(), articolo.isFlagTracciabilita(), articolo.isUntMisDigitale());
|
||||
}, () -> {})
|
||||
}, () -> {
|
||||
})
|
||||
.show(this.getSupportFragmentManager(), "dialogSelectDocRowsNew");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,12 +4,10 @@ import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -27,8 +25,12 @@ import it.integry.integrywmsnative.core.rest.model.documento.DocumentoArtDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilitySHA1;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.ArtDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.CheckFornitoreDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.ColloDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DocInterniSetupDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.FornitoreDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipoDocDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||
@@ -44,10 +46,10 @@ public class DocInterniEditFormViewModel {
|
||||
private TipoDocDTO tipoDoc;
|
||||
|
||||
private boolean isCheckPartitaMag = false;
|
||||
private JSONObject checkFornitoreRules = null;
|
||||
|
||||
|
||||
public MutableLiveData<SqlMtbColt> document = new MutableLiveData<>();
|
||||
public MutableLiveData<DocInterniSetupDTO> docInterniSetupDTO = new MutableLiveData<>();
|
||||
public MutableLiveData<List<SqlMtbColr>> docRows = new MutableLiveData<>();
|
||||
|
||||
@Inject
|
||||
@@ -59,12 +61,6 @@ public class DocInterniEditFormViewModel {
|
||||
}
|
||||
|
||||
public void init() {
|
||||
try {
|
||||
var docInterniCheckFornitore = SettingsManager.iDB().getDocInterniCheckFornitore();
|
||||
this.checkFornitoreRules = docInterniCheckFornitore != null ? new JSONObject(docInterniCheckFornitore) : null;
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +125,12 @@ public class DocInterniEditFormViewModel {
|
||||
}
|
||||
|
||||
public void loadArticoloByCodMartOrBarcode(String codMart) {
|
||||
var matchedArt = Stream.of(productsList)
|
||||
if(productsList == null) {
|
||||
this.sendError(new NoResultFromCodMartException(codMart));
|
||||
return;
|
||||
}
|
||||
|
||||
var matchedArt = productsList.stream()
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(codMart) ||
|
||||
x.getBarcode().contains(codMart))
|
||||
.findFirst()
|
||||
@@ -207,7 +208,12 @@ public class DocInterniEditFormViewModel {
|
||||
|
||||
private SaveDTO getSaveDto() {
|
||||
SqlMtbColt document = this.getDocument();
|
||||
|
||||
String UUID = SettingsManager.i().getUserSession().getDeviceId() + "-" + document.getId();
|
||||
UUID = UtilitySHA1.getSha1Hex(UUID);
|
||||
|
||||
SaveDTO saveDTO = new SaveDTO();
|
||||
saveDTO.setUUID(UUID);
|
||||
saveDTO.setIdDisp("1");
|
||||
saveDTO.setGestione(document.getGestione());
|
||||
saveDTO.setCodMdep(document.getCodMdep());
|
||||
@@ -236,6 +242,8 @@ public class DocInterniEditFormViewModel {
|
||||
artDto.setColli(BigDecimal.valueOf(row.getNumCnf()));
|
||||
artDto.setUntMis(row.getUntMis());
|
||||
artDto.setCodMart(row.getCodMart());
|
||||
artDto.setSystemNote(row.getNote());
|
||||
artDto.setPartitaMag(row.getPartitaMag());
|
||||
if (row.getDataScad() != null) {
|
||||
artDto.setDataScad(row.getDataScad());
|
||||
}
|
||||
@@ -257,35 +265,54 @@ public class DocInterniEditFormViewModel {
|
||||
this.initCheckFornitore();
|
||||
}
|
||||
|
||||
public void setDocInterniSetupDTO(DocInterniSetupDTO docInterniSetupDTO) {
|
||||
this.docInterniSetupDTO.setValue(docInterniSetupDTO);
|
||||
}
|
||||
|
||||
private void initCheckFornitore() {
|
||||
SqlMtbColt doc = this.document.getValue();
|
||||
List<FornitoreDTO> fornitori = Objects.requireNonNull(this.docInterniSetupDTO.getValue()).getFornitori();
|
||||
List<TipoDocDTO> tipoDocDTO = Objects.requireNonNull(this.docInterniSetupDTO.getValue()).getTipiDoc();
|
||||
this.isCheckPartitaMag = false;
|
||||
|
||||
if (doc == null)
|
||||
if (doc == null || fornitori == null || tipoDocDTO == null)
|
||||
return;
|
||||
|
||||
boolean isCheckPartitaMag = false;
|
||||
List<FornitoreDTO> filterFornitori = Stream.of(fornitori)
|
||||
.filter(x -> x.getCodAnag().equals(doc.getCodAnag()))
|
||||
.toList();
|
||||
List<CheckFornitoreDTO> checkFornitoreDTO;
|
||||
|
||||
try {
|
||||
if (this.checkFornitoreRules != null && this.checkFornitoreRules.has("value")) {
|
||||
isCheckPartitaMag = this.checkFornitoreRules.getBoolean("value");
|
||||
} else if (this.checkFornitoreRules != null) {
|
||||
String key = doc.getCodAnag();
|
||||
if (doc.getCodVdes() != null && !doc.getCodVdes().isEmpty()) {
|
||||
key += "-" + doc.getCodVdes();
|
||||
}
|
||||
if (this.checkFornitoreRules.has(key) &&
|
||||
((String) ((JSONObject) this.checkFornitoreRules.get(key))
|
||||
.get(doc.getCodDtipProvv()))
|
||||
.equalsIgnoreCase("check-partitaMag")) {
|
||||
isCheckPartitaMag = true;
|
||||
}
|
||||
TipoDocDTO tipoDoc = Stream.of(tipoDocDTO)
|
||||
.filter(x -> x.getCodDtip().equals(doc.getCodDtipProvv()))
|
||||
.findFirst()
|
||||
.get();
|
||||
|
||||
if (tipoDoc.isFlagChkTracciabilita()) {
|
||||
this.isCheckPartitaMag = tipoDoc.isFlagChkTracciabilita();
|
||||
} else {
|
||||
if (filterFornitori.isEmpty())
|
||||
return;
|
||||
|
||||
if (doc.getCodVdes() == null) {
|
||||
checkFornitoreDTO = Stream.of(filterFornitori)
|
||||
.filter(x -> x.getCodVdes() == null).findFirst().get().getCheckFornitoreDTO();
|
||||
} else {
|
||||
checkFornitoreDTO = Stream.of(filterFornitori)
|
||||
.filterNot(x -> x.getCodVdes() == null)
|
||||
.filter(x -> x.getCodVdes().equals(doc.getCodVdes())).findFirst().get().getCheckFornitoreDTO();
|
||||
}
|
||||
|
||||
if (checkFornitoreDTO != null) {
|
||||
CheckFornitoreDTO flagCheck = Stream.of(checkFornitoreDTO)
|
||||
.filter(x -> x.getCodDtip().equals(doc.getCodDtipProvv())).findFirstOrElse(null);
|
||||
|
||||
if (flagCheck == null)
|
||||
return;
|
||||
|
||||
this.isCheckPartitaMag = flagCheck.getFlagCheckPartitaMag();
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
this.sendError(e);
|
||||
}
|
||||
|
||||
|
||||
this.isCheckPartitaMag = isCheckPartitaMag;
|
||||
}
|
||||
|
||||
public SqlMtbColt getDocument() {
|
||||
@@ -330,6 +357,7 @@ public class DocInterniEditFormViewModel {
|
||||
row.setQtaCol(resultDTO.getQtaTot().floatValue());
|
||||
row.setNote(resultDTO.getNote());
|
||||
row.setDataScad(resultDTO.getDataScad());
|
||||
row.setPartitaMag(resultDTO.getPartitaMag());
|
||||
if (row.getId() > 0) {
|
||||
this.mtbColrRepository.update(row, id -> {
|
||||
this.fetchDocumentRows();
|
||||
|
||||
@@ -4,8 +4,11 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
import android.view.Gravity;
|
||||
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableField;
|
||||
@@ -18,8 +21,11 @@ import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.databinding.ActivityContenutoBancaleBinding;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ui.ContenutoBancaleListAdapter;
|
||||
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||
@@ -38,11 +44,14 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
||||
@Inject
|
||||
PrinterRESTConsumer mPrinterRESTConsumer;
|
||||
|
||||
@Inject
|
||||
ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||
|
||||
public final ObservableField<MtbColt> mtbColt = new ObservableField<>();
|
||||
public final ObservableField<String> descrizioneDepo = new ObservableField<>();
|
||||
|
||||
public ObservableField<Boolean> fabVisible = new ObservableField<>(true);
|
||||
public ObservableField<Boolean> recoverFabMenuVisible = new ObservableField<>(false);
|
||||
private PopupMenu fabPopupMenu;
|
||||
|
||||
private String mReportName;
|
||||
|
||||
@@ -95,11 +104,11 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
||||
|
||||
recoverFabMenuVisible.set(canRecoverUL);
|
||||
|
||||
initRecyclerView();
|
||||
initColloInfo();
|
||||
this.initRecyclerView();
|
||||
this.initColloInfo();
|
||||
this.initFab();
|
||||
}
|
||||
|
||||
|
||||
private void initRecyclerView() {
|
||||
this.bindings.contenutoBancaleMainList.setNestedScrollingEnabled(false);
|
||||
|
||||
@@ -115,13 +124,40 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
||||
this.bindings.contenutoBancaleMainList.setAdapter(adapter);
|
||||
}
|
||||
|
||||
|
||||
private void initColloInfo() {
|
||||
mDepositoRESTConsumer.getDepoByCodMdep(mtbColt.get().getCodMdep(), depo -> {
|
||||
descrizioneDepo.set("(" + depo.getDescrizione() + ")");
|
||||
}, this::onError);
|
||||
SettingsManager.iDB().getAvailableCodMdep().stream()
|
||||
.filter(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.get().getCodMdep()))
|
||||
.findFirst()
|
||||
.ifPresent(x -> descrizioneDepo.set("(" + x.getDescrizione() + ")"));
|
||||
}
|
||||
|
||||
private void initFab() {
|
||||
fabPopupMenu = new PopupMenu(this, this.bindings.accettazioneOrdineInevasoFab,
|
||||
(Gravity.END | Gravity.BOTTOM),
|
||||
androidx.appcompat.R.attr.popupMenuStyle,
|
||||
com.google.android.material.R.style.Widget_Material3_PopupMenu_ContextMenu);
|
||||
|
||||
fabPopupMenu.setForceShowIcon(true);
|
||||
fabPopupMenu.getMenuInflater().inflate(R.menu.contenuto_bancale_fab_menu, fabPopupMenu.getMenu());
|
||||
|
||||
if (mtbColt.get().isDocumentPresent()) {
|
||||
fabPopupMenu.getMenu().removeItem(R.id.delete_ul);
|
||||
}
|
||||
|
||||
fabPopupMenu.setOnMenuItemClickListener(item -> {
|
||||
int itemId = item.getItemId();
|
||||
|
||||
if (itemId == R.id.recover_ul) {
|
||||
this.recoverUL();
|
||||
} else if (itemId == R.id.print_ul) {
|
||||
this.printUL();
|
||||
} else if (itemId == R.id.delete_ul) {
|
||||
this.deleteUL();
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
public void recoverUL() {
|
||||
Intent data = new Intent();
|
||||
@@ -132,9 +168,7 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
||||
this.finish();
|
||||
}
|
||||
|
||||
|
||||
public void printUL() {
|
||||
this.bindings.contenutoBancaleFab.close(true);
|
||||
this.onLoadingStarted();
|
||||
try {
|
||||
this.mPrinterRESTConsumer.printCollo(mtbColt.get(),
|
||||
@@ -153,11 +187,42 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteUL() {
|
||||
String text = getResources().getString(R.string.alert_delete_UL);
|
||||
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(Html.fromHtml(text)), null, () -> this.runOnUiThread(() -> {
|
||||
this.onLoadingStarted();
|
||||
|
||||
try {
|
||||
DeleteULRequestDTO deleteULRequestDTO = new DeleteULRequestDTO()
|
||||
.setMtbColt(this.mtbColt.get());
|
||||
|
||||
mColliMagazzinoRESTConsumer.deleteUL(deleteULRequestDTO, () -> {
|
||||
Intent data = new Intent();
|
||||
String key = DataCache.addItem(this.mtbColt.get());
|
||||
String keyDeleteUL = DataCache.addItem(true);
|
||||
data.putExtra("key", key)
|
||||
.putExtra("keyDeleteUL", keyDeleteUL);
|
||||
|
||||
this.onLoadingEnded();
|
||||
this.setResult(RESULT_OK, data);
|
||||
this.finish();
|
||||
}, this::onError);
|
||||
} catch (Exception ex) {
|
||||
this.onError(ex);
|
||||
}
|
||||
}), () -> {
|
||||
}).show(this.getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
public void showFabMenu() {
|
||||
fabPopupMenu.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSupportNavigateUp() {
|
||||
onBackPressed();
|
||||
getOnBackPressedDispatcher().onBackPressed();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
initialQtaTot = UtilityBigDecimal.multiply(initialNumCnf, initialQtaCnf);
|
||||
}
|
||||
|
||||
if (inventarioArtDTO.isPlu()) {
|
||||
if (pickingObjectDTO.getTempPickData() != null && inventarioArtDTO.isPlu()) {
|
||||
this.saveNewRow(pickingObjectDTO, initialNumCnf, initialQtaCnf, initialQtaTot, null, barcode);
|
||||
} else {
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleActivi
|
||||
import it.integry.integrywmsnative.gest.lista_bancali.ui.ListaColliMainListAdapter;
|
||||
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||
|
||||
public class ListaBancaliActivity extends BaseActivity implements ListaBancaliViewModel.Listener{
|
||||
public class ListaBancaliActivity extends BaseActivity implements ListaBancaliViewModel.Listener {
|
||||
|
||||
private static class Key {
|
||||
private static final String MtbColtsKey = "mtbColtsKey";
|
||||
@@ -47,7 +47,6 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
||||
private static final int PICK_UL_REQUEST = 1; // The request code
|
||||
|
||||
|
||||
|
||||
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, String reportName) {
|
||||
return createIntent(context, items, canRecoverUlAction, true, reportName);
|
||||
}
|
||||
@@ -126,17 +125,16 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
||||
|
||||
@Override
|
||||
public boolean onSupportNavigateUp() {
|
||||
onBackPressed();
|
||||
getOnBackPressedDispatcher().onBackPressed();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void startContenutoBancaleActivity(MtbColt item){
|
||||
public void startContenutoBancaleActivity(MtbColt item) {
|
||||
Intent myIntent = ContenutoBancaleActivity.createIntent(this, item, mCanRecoverUl.run(item), mReportName);
|
||||
startActivityForResult(myIntent, PICK_UL_REQUEST);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
@@ -144,9 +142,20 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
||||
if (requestCode == PICK_UL_REQUEST) {
|
||||
// Make sure the request was successful
|
||||
if (resultCode == RESULT_OK) {
|
||||
Object keyDeleteUL = DataCache.retrieveItem(data.getStringExtra("keyDeleteUL"));
|
||||
boolean deleteUL = keyDeleteUL != null && (boolean) keyDeleteUL;
|
||||
|
||||
if (deleteUL) {
|
||||
this.onLoadingStarted();
|
||||
MtbColt item = DataCache.retrieveItem(data.getStringExtra("key"));
|
||||
mtbColts.remove(item);
|
||||
this.initRecyclerView();
|
||||
this.onLoadingEnded();
|
||||
} else {
|
||||
this.setResult(RESULT_OK, data);
|
||||
this.finish();
|
||||
}
|
||||
|
||||
this.setResult(RESULT_OK, data);
|
||||
this.finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,18 +26,16 @@ public class ListaBancaliViewModel {
|
||||
public void dispatchMtbColt(MtbColt mtbColtToDispatch, boolean onlyResiduo, RunnableArgs<MtbColt> onComplete) {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
new Thread(() -> {
|
||||
mColliMagazzinoRESTConsumer.getByTestata(mtbColtToDispatch, onlyResiduo, false, mtbColt -> {
|
||||
this.sendOnLoadingEnded();
|
||||
mColliMagazzinoRESTConsumer.getByTestata(mtbColtToDispatch, onlyResiduo, false, mtbColt -> {
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
ObservableArrayList<MtbColr> mtbColrObservableArrayList = new ObservableArrayList<>();
|
||||
if(mtbColt != null && mtbColt.getMtbColr() != null) mtbColrObservableArrayList.addAll(mtbColt.getMtbColr());
|
||||
mtbColtToDispatch.setMtbColr(mtbColrObservableArrayList);
|
||||
ObservableArrayList<MtbColr> mtbColrObservableArrayList = new ObservableArrayList<>();
|
||||
if (mtbColt != null && mtbColt.getMtbColr() != null)
|
||||
mtbColrObservableArrayList.addAll(mtbColt.getMtbColr());
|
||||
mtbColtToDispatch.setMtbColr(mtbColrObservableArrayList);
|
||||
|
||||
onComplete.run(mtbColtToDispatch);
|
||||
}, this::sendError);
|
||||
|
||||
}).start();
|
||||
onComplete.run(mtbColtToDispatch);
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -213,10 +213,16 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
||||
(recoveredMtbColt.getGestioneEnum() == GestioneEnum.VENDITA ||
|
||||
recoveredMtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE)) {
|
||||
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
if(recoveredMtbColtDto.getTestateOrdini() != null &&
|
||||
!recoveredMtbColtDto.getTestateOrdini().isEmpty()){
|
||||
codMdep = recoveredMtbColtDto.getTestateOrdini().get(0).getCodMdep();
|
||||
}
|
||||
|
||||
var closeUDSRequestDto = new CloseUDSRequestDTO()
|
||||
.setMtbColt(recoveredMtbColt)
|
||||
//.setPrintSSCC(shouldPrint)
|
||||
.setOrderCodMdep(recoveredMtbColtDto.getTestateOrdini().get(0).getCodMdep());
|
||||
.setOrderCodMdep(codMdep);
|
||||
|
||||
RunnableArgs<CloseUDSResponseDTO> onRequestComplete = closeUDSResponseDto -> {
|
||||
colliDataRecoverService.closeSession(recoveredMtbColtID);
|
||||
|
||||
@@ -7,7 +7,7 @@ import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAutom
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterClienteLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterDepositoLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterGruppoMercLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterPaeseLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterTermConsLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterVettoreLayoutView;
|
||||
|
||||
@@ -60,7 +60,7 @@ import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAutom
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterClienteLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterDepositoLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterGruppoMercLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterPaeseLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterTermConsLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterVettoreLayoutView;
|
||||
@@ -825,6 +825,8 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
|
||||
int alreadyRegisteredUL = alreadyRegisteredMtbColts.size();
|
||||
|
||||
boolean divideByGrpMerc = SettingsManager.iDB().isGroupShippingByCommodityGroup();
|
||||
|
||||
DialogSimpleMessageView.makeInfoDialog(getText(R.string.orders).toString(),
|
||||
Html.fromHtml(String.format(getActivity().getResources().getQuantityString(R.plurals.loaded_orders_message, orders.size()), orders.size())
|
||||
+ "<br />" +
|
||||
@@ -839,7 +841,8 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
mCurrentGestioneCol,
|
||||
mCurrentSegnoCol,
|
||||
MtbColr.Causale.DEFAULT,
|
||||
mDialogRowInfo)
|
||||
mDialogRowInfo,
|
||||
divideByGrpMerc)
|
||||
).show(getActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
|
||||
@@ -65,33 +65,31 @@ public class OrdiniUscitaElencoViewModel {
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
new Thread(() -> {
|
||||
Date loadingStartDate = new Date();
|
||||
Date loadingStartDate = new Date();
|
||||
|
||||
this.mOrdiniRESTConsumer.getOrdiniInevasi(this.mCurrentCodMdep, mCurrentGestioneOrd,
|
||||
ordiniLavorazione -> {
|
||||
this.mOrderList.postValue(Stream.of(ordiniLavorazione)
|
||||
.map(x -> {
|
||||
try {
|
||||
return OrdiniUscitaElencoDTO.fromParent(x);
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.toList());
|
||||
this.mOrdiniRESTConsumer.getOrdiniInevasi(this.mCurrentCodMdep, mCurrentGestioneOrd,
|
||||
ordiniLavorazione -> {
|
||||
this.mOrderList.postValue(Stream.of(ordiniLavorazione)
|
||||
.map(x -> {
|
||||
try {
|
||||
return OrdiniUscitaElencoDTO.fromParent(x);
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.toList());
|
||||
|
||||
long forcedDelaySecs = (new Date().getTime() - loadingStartDate.getTime()) / 1000;
|
||||
long forcedDelaySecs = (new Date().getTime() - loadingStartDate.getTime()) / 1000;
|
||||
|
||||
if (2 - forcedDelaySecs > 0) {
|
||||
try {
|
||||
Thread.sleep((2 - forcedDelaySecs) * 1000);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (2 - forcedDelaySecs > 0) {
|
||||
try {
|
||||
Thread.sleep((2 - forcedDelaySecs) * 1000);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
}).start();
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
@@ -42,7 +43,6 @@ import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.VtbDest;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
||||
import it.integry.integrywmsnative.databinding.FragmentPickingLiberoBinding;
|
||||
@@ -54,6 +54,7 @@ import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalView;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteView;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.DialogAskLineaProdView;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_mtbcolr_list.DialogChooseArtsFromMtbColrList;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||
@@ -86,16 +87,21 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
private int barcodeScannerIstanceID = -1;
|
||||
|
||||
private GestioneEnum mCurrentGestione;
|
||||
private boolean mAskCliente;
|
||||
private boolean mAskLineaProd;
|
||||
|
||||
public PickingLiberoFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static PickingLiberoFragment newInstance(GestioneEnum gestioneEnum) {
|
||||
public static PickingLiberoFragment newInstance(@StringRes int title, GestioneEnum gestioneEnum, boolean askCliente, boolean askLineaProd) {
|
||||
PickingLiberoFragment fragment = new PickingLiberoFragment();
|
||||
Bundle args = new Bundle();
|
||||
|
||||
args.putInt("title", title);
|
||||
args.putString("gestione", gestioneEnum.getText());
|
||||
args.putBoolean("askCliente", askCliente);
|
||||
args.putBoolean("askLineaProd", askLineaProd);
|
||||
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
@@ -104,7 +110,6 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
@Override
|
||||
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||
mToolbarTitleText = titleText;
|
||||
mToolbarTitleText.setText(context.getText(R.string.free_picking_title_fragment).toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -113,6 +118,11 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
setRetainInstance(true);
|
||||
|
||||
mCurrentGestione = GestioneEnum.fromString(getArguments().getString("gestione"));
|
||||
mAskCliente = getArguments().getBoolean("askCliente");
|
||||
mAskLineaProd = getArguments().getBoolean("askLineaProd");
|
||||
|
||||
|
||||
mToolbarTitleText.setText(getText(getArguments().getInt("title")).toString());
|
||||
}
|
||||
|
||||
|
||||
@@ -139,8 +149,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
|
||||
this.initRecyclerView();
|
||||
|
||||
boolean flagAskCliente = SettingsManager.iDB().isFlagAskClienteInPickingLibero();
|
||||
mViewModel.init(flagAskCliente, mCurrentGestione);
|
||||
mViewModel.init(mAskCliente, mAskLineaProd, mCurrentGestione);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
@@ -263,7 +272,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
null,
|
||||
() -> onComplete.run(true),
|
||||
() -> onComplete.run(false)
|
||||
).show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
).show(requireActivity().getSupportFragmentManager(), DialogSimpleMessageView.class.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -284,7 +293,13 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
@Override
|
||||
public void onLUClienteRequired(RunnableArgss<VtbDest, String> onComplete, Runnable onAbort) {
|
||||
DialogAskClienteView.newInstance(onComplete, onAbort)
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
.show(requireActivity().getSupportFragmentManager(), DialogAskClienteView.class.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLULineaProdRequired(RunnableArgs<String> onComplete, Runnable onAbort) {
|
||||
DialogAskLineaProdView.newInstance(onComplete, onAbort)
|
||||
.show(getParentFragmentManager(), DialogAskLineaProdView.class.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -294,7 +309,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
onAbort.run();
|
||||
BarcodeManager.enable();
|
||||
})
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
.show(requireActivity().getSupportFragmentManager(), DialogChooseArtsFromMtbColrList.class.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,7 +6,9 @@ import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliSpedizioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoAutomaticoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||
@@ -21,8 +23,17 @@ public class PickingLiberoModule {
|
||||
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||
PosizioniRESTConsumer posizioniRESTConsumer,
|
||||
GiacenzaRESTConsumer giacenzaRESTConsumer,
|
||||
MagazzinoAutomaticoRESTConsumer magazzinoAutomaticoRESTConsumer
|
||||
MagazzinoAutomaticoRESTConsumer magazzinoAutomaticoRESTConsumer,
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
|
||||
ColliSpedizioneRESTConsumer colliSpedizioneRESTConsumer
|
||||
) {
|
||||
return new PickingLiberoViewModel(articoloRESTConsumer, colliMagazzinoRESTConsumer, barcodeRESTConsumer, posizioniRESTConsumer, giacenzaRESTConsumer, magazzinoAutomaticoRESTConsumer);
|
||||
return new PickingLiberoViewModel(articoloRESTConsumer,
|
||||
colliMagazzinoRESTConsumer,
|
||||
barcodeRESTConsumer,
|
||||
posizioniRESTConsumer,
|
||||
giacenzaRESTConsumer,
|
||||
magazzinoAutomaticoRESTConsumer,
|
||||
colliLavorazioneRESTConsumer,
|
||||
colliSpedizioneRESTConsumer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.exception.InvalidCodMdepException;
|
||||
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||
import it.integry.integrywmsnative.core.exception.ScannedPositionNotExistException;
|
||||
@@ -32,14 +33,18 @@ import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliSpedizioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoAutomaticoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliScaricoRESTConsumerInterface;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPickItemRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPickItemsRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
@@ -63,8 +68,12 @@ public class PickingLiberoViewModel {
|
||||
private final GiacenzaRESTConsumer mGiacenzaRESTConsumer;
|
||||
private final MagazzinoAutomaticoRESTConsumer mMagazzinoAutomaticoRESTConsumer;
|
||||
|
||||
private ColliScaricoRESTConsumerInterface mColliScaricoRESTConsumer;
|
||||
private final ColliLavorazioneRESTConsumer mColliLavorazioneRESTConsumer;
|
||||
private final ColliSpedizioneRESTConsumer mColliSpedizioneRESTConsumer;
|
||||
|
||||
private boolean mFlagAskCliente;
|
||||
private boolean mFlagAskLineaProd;
|
||||
private GestioneEnum mDefaultGestione;
|
||||
|
||||
|
||||
@@ -77,19 +86,30 @@ public class PickingLiberoViewModel {
|
||||
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||
PosizioniRESTConsumer posizioniRESTConsumer,
|
||||
GiacenzaRESTConsumer giacenzaRESTConsumer,
|
||||
MagazzinoAutomaticoRESTConsumer mMagazzinoAutomaticoRESTConsumer) {
|
||||
MagazzinoAutomaticoRESTConsumer mMagazzinoAutomaticoRESTConsumer,
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
|
||||
ColliSpedizioneRESTConsumer colliSpedizioneRESTConsumer) {
|
||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||
this.mPosizioniRESTConsumer = posizioniRESTConsumer;
|
||||
this.mGiacenzaRESTConsumer = giacenzaRESTConsumer;
|
||||
this.mMagazzinoAutomaticoRESTConsumer = mMagazzinoAutomaticoRESTConsumer;
|
||||
this.mColliLavorazioneRESTConsumer = colliLavorazioneRESTConsumer;
|
||||
this.mColliSpedizioneRESTConsumer = colliSpedizioneRESTConsumer;
|
||||
}
|
||||
|
||||
|
||||
public void init(boolean flagAskCliente, GestioneEnum defaultGestione) {
|
||||
public void init(boolean flagAskCliente, boolean flagAskLineaProd, GestioneEnum defaultGestione) {
|
||||
this.mFlagAskCliente = defaultGestione == GestioneEnum.VENDITA && flagAskCliente;
|
||||
this.mFlagAskLineaProd = defaultGestione == GestioneEnum.LAVORAZIONE && flagAskLineaProd;
|
||||
this.mDefaultGestione = defaultGestione;
|
||||
|
||||
|
||||
switch (mDefaultGestione) {
|
||||
case LAVORAZIONE -> this.mColliScaricoRESTConsumer = mColliLavorazioneRESTConsumer;
|
||||
case VENDITA -> this.mColliScaricoRESTConsumer = mColliSpedizioneRESTConsumer;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -192,7 +212,14 @@ public class PickingLiberoViewModel {
|
||||
}
|
||||
} else if (mtbColtList.size() == 1) {
|
||||
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||
pickMerceULtoUL(mtbColt, articolo, onComplete);
|
||||
|
||||
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||
|
||||
if (codMdepIsValid) {
|
||||
pickMerceULtoUL(mtbColt, articolo, onComplete);
|
||||
} else this.sendError(new InvalidCodMdepException());
|
||||
|
||||
}, this::sendError);
|
||||
} else {
|
||||
this.sendError(new TooManyLUFoundInMonoLUPositionException());
|
||||
@@ -216,7 +243,14 @@ public class PickingLiberoViewModel {
|
||||
if (mtbColtScanned == null) {
|
||||
this.sendError(new NoLUFoundException());
|
||||
} else if ((mtbColtScanned.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColtScanned.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && mtbColtScanned.getSegno() > 0) {
|
||||
pickMerceULtoUL(mtbColtScanned, onComplete);
|
||||
|
||||
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColtScanned.getCodMdep()));
|
||||
|
||||
if (codMdepIsValid) {
|
||||
pickMerceULtoUL(mtbColtScanned, onComplete);
|
||||
} else this.sendError(new InvalidCodMdepException());
|
||||
|
||||
} else {
|
||||
this.sendError(new NoLUFoundException());
|
||||
}
|
||||
@@ -279,46 +313,57 @@ public class PickingLiberoViewModel {
|
||||
public void createNewLU(Integer customNumCollo, String customSerCollo, Runnable onComplete) {
|
||||
if (this.mFlagAskCliente) {
|
||||
this.sendLUClienteRequired((vtbDest, codJcom) -> {
|
||||
createNewLU_PostClienteAsk(customNumCollo, customSerCollo, vtbDest, codJcom, onComplete);
|
||||
createNewLU_PostClienteAsk(customNumCollo, customSerCollo, vtbDest, onComplete);
|
||||
}, () -> {
|
||||
|
||||
});
|
||||
} else {
|
||||
createNewLU_PostClienteAsk(customNumCollo, customSerCollo, null, null, onComplete);
|
||||
createNewLU_PostClienteAsk(customNumCollo, customSerCollo, null, onComplete);
|
||||
}
|
||||
}
|
||||
|
||||
private void createNewLU_PostClienteAsk(Integer customNumCollo, String customSerCollo, VtbDest vtbDest, String codJcom, Runnable onComplete) {
|
||||
private void createNewLU_PostClienteAsk(Integer customNumCollo, String customSerCollo, VtbDest vtbDest, Runnable onComplete) {
|
||||
if (this.mFlagAskLineaProd) {
|
||||
this.sendLULineaProdRequired(codJfas -> {
|
||||
createNewLU_PostLineaProdAsk(customNumCollo, customSerCollo, vtbDest, codJfas, onComplete);
|
||||
}, () -> {
|
||||
|
||||
});
|
||||
} else {
|
||||
createNewLU_PostLineaProdAsk(customNumCollo, customSerCollo, vtbDest, null, onComplete);
|
||||
}
|
||||
}
|
||||
|
||||
private void createNewLU_PostLineaProdAsk(Integer customNumCollo, String customSerCollo, VtbDest vtbDest, String codJfas, Runnable onComplete) {
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
MtbColt mtbColt = new MtbColt();
|
||||
mtbColt.initDefaultFields(mDefaultGestione)
|
||||
var createUDSRequest = new CreateUDSRequestDTO()
|
||||
.setRifOrd(mDefaultGestione == GestioneEnum.LAVORAZIONE ? "PICKING LIBERO" : null)
|
||||
// .setCodAnag(SettingsManager.iDB().getProduzioneDefaultCodAnag())
|
||||
.setSegno(-1)
|
||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
.setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep())
|
||||
.setCausaleCollo(CreateUDSRequestDTO.Causale.SCARICO)
|
||||
.setOrderRequired(mFlagAskLineaProd);
|
||||
|
||||
if (customNumCollo != null) {
|
||||
mtbColt.setNumCollo(customNumCollo);
|
||||
createUDSRequest.setNumCollo(customNumCollo);
|
||||
}
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(customSerCollo)) {
|
||||
mtbColt.setSerCollo(customSerCollo);
|
||||
createUDSRequest.setSerCollo(customSerCollo);
|
||||
}
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(codJfas)) {
|
||||
createUDSRequest.setCodJfas(codJfas);
|
||||
}
|
||||
|
||||
if (vtbDest != null) {
|
||||
mtbColt.setCodAnag(vtbDest.getCodAnag());
|
||||
mtbColt.setCodVdes(vtbDest.getCodVdes());
|
||||
createUDSRequest.setCodAnag(vtbDest.getCodAnag());
|
||||
createUDSRequest.setCodVdes(vtbDest.getCodVdes());
|
||||
}
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(codJcom)) {
|
||||
mtbColt.setCodJcom(codJcom);
|
||||
}
|
||||
|
||||
mColliMagazzinoRESTConsumer.saveCollo(mtbColt, value -> {
|
||||
mColliScaricoRESTConsumer.createUDS(createUDSRequest, mtbColt -> {
|
||||
mtbColt
|
||||
.setNumCollo(value.getNumCollo())
|
||||
.setDataCollo(value.getDataColloS())
|
||||
.setMtbColr(new ObservableArrayList<>());
|
||||
|
||||
this.mCurrentMtbColt = mtbColt;
|
||||
@@ -328,6 +373,43 @@ public class PickingLiberoViewModel {
|
||||
if (onComplete != null) onComplete.run();
|
||||
this.sendLUOpened(mtbColt);
|
||||
}, this::sendError);
|
||||
|
||||
// MtbColt mtbColt = new MtbColt();
|
||||
// mtbColt.initDefaultFields(mDefaultGestione)
|
||||
// .setRifOrd(mDefaultGestione == GestioneEnum.LAVORAZIONE ? "PICKING LIBERO" : null)
|
||||
// .setSegno(-1)
|
||||
// .setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
//
|
||||
// if (customNumCollo != null) {
|
||||
// mtbColt.setNumCollo(customNumCollo);
|
||||
// }
|
||||
//
|
||||
// if (!UtilityString.isNullOrEmpty(customSerCollo)) {
|
||||
// mtbColt.setSerCollo(customSerCollo);
|
||||
// }
|
||||
//
|
||||
// if (vtbDest != null) {
|
||||
// mtbColt.setCodAnag(vtbDest.getCodAnag());
|
||||
// mtbColt.setCodVdes(vtbDest.getCodVdes());
|
||||
// }
|
||||
//
|
||||
// if (!UtilityString.isNullOrEmpty(codJcom)) {
|
||||
// mtbColt.setCodJcom(codJcom);
|
||||
// }
|
||||
|
||||
// mColliMagazzinoRESTConsumer.saveCollo(mtbColt, value -> {
|
||||
// mtbColt
|
||||
// .setNumCollo(value.getNumCollo())
|
||||
// .setDataCollo(value.getDataColloS())
|
||||
// .setMtbColr(new ObservableArrayList<>());
|
||||
//
|
||||
// this.mCurrentMtbColt = mtbColt;
|
||||
//
|
||||
// this.sendOnLoadingEnded();
|
||||
//
|
||||
// if (onComplete != null) onComplete.run();
|
||||
// this.sendLUOpened(mtbColt);
|
||||
// }, this::sendError);
|
||||
}
|
||||
|
||||
private void dispatchArt(MtbAart mtbAart, Ean128Model ean128Model) {
|
||||
@@ -447,9 +529,9 @@ public class PickingLiberoViewModel {
|
||||
this.sendArtSelectionRequest(mtbColrsToPick, mtbAart, pickedAarts -> {
|
||||
List<MtbColr> destNewMtbColr = new ArrayList<>();
|
||||
|
||||
if (pickedAarts.size() > 0) {
|
||||
if (!pickedAarts.isEmpty()) {
|
||||
askQuantities(pickedAarts.iterator(), destNewMtbColr, () -> {
|
||||
if (destNewMtbColr.size() > 0) {
|
||||
if (!destNewMtbColr.isEmpty()) {
|
||||
MtbColt clonedTestata = (MtbColt) this.mCurrentMtbColt.clone();
|
||||
clonedTestata.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
||||
|
||||
@@ -481,8 +563,6 @@ public class PickingLiberoViewModel {
|
||||
|
||||
clonedTestata.setMtbColr(mtbColrObservableField);
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
new Thread(() -> {
|
||||
mColliMagazzinoRESTConsumer.saveCollo(clonedTestata, value -> {
|
||||
for (int i = 0; i < mtbColrObservableField.size(); i++) {
|
||||
@@ -868,6 +948,10 @@ public class PickingLiberoViewModel {
|
||||
if (this.mListener != null) mListener.onLUClienteRequired(onComplete, onAbort);
|
||||
}
|
||||
|
||||
private void sendLULineaProdRequired(RunnableArgs<String> onComplete, Runnable onAbort) {
|
||||
if (this.mListener != null) mListener.onLULineaProdRequired(onComplete, onAbort);
|
||||
}
|
||||
|
||||
private void sendArtSelectionRequest(List<MtbColr> mtbColrsToPick, MtbAart mtbAart, RunnableArgs<List<MtbColr>> onComplete, Runnable onAbort) {
|
||||
if (this.mListener != null)
|
||||
mListener.onArtSelectionRequest(mtbColrsToPick, mtbAart, onComplete, onAbort);
|
||||
@@ -924,6 +1008,8 @@ public class PickingLiberoViewModel {
|
||||
|
||||
void onLUClienteRequired(RunnableArgss<VtbDest, String> onComplete, Runnable onAbort);
|
||||
|
||||
void onLULineaProdRequired(RunnableArgs<String> onComplete, Runnable onAbort);
|
||||
|
||||
void onArtSelectionRequest(List<MtbColr> mtbColrsToPick, MtbAart mtbAart, RunnableArgs<List<MtbColr>> onComplete, Runnable onAbort);
|
||||
|
||||
void onItemDispatched(PickingObjectDTO pickingObjectDTO,
|
||||
|
||||
@@ -52,7 +52,7 @@ import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFrag
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_should_print.DialogAskShouldPrint;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLU;
|
||||
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUView;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
|
||||
@@ -276,7 +276,8 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
||||
|
||||
@Override
|
||||
public void onInfoAggiuntiveRequired(RunnableArgss<String, MtbTCol> onComplete) {
|
||||
DialogInfoAggiuntiveLU.newInstance(onComplete).show(getSupportFragmentManager(), "InfoAggiuntiveLUDialog");
|
||||
DialogInfoAggiuntiveLUView.newInstance(onComplete, this::onLoadingEnded)
|
||||
.show(getSupportFragmentManager(), DialogInfoAggiuntiveLUView.class.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user