Compare commits
141 Commits
v1.38.01(4
...
v1.40.18(4
| Author | SHA1 | Date | |
|---|---|---|---|
| b5c2efa9e2 | |||
| 9abba0ce82 | |||
| c616a9d31a | |||
| e45a980ce3 | |||
| 46c9fa184d | |||
| 3a31fba1b4 | |||
| 6cded1d2d1 | |||
| 027d0e891b | |||
| 93abea0823 | |||
| 5c5216e207 | |||
| 7a20ff6ddc | |||
| 048b7d7f56 | |||
| f009726cf0 | |||
| fb213cbdbb | |||
| 971dcaed87 | |||
| 7b132def2a | |||
| 998dc54292 | |||
| 157eaf8760 | |||
| 10ffcf7806 | |||
| 392dd18338 | |||
| d4c7cdf400 | |||
| cde96ae694 | |||
| e49d35fdbc | |||
| 55db6d362d | |||
| 925cb6ae07 | |||
| c4f1d53199 | |||
| e18ac7a390 | |||
| cc454aea1a | |||
| 5cf275e43c | |||
| 53fe1db488 | |||
| 64082fc5ee | |||
| f9c642ad13 | |||
| bd7edf2357 | |||
| b7605bd28c | |||
| ad01283511 | |||
| adeab93b17 | |||
| 51480c2b06 | |||
| d04b3797ce | |||
| 518a00becf | |||
| c808cf7ce3 | |||
| 8cb488d81f | |||
| ed3f84d0ea | |||
| d9b02c4402 | |||
| 23522c9370 | |||
| f79b40c574 | |||
| 835915b46a | |||
| e643f25aa3 | |||
| 230a32139d | |||
| b0272cd9e0 | |||
| fa9947f22b | |||
| 5d3bb333e1 | |||
| 9f7085dfed | |||
| 95f765756c | |||
| a846ec00d7 | |||
| 6edc1917e1 | |||
| 1b864253b5 | |||
| f212987547 | |||
| 76f9c7030b | |||
| 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 |
21
.idea/appInsightsSettings.xml
generated
21
.idea/appInsightsSettings.xml
generated
@@ -2,5 +2,26 @@
|
||||
<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>
|
||||
15
.idea/deploymentTargetDropDown.xml
generated
15
.idea/deploymentTargetDropDown.xml
generated
@@ -3,20 +3,7 @@
|
||||
<component name="deploymentTargetDropDown">
|
||||
<value>
|
||||
<entry key="Prod_Android.WMS.app">
|
||||
<State>
|
||||
<runningDeviceTargetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="SERIAL_NUMBER" />
|
||||
<value value="20119B1E55" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</runningDeviceTargetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2024-01-15T11:45:15.850312500Z" />
|
||||
</State>
|
||||
<State />
|
||||
</entry>
|
||||
<entry key="app">
|
||||
<State />
|
||||
|
||||
10
.idea/deploymentTargetSelector.xml
generated
Normal file
10
.idea/deploymentTargetSelector.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetSelector">
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
</SelectionState>
|
||||
</selectionStates>
|
||||
</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 {
|
||||
|
||||
}
|
||||
126
.idea/fileTemplates/Android Dialog.java
generated
Normal file
126
.idea/fileTemplates/Android Dialog.java
generated
Normal file
@@ -0,0 +1,126 @@
|
||||
#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();
|
||||
|
||||
MainApplication.appComponent
|
||||
.dialog${NAME}Component()
|
||||
.create()
|
||||
.inject(this);
|
||||
}
|
||||
|
||||
|
||||
@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();
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
2
.idea/kotlinc.xml
generated
2
.idea/kotlinc.xml
generated
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.9.0" />
|
||||
<option name="version" value="1.9.20" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 411
|
||||
def appVersionName = '1.38.01'
|
||||
def appVersionCode = 435
|
||||
def appVersionName = '1.40.18'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -103,17 +103,16 @@ dependencies {
|
||||
//Firebase
|
||||
|
||||
// Import the Firebase BoM
|
||||
implementation platform('com.google.firebase:firebase-bom:29.1.0')
|
||||
implementation platform('com.google.firebase:firebase-bom:32.8.1')
|
||||
implementation 'com.google.firebase:firebase-analytics'
|
||||
implementation 'com.google.firebase:firebase-core'
|
||||
implementation 'com.google.firebase:firebase-crashlytics'
|
||||
implementation 'com.google.firebase:firebase-perf'
|
||||
implementation 'com.google.android.gms:play-services-basement:18.2.0'
|
||||
implementation 'com.google.android.gms:play-services-basement:18.3.0'
|
||||
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.10.0'
|
||||
implementation 'com.google.android.material:material:1.11.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.3.2'
|
||||
@@ -128,7 +127,7 @@ dependencies {
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||
implementation 'com.annimon:stream:1.2.2'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0'
|
||||
// implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||
implementation 'org.apache.commons:commons-text:1.9'
|
||||
|
||||
|
||||
@@ -33,31 +33,25 @@
|
||||
android:requestLegacyExternalStorage="true">
|
||||
<activity
|
||||
android:name=".gest.spedizione.SpedizioneActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.prod_dettaglio_linea.ProdDettaglioLineaActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.picking_resi.PickingResiActivity"
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.main.MainActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
@@ -68,28 +62,23 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".gest.login.LoginActivity"
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.accettazione_ordini_picking.AccettazioneOrdiniPickingActivity"
|
||||
android:theme="@style/Light"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.lista_bancali.ListaBancaliActivity"
|
||||
android:label="@string/activity_lista_bancali_title"
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.contenuto_bancale.ContenutoBancaleActivity"
|
||||
android:label="@string/activity_contenuto_bancale_title"
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden" />
|
||||
<activity
|
||||
android:name=".gest.inventario.picking.PickingInventarioActivity"
|
||||
android:label="@string/activity_picking_inventario_title"
|
||||
android:windowSoftInputMode="adjustNothing"
|
||||
android:theme="@style/Light"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden"/>
|
||||
|
||||
<meta-data
|
||||
@@ -110,8 +99,7 @@
|
||||
|
||||
<activity
|
||||
android:name=".gest.accettazione_bolla_picking.AccettazioneBollaPickingActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light" />
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<provider
|
||||
android:name=".core.update.GenericFileProvider"
|
||||
|
||||
@@ -19,6 +19,8 @@ import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazi
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.MainAccettazioneOrdiniElencoModule;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.AccettazioneOrdiniPickingComponent;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.AccettazioneOrdiniPickingModule;
|
||||
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaComponent;
|
||||
import it.integry.integrywmsnative.gest.articoli_in_giacenza.ArticoliInGiacenzaModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniComponent;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.DocInterniModule;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoComponent;
|
||||
@@ -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;
|
||||
@@ -108,6 +114,8 @@ import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.DialogAskLineaPro
|
||||
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.ask_vettore.DialogAskVettoreComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_vettore.DialogAskVettoreModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromMtbAartListComponent;
|
||||
@@ -132,6 +140,8 @@ import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_art.DialogScanArtModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.tracciamento_imballi.DialogTracciamentoImballiComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.tracciamento_imballi.DialogTracciamentoImballiModule;
|
||||
|
||||
// Definition of the Application graph
|
||||
@Singleton
|
||||
@@ -200,7 +210,12 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
ProdVersamentoMaterialeInBufferModule.class,
|
||||
DialogInputQuantityToReturnModule.class,
|
||||
DialogInfoAggiuntiveLUModule.class,
|
||||
DialogAskLineaProdModule.class
|
||||
DialogAskLineaProdModule.class,
|
||||
ProdRiposizionamentoDaProdModule.class,
|
||||
DialogInfoGiacenzaModule.class,
|
||||
ArticoliInGiacenzaModule.class,
|
||||
DialogTracciamentoImballiModule.class,
|
||||
DialogAskVettoreModule.class
|
||||
})
|
||||
public interface MainApplicationComponent {
|
||||
|
||||
@@ -336,6 +351,16 @@ public interface MainApplicationComponent {
|
||||
|
||||
DialogAskLineaProdComponent.Factory dialogAskLineaProdComponent();
|
||||
|
||||
ProdRiposizionamentoDaProdComponent.Factory prodRiposizionamentoDaprodComponent();
|
||||
|
||||
DialogInfoGiacenzaComponent.Factory dialogInfoGiacenzaComponent();
|
||||
|
||||
ArticoliInGiacenzaComponent.Factory controlloGiacenzeComponent();
|
||||
|
||||
DialogTracciamentoImballiComponent.Factory dialogTracciamentoImballiComponent();
|
||||
|
||||
DialogAskVettoreComponent.Factory dialogAskVettoreComponent();
|
||||
|
||||
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;
|
||||
@@ -31,6 +32,7 @@ import it.integry.integrywmsnative.core.rest.consumers.DocumentRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ImballiRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoAutomaticoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoBufferRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
||||
@@ -41,8 +43,10 @@ import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.VettoriRESTConsumer;
|
||||
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 +106,12 @@ public class MainApplicationModule {
|
||||
return colliDataRecoverService;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
Ean128Service provideEan128Service() {
|
||||
return new Ean128Service();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MenuService provideMenuService(MenuRESTConsumer menuRESTConsumer) {
|
||||
@@ -164,8 +174,8 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MagazzinoRESTConsumer provideMagazzinoRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
return new MagazzinoRESTConsumer(systemRESTConsumer);
|
||||
MagazzinoRESTConsumer provideMagazzinoRESTConsumer(ExecutorService executorService, SystemRESTConsumer systemRESTConsumer) {
|
||||
return new MagazzinoRESTConsumer(executorService, systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -197,8 +207,8 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
BarcodeRESTConsumer provideBarcodeRESTConsumer() {
|
||||
return new BarcodeRESTConsumer();
|
||||
BarcodeRESTConsumer provideBarcodeRESTConsumer(Ean128Service ean128Service) {
|
||||
return new BarcodeRESTConsumer(ean128Service);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -239,8 +249,20 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
GiacenzaRESTConsumer provideGiacenzaRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
return new GiacenzaRESTConsumer(systemRESTConsumer, articoloRESTConsumer);
|
||||
GiacenzaRESTConsumer provideGiacenzaRESTConsumer(ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
return new GiacenzaRESTConsumer(articoloRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ImballiRESTConsumer provideImballiRESTConsumer(ExecutorService executorService) {
|
||||
return new ImballiRESTConsumer(executorService);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
VettoriRESTConsumer provideVettoriRESTConsumer(ExecutorService executorService) {
|
||||
return new VettoriRESTConsumer(executorService);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -291,4 +313,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);
|
||||
}
|
||||
@@ -5,6 +5,7 @@ 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;
|
||||
@@ -14,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;
|
||||
@@ -114,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)
|
||||
@@ -179,6 +181,14 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.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)
|
||||
@@ -209,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 {
|
||||
|
||||
@@ -211,16 +211,19 @@ 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());
|
||||
|
||||
observableBigDecimal.set(value);
|
||||
}
|
||||
};
|
||||
view.setTag(R.id.bound_observable, new Pair<>(observableBigDecimal, watcher));
|
||||
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));
|
||||
@@ -238,8 +241,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 +253,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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -19,7 +20,7 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||
|
||||
public class BaseDialogFragment extends DialogFragment implements DialogInterface.OnShowListener {
|
||||
public abstract class BaseDialogFragment extends DialogFragment implements DialogInterface.OnShowListener {
|
||||
|
||||
@Inject
|
||||
public DialogProgressView mCurrentProgress;
|
||||
@@ -111,7 +112,14 @@ public class BaseDialogFragment extends DialogFragment implements DialogInterfac
|
||||
|
||||
@Override
|
||||
public void onShow(DialogInterface dialogInterface) {
|
||||
getDialog().getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
|
||||
|
||||
this.initialize();
|
||||
this.onInit(dialogInterface);
|
||||
}
|
||||
|
||||
public void onInit(DialogInterface dialogInterface) {
|
||||
|
||||
}
|
||||
|
||||
private void initialize() {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class MtbTCol {
|
||||
@@ -13,7 +15,7 @@ public class MtbTCol {
|
||||
private BigDecimal taraKg;
|
||||
private String descrizione;
|
||||
private String codMart;
|
||||
private String flagUIUL;
|
||||
private FlagUiUlEnum flagUIUL;
|
||||
private String circuito;
|
||||
|
||||
public String getCodTcol() {
|
||||
@@ -88,13 +90,12 @@ public class MtbTCol {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagUIUL() {
|
||||
public FlagUiUlEnum getFlagUIUL() {
|
||||
return flagUIUL;
|
||||
}
|
||||
|
||||
public MtbTCol setFlagUIUL(String flagUIUL) {
|
||||
public void setFlagUIUL(FlagUiUlEnum flagUIUL) {
|
||||
this.flagUIUL = flagUIUL;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCircuito() {
|
||||
@@ -107,4 +108,29 @@ public class MtbTCol {
|
||||
}
|
||||
|
||||
|
||||
public enum FlagUiUlEnum {
|
||||
@SerializedName("UI")
|
||||
UI("UI"),
|
||||
|
||||
@SerializedName("UL")
|
||||
UL("UL");
|
||||
|
||||
private final String text;
|
||||
FlagUiUlEnum(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
|
||||
public String getText() {
|
||||
return this.text;
|
||||
}
|
||||
|
||||
public static FlagUiUlEnum fromString(String text) {
|
||||
for (FlagUiUlEnum b : FlagUiUlEnum.values()) {
|
||||
if (b.text.equalsIgnoreCase(text)) return b;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import android.os.Parcelable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class VtbVetr extends EntityBase {
|
||||
|
||||
public VtbVetr() {
|
||||
type = "vtb_vetr";
|
||||
}
|
||||
|
||||
private String codVvet;
|
||||
private String codSpes;
|
||||
private String idRiga;
|
||||
private BigDecimal daQta;
|
||||
private BigDecimal aQta;
|
||||
private BigDecimal impUnt;
|
||||
private BigDecimal impFisso;
|
||||
private String codDivi;
|
||||
|
||||
public String getCodVvet() {
|
||||
return codVvet;
|
||||
}
|
||||
|
||||
public VtbVetr setCodVvet(String codVvet) {
|
||||
this.codVvet = codVvet;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodSpes() {
|
||||
return codSpes;
|
||||
}
|
||||
|
||||
public VtbVetr setCodSpes(String codSpes) {
|
||||
this.codSpes = codSpes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIdRiga() {
|
||||
return idRiga;
|
||||
}
|
||||
|
||||
public VtbVetr setIdRiga(String idRiga) {
|
||||
this.idRiga = idRiga;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getDaQta() {
|
||||
return daQta;
|
||||
}
|
||||
|
||||
public VtbVetr setDaQta(BigDecimal daQta) {
|
||||
this.daQta = daQta;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getaQta() {
|
||||
return aQta;
|
||||
}
|
||||
|
||||
public VtbVetr setaQta(BigDecimal aQta) {
|
||||
this.aQta = aQta;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getImpUnt() {
|
||||
return impUnt;
|
||||
}
|
||||
|
||||
public VtbVetr setImpUnt(BigDecimal impUnt) {
|
||||
this.impUnt = impUnt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getImpFisso() {
|
||||
return impFisso;
|
||||
}
|
||||
|
||||
public VtbVetr setImpFisso(BigDecimal impFisso) {
|
||||
this.impFisso = impFisso;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodDivi() {
|
||||
return codDivi;
|
||||
}
|
||||
|
||||
public VtbVetr setCodDivi(String codDivi) {
|
||||
this.codDivi = codDivi;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,273 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
public class VtbVett extends EntityBase {
|
||||
|
||||
public VtbVett() {
|
||||
type = "vtb_vett";
|
||||
}
|
||||
|
||||
private String codVvet;
|
||||
private String codLettVett;
|
||||
private String codAnag;
|
||||
private String ragSoc;
|
||||
private String indirizzo;
|
||||
private String cap;
|
||||
private String citta;
|
||||
private String prov;
|
||||
private String nazione;
|
||||
private String telefono;
|
||||
private String fax;
|
||||
private String partIva;
|
||||
private String note;
|
||||
private String eMail;
|
||||
private String modStamp;
|
||||
private BigDecimal coefVol;
|
||||
private String flagAttivo;
|
||||
private String numAutoriz;
|
||||
private List<VtbVetr> vtbVetr;
|
||||
|
||||
|
||||
public String getCodVvet() {
|
||||
return codVvet;
|
||||
}
|
||||
|
||||
public VtbVett setCodVvet(String codVvet) {
|
||||
this.codVvet = codVvet;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodLettVett() {
|
||||
return codLettVett;
|
||||
}
|
||||
|
||||
public VtbVett setCodLettVett(String codLettVett) {
|
||||
this.codLettVett = codLettVett;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public VtbVett setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRagSoc() {
|
||||
return ragSoc;
|
||||
}
|
||||
|
||||
public VtbVett setRagSoc(String ragSoc) {
|
||||
this.ragSoc = ragSoc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIndirizzo() {
|
||||
return indirizzo;
|
||||
}
|
||||
|
||||
public VtbVett setIndirizzo(String indirizzo) {
|
||||
this.indirizzo = indirizzo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCap() {
|
||||
return cap;
|
||||
}
|
||||
|
||||
public VtbVett setCap(String cap) {
|
||||
this.cap = cap;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCitta() {
|
||||
return citta;
|
||||
}
|
||||
|
||||
public VtbVett setCitta(String citta) {
|
||||
this.citta = citta;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getProv() {
|
||||
return prov;
|
||||
}
|
||||
|
||||
public VtbVett setProv(String prov) {
|
||||
this.prov = prov;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNazione() {
|
||||
return nazione;
|
||||
}
|
||||
|
||||
public VtbVett setNazione(String nazione) {
|
||||
this.nazione = nazione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTelefono() {
|
||||
return telefono;
|
||||
}
|
||||
|
||||
public VtbVett setTelefono(String telefono) {
|
||||
this.telefono = telefono;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFax() {
|
||||
return fax;
|
||||
}
|
||||
|
||||
public VtbVett setFax(String fax) {
|
||||
this.fax = fax;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPartIva() {
|
||||
return partIva;
|
||||
}
|
||||
|
||||
public VtbVett setPartIva(String partIva) {
|
||||
this.partIva = partIva;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public VtbVett setNote(String note) {
|
||||
this.note = note;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String geteMail() {
|
||||
return eMail;
|
||||
}
|
||||
|
||||
public VtbVett seteMail(String eMail) {
|
||||
this.eMail = eMail;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getModStamp() {
|
||||
return modStamp;
|
||||
}
|
||||
|
||||
public VtbVett setModStamp(String modStamp) {
|
||||
this.modStamp = modStamp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getCoefVol() {
|
||||
return coefVol;
|
||||
}
|
||||
|
||||
public VtbVett setCoefVol(BigDecimal coefVol) {
|
||||
this.coefVol = coefVol;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFlagAttivo() {
|
||||
return flagAttivo;
|
||||
}
|
||||
|
||||
public VtbVett setFlagAttivo(String flagAttivo) {
|
||||
this.flagAttivo = flagAttivo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNumAutoriz() {
|
||||
return numAutoriz;
|
||||
}
|
||||
|
||||
public VtbVett setNumAutoriz(String numAutoriz) {
|
||||
this.numAutoriz = numAutoriz;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<VtbVetr> getVtbVetr() {
|
||||
return vtbVetr;
|
||||
}
|
||||
|
||||
public VtbVett setVtbVetr(List<VtbVetr> vtbVetr) {
|
||||
this.vtbVetr = vtbVetr;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
VtbVett vtbVett = (VtbVett) o;
|
||||
|
||||
if (!getCodVvet().equals(vtbVett.getCodVvet())) return false;
|
||||
if (getCodLettVett() != null ? !getCodLettVett().equals(vtbVett.getCodLettVett()) : vtbVett.getCodLettVett() != null)
|
||||
return false;
|
||||
if (getCodAnag() != null ? !getCodAnag().equals(vtbVett.getCodAnag()) : vtbVett.getCodAnag() != null)
|
||||
return false;
|
||||
if (getRagSoc() != null ? !getRagSoc().equals(vtbVett.getRagSoc()) : vtbVett.getRagSoc() != null)
|
||||
return false;
|
||||
if (getIndirizzo() != null ? !getIndirizzo().equals(vtbVett.getIndirizzo()) : vtbVett.getIndirizzo() != null)
|
||||
return false;
|
||||
if (getCap() != null ? !getCap().equals(vtbVett.getCap()) : vtbVett.getCap() != null)
|
||||
return false;
|
||||
if (getCitta() != null ? !getCitta().equals(vtbVett.getCitta()) : vtbVett.getCitta() != null)
|
||||
return false;
|
||||
if (getProv() != null ? !getProv().equals(vtbVett.getProv()) : vtbVett.getProv() != null)
|
||||
return false;
|
||||
if (getNazione() != null ? !getNazione().equals(vtbVett.getNazione()) : vtbVett.getNazione() != null)
|
||||
return false;
|
||||
if (getTelefono() != null ? !getTelefono().equals(vtbVett.getTelefono()) : vtbVett.getTelefono() != null)
|
||||
return false;
|
||||
if (getFax() != null ? !getFax().equals(vtbVett.getFax()) : vtbVett.getFax() != null)
|
||||
return false;
|
||||
if (getPartIva() != null ? !getPartIva().equals(vtbVett.getPartIva()) : vtbVett.getPartIva() != null)
|
||||
return false;
|
||||
if (getNote() != null ? !getNote().equals(vtbVett.getNote()) : vtbVett.getNote() != null)
|
||||
return false;
|
||||
if (geteMail() != null ? !geteMail().equals(vtbVett.geteMail()) : vtbVett.geteMail() != null)
|
||||
return false;
|
||||
if (getModStamp() != null ? !getModStamp().equals(vtbVett.getModStamp()) : vtbVett.getModStamp() != null)
|
||||
return false;
|
||||
if (getCoefVol() != null ? !getCoefVol().equals(vtbVett.getCoefVol()) : vtbVett.getCoefVol() != null)
|
||||
return false;
|
||||
if (getFlagAttivo() != null ? !getFlagAttivo().equals(vtbVett.getFlagAttivo()) : vtbVett.getFlagAttivo() != null)
|
||||
return false;
|
||||
if (getNumAutoriz() != null ? !getNumAutoriz().equals(vtbVett.getNumAutoriz()) : vtbVett.getNumAutoriz() != null)
|
||||
return false;
|
||||
return getVtbVetr() != null ? getVtbVetr().equals(vtbVett.getVtbVetr()) : vtbVett.getVtbVetr() == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = getCodVvet().hashCode();
|
||||
result = 31 * result + (getCodLettVett() != null ? getCodLettVett().hashCode() : 0);
|
||||
result = 31 * result + (getCodAnag() != null ? getCodAnag().hashCode() : 0);
|
||||
result = 31 * result + (getRagSoc() != null ? getRagSoc().hashCode() : 0);
|
||||
result = 31 * result + (getIndirizzo() != null ? getIndirizzo().hashCode() : 0);
|
||||
result = 31 * result + (getCap() != null ? getCap().hashCode() : 0);
|
||||
result = 31 * result + (getCitta() != null ? getCitta().hashCode() : 0);
|
||||
result = 31 * result + (getProv() != null ? getProv().hashCode() : 0);
|
||||
result = 31 * result + (getNazione() != null ? getNazione().hashCode() : 0);
|
||||
result = 31 * result + (getTelefono() != null ? getTelefono().hashCode() : 0);
|
||||
result = 31 * result + (getFax() != null ? getFax().hashCode() : 0);
|
||||
result = 31 * result + (getPartIva() != null ? getPartIva().hashCode() : 0);
|
||||
result = 31 * result + (getNote() != null ? getNote().hashCode() : 0);
|
||||
result = 31 * result + (geteMail() != null ? geteMail().hashCode() : 0);
|
||||
result = 31 * result + (getModStamp() != null ? getModStamp().hashCode() : 0);
|
||||
result = 31 * result + (getCoefVol() != null ? getCoefVol().hashCode() : 0);
|
||||
result = 31 * result + (getFlagAttivo() != null ? getFlagAttivo().hashCode() : 0);
|
||||
result = 31 * result + (getNumAutoriz() != null ? getNumAutoriz().hashCode() : 0);
|
||||
result = 31 * result + (getVtbVetr() != null ? getVtbVetr().hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -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")
|
||||
|
||||
@@ -61,7 +61,11 @@ public class RESTBuilder {
|
||||
|
||||
Gson gson = UtilityGson.createObject();
|
||||
|
||||
Retrofit retrofit = new Retrofit.Builder().addConverterFactory(GsonConverterFactory.create(gson)).baseUrl(endpoint).client(client).build();
|
||||
Retrofit retrofit = new Retrofit.Builder()
|
||||
.addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.baseUrl(endpoint)
|
||||
.client(client)
|
||||
.build();
|
||||
|
||||
return retrofit.create(service);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
@@ -133,7 +133,7 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
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;
|
||||
@@ -24,11 +25,9 @@ import retrofit2.Response;
|
||||
@Singleton
|
||||
public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||
|
||||
public GiacenzaRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||
public GiacenzaRESTConsumer(ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||
|
||||
}
|
||||
@@ -38,6 +37,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 +86,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 +110,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);
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.imballi.ImballoQuantityDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.imballi.RegistraCaricoImballiRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.imballi.RegistraScaricoImballiRequestDTO;
|
||||
import retrofit2.Response;
|
||||
|
||||
@Singleton
|
||||
public class ImballiRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final ExecutorService executorService;
|
||||
|
||||
public ImballiRESTConsumer(ExecutorService executorService) {
|
||||
this.executorService = executorService;
|
||||
}
|
||||
|
||||
|
||||
public List<MtbTCol> retrieveTipiColloSyncronized(MtbTCol.FlagUiUlEnum tipoImballo) throws Exception {
|
||||
ImballiRESTConsumerService service = RESTBuilder.getService(ImballiRESTConsumerService.class);
|
||||
Response<ServiceRESTResponse<List<MtbTCol>>> response = service.retrieveTipiCollo(tipoImballo)
|
||||
.execute();
|
||||
|
||||
return analyzeAnswer(response, "retrieveTipiCollo");
|
||||
}
|
||||
|
||||
public void retrieveTipiCollo(MtbTCol.FlagUiUlEnum tipoImballo, RunnableArgs<List<MtbTCol>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
var response = retrieveTipiColloSyncronized(tipoImballo);
|
||||
if (onComplete != null) onComplete.run(response);
|
||||
} catch (Exception ex) {
|
||||
if (onFailed != null) onFailed.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void registraCaricoSyncronized(String codAnag, List<ImballoQuantityDTO> imballi) throws Exception {
|
||||
ImballiRESTConsumerService service = RESTBuilder.getService(ImballiRESTConsumerService.class);
|
||||
Response<ServiceRESTResponse<Void>> response = service.registraCarico(
|
||||
new RegistraCaricoImballiRequestDTO()
|
||||
.setCodAnag(codAnag)
|
||||
.setUsedImballi(imballi))
|
||||
.execute();
|
||||
|
||||
analyzeAnswer(response, "registraCarico");
|
||||
}
|
||||
|
||||
public void registraCarico(String codAnag, List<ImballoQuantityDTO> imballi, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
registraCaricoSyncronized(codAnag, imballi);
|
||||
if (onComplete != null) onComplete.run();
|
||||
} catch (Exception ex) {
|
||||
if (onFailed != null) onFailed.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void registraScaricoSyncronized(String codVettore, List<ImballoQuantityDTO> imballi) throws Exception {
|
||||
ImballiRESTConsumerService service = RESTBuilder.getService(ImballiRESTConsumerService.class);
|
||||
Response<ServiceRESTResponse<Void>> response = service.registraScarico(
|
||||
new RegistraScaricoImballiRequestDTO()
|
||||
.setCodVettore(codVettore)
|
||||
.setUsedImballi(imballi))
|
||||
.execute();
|
||||
|
||||
analyzeAnswer(response, "registraScarico");
|
||||
}
|
||||
|
||||
public void registraScarico(String idVettore, List<ImballoQuantityDTO> imballi, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
registraScaricoSyncronized(idVettore, imballi);
|
||||
if (onComplete != null) onComplete.run();
|
||||
} catch (Exception ex) {
|
||||
if (onFailed != null) onFailed.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.imballi.RegistraCaricoImballiRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.imballi.RegistraScaricoImballiRequestDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Path;
|
||||
|
||||
public interface ImballiRESTConsumerService {
|
||||
|
||||
|
||||
@GET("wms/imballi/retrieve/{tipo}")
|
||||
Call<ServiceRESTResponse<List<MtbTCol>>> retrieveTipiCollo(@Path("tipo") MtbTCol.FlagUiUlEnum tipo);
|
||||
|
||||
@POST("wms/imballi/registraCarico")
|
||||
Call<ServiceRESTResponse<Void>> registraCarico(@Body RegistraCaricoImballiRequestDTO registraCaricoImballiRequest);
|
||||
|
||||
@POST("wms/imballi/registraScarico")
|
||||
Call<ServiceRESTResponse<Void>> registraScarico(@Body RegistraScaricoImballiRequestDTO registraScaricoImballiRequest);
|
||||
|
||||
}
|
||||
@@ -1,16 +1,11 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.DtbOrdt;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.SaveDTO;
|
||||
@@ -21,56 +16,14 @@ import retrofit2.Response;
|
||||
@Singleton
|
||||
public class MagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final ExecutorService executorService;
|
||||
private final SystemRESTConsumer mSystemRESTConsumer;
|
||||
|
||||
public MagazzinoRESTConsumer(SystemRESTConsumer mSystemRESTConsumer) {
|
||||
public MagazzinoRESTConsumer(ExecutorService executorService, SystemRESTConsumer mSystemRESTConsumer) {
|
||||
this.executorService = executorService;
|
||||
this.mSystemRESTConsumer = mSystemRESTConsumer;
|
||||
}
|
||||
|
||||
|
||||
public void getTipiCollo(RunnableArgs<List<MtbTCol>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
String baseSql = "SELECT * " +
|
||||
"FROM mtb_tcol ";
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbTCol>>() {
|
||||
}.getType();
|
||||
|
||||
mSystemRESTConsumer.<ArrayList<MtbTCol>>processSql(baseSql, typeOfObjectsList, values -> {
|
||||
if (onComplete != null) {
|
||||
onComplete.run(values);
|
||||
}
|
||||
}, ex -> {
|
||||
if (onFailed != null) onFailed.run(ex);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void saveOrdine(SaveDTO saveDTO, RunnableArgs<DtbOrdt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MagazzinoRESTConsumerService service = RESTBuilder.getService(MagazzinoRESTConsumerService.class, 240);
|
||||
service.saveOrdine(saveDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<List<ServiceRESTResponse<DtbOrdt>>> call, Response<List<ServiceRESTResponse<DtbOrdt>>> response) {
|
||||
if (response.body() != null && response.body().size() > 0) {
|
||||
analyzeListOfAnswers(response, "saveOrdine", dtoList -> {
|
||||
if (dtoList.size() > 0) {
|
||||
onComplete.run(dtoList.get(0));
|
||||
} else {
|
||||
onFailed.run(new Exception("Nessun ordine generato"));
|
||||
}
|
||||
}, onFailed);
|
||||
} else {
|
||||
onFailed.run(new Exception("Nessun ordine generato"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<List<ServiceRESTResponse<DtbOrdt>>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void saveTerminalinoWMS(SaveDTO saveDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MagazzinoRESTConsumerService service = RESTBuilder.getService(MagazzinoRESTConsumerService.class);
|
||||
service.saveTerminalinoWMS(saveDTO)
|
||||
@@ -86,4 +39,24 @@ public class MagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public MtbPartitaMag retrievePartitaMagSyncronized(String partitaMag, String codMart) throws Exception {
|
||||
MagazzinoRESTConsumerService service = RESTBuilder.getService(MagazzinoRESTConsumerService.class);
|
||||
Response<ServiceRESTResponse<MtbPartitaMag>> response = service.retrievePartitaMag(codMart, partitaMag)
|
||||
.execute();
|
||||
|
||||
return analyzeAnswer(response, "retrievePartitaMag");
|
||||
}
|
||||
|
||||
public void retrievePartitaMag(String partitaMag, String codMart, RunnableArgs<MtbPartitaMag> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
var response = retrievePartitaMagSyncronized(partitaMag, codMart);
|
||||
if (onComplete != null) onComplete.run(response);
|
||||
} catch (Exception ex) {
|
||||
if (onFailed != null) onFailed.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,19 +2,26 @@ 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.model.MtbTCol;
|
||||
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.Path;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface MagazzinoRESTConsumerService {
|
||||
|
||||
@POST("SM2SaveTerminalinoWMS")
|
||||
Call<ServiceRESTResponse<Void>> saveTerminalinoWMS(@Body SaveDTO saveDTO);
|
||||
|
||||
@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);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.VtbVett;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import retrofit2.Response;
|
||||
|
||||
@Singleton
|
||||
public class VettoriRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final ExecutorService executorService;
|
||||
|
||||
public VettoriRESTConsumer(ExecutorService executorService) {
|
||||
this.executorService = executorService;
|
||||
}
|
||||
|
||||
|
||||
public List<VtbVett> retrieveRecentlyUsedInOrdersSyncronized(GestioneEnum gestione) throws Exception {
|
||||
var service = RESTBuilder.getService(VettoriRESTConsumerService.class);
|
||||
Response<ServiceRESTResponse<List<VtbVett>>> response = service.retrieveRecentlyUsedInOrders(gestione)
|
||||
.execute();
|
||||
|
||||
return analyzeAnswer(response, "retrieveRecentlyUsedInOrders");
|
||||
}
|
||||
|
||||
public void retrieveRecentlyUsedInOrders(GestioneEnum gestione, RunnableArgs<List<VtbVett>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
var response = retrieveRecentlyUsedInOrdersSyncronized(gestione);
|
||||
if (onComplete != null) onComplete.run(response);
|
||||
} catch (Exception ex) {
|
||||
if (onFailed != null) onFailed.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.VtbVett;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface VettoriRESTConsumerService {
|
||||
|
||||
@GET("wms/vettore/recentlyUsedInOrders")
|
||||
Call<ServiceRESTResponse<List<VtbVett>>> retrieveRecentlyUsedInOrders(@Query("gestione") GestioneEnum gestioneEnum);
|
||||
|
||||
}
|
||||
@@ -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,23 @@
|
||||
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.MtbTCol;
|
||||
|
||||
public class MtbTcolFlagUiUlDeserializer implements JsonDeserializer<MtbTCol.FlagUiUlEnum> {
|
||||
@Override
|
||||
public MtbTCol.FlagUiUlEnum deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||
if (json.isJsonNull()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String text = json.getAsString();
|
||||
return MtbTCol.FlagUiUlEnum.fromString(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,13 +328,13 @@ public class Ean128Model {
|
||||
public String InternalPart;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal1; //USED FOR COD_MART
|
||||
public String Internal1; //Cod-Mart
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal2;
|
||||
public String Internal2; //IDLotto
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal3;
|
||||
public String Internal3; //Cod-Jfas
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal4;
|
||||
@@ -338,5 +353,4 @@ public class Ean128Model {
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal9;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.imballi;
|
||||
|
||||
public class ImballoQuantityDTO {
|
||||
|
||||
private String codMart;
|
||||
private Integer qta;
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public ImballoQuantityDTO setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getQta() {
|
||||
return qta;
|
||||
}
|
||||
|
||||
public ImballoQuantityDTO setQta(Integer qta) {
|
||||
this.qta = qta;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.imballi;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RegistraCaricoImballiRequestDTO {
|
||||
|
||||
private String codAnag;
|
||||
private List<ImballoQuantityDTO> usedImballi;
|
||||
|
||||
public String getCodAnag() {
|
||||
return codAnag;
|
||||
}
|
||||
|
||||
public RegistraCaricoImballiRequestDTO setCodAnag(String codAnag) {
|
||||
this.codAnag = codAnag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<ImballoQuantityDTO> getUsedImballi() {
|
||||
return usedImballi;
|
||||
}
|
||||
|
||||
public RegistraCaricoImballiRequestDTO setUsedImballi(List<ImballoQuantityDTO> usedImballi) {
|
||||
this.usedImballi = usedImballi;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.imballi;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RegistraScaricoImballiRequestDTO {
|
||||
|
||||
private String codVettore;
|
||||
private List<ImballoQuantityDTO> usedImballi;
|
||||
|
||||
public String getCodVettore() {
|
||||
return codVettore;
|
||||
}
|
||||
|
||||
public RegistraScaricoImballiRequestDTO setCodVettore(String codVettore) {
|
||||
this.codVettore = codVettore;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<ImballoQuantityDTO> getUsedImballi() {
|
||||
return usedImballi;
|
||||
}
|
||||
|
||||
public RegistraScaricoImballiRequestDTO setUsedImballi(List<ImballoQuantityDTO> usedImballi) {
|
||||
this.usedImballi = usedImballi;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ public class CreateUDSRequestDTO {
|
||||
private String codAnag;
|
||||
private String codVdes;
|
||||
private String rifOrd;
|
||||
private Integer idLotto;
|
||||
private boolean orderRequired;
|
||||
private List<CreateUDSRequestOrderDTO> orders;
|
||||
|
||||
@@ -125,6 +126,14 @@ public class CreateUDSRequestDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getIdLotto() {
|
||||
return idLotto;
|
||||
}
|
||||
|
||||
public CreateUDSRequestDTO setIdLotto(Integer idLotto) {
|
||||
this.idLotto = idLotto;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public static class Causale {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
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 it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
|
||||
public class MtbTcolFlagUiUlSerializer implements JsonSerializer<MtbTCol.FlagUiUlEnum> {
|
||||
@Override
|
||||
public JsonElement serialize(MtbTCol.FlagUiUlEnum 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;
|
||||
@@ -62,15 +60,24 @@ 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 flagAllowULRecoverAccettazioneBolla = true;
|
||||
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;
|
||||
|
||||
private boolean flagTracciamentoImballiCaricoEnabled = false;
|
||||
private boolean flagTracciamentoImballiScaricoEnabled = false;
|
||||
|
||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||
return flagSpedizioneEnableFakeGiacenza;
|
||||
@@ -487,84 +494,84 @@ 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 isFlagAllowULRecoverAccettazioneBolla() {
|
||||
return flagAllowULRecoverAccettazioneBolla;
|
||||
public boolean isFlagAccettazioneBollaAllowULRecover() {
|
||||
return flagAccettazioneBollaAllowULRecover;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAllowULRecoverAccettazioneBolla(boolean flagAllowULRecoverAccettazioneBolla) {
|
||||
this.flagAllowULRecoverAccettazioneBolla = flagAllowULRecoverAccettazioneBolla;
|
||||
public DBSettingsModel setFlagAccettazioneBollaAllowULRecover(boolean flagAccettazioneBollaAllowULRecover) {
|
||||
this.flagAccettazioneBollaAllowULRecover = flagAccettazioneBollaAllowULRecover;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagOverflowQuantityWarning() {
|
||||
return flagOverflowQuantityWarning;
|
||||
public boolean isFlagSpedizioneOverflowQuantityWarning() {
|
||||
return flagSpedizioneOverflowQuantityWarning;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagOverflowQuantityWarning(boolean flagOverflowQuantityWarning) {
|
||||
this.flagOverflowQuantityWarning = flagOverflowQuantityWarning;
|
||||
public DBSettingsModel setFlagSpedizioneOverflowQuantityWarning(boolean flagSpedizioneOverflowQuantityWarning) {
|
||||
this.flagSpedizioneOverflowQuantityWarning = flagSpedizioneOverflowQuantityWarning;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -576,4 +583,75 @@ public class DBSettingsModel {
|
||||
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;
|
||||
}
|
||||
|
||||
public boolean isFlagTracciamentoImballiCaricoEnabled() {
|
||||
return flagTracciamentoImballiCaricoEnabled;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagTracciamentoImballiCaricoEnabled(boolean flagTracciamentoImballiCaricoEnabled) {
|
||||
this.flagTracciamentoImballiCaricoEnabled = flagTracciamentoImballiCaricoEnabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagTracciamentoImballiScaricoEnabled() {
|
||||
return flagTracciamentoImballiScaricoEnabled;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagTracciamentoImballiScaricoEnabled(boolean flagTracciamentoImballiScaricoEnabled) {
|
||||
this.flagTracciamentoImballiScaricoEnabled = flagTracciamentoImballiScaricoEnabled;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityFirebase;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
|
||||
@Singleton
|
||||
public class SettingsManager {
|
||||
@@ -242,6 +243,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")
|
||||
@@ -278,6 +284,17 @@ public class SettingsManager {
|
||||
.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")
|
||||
@@ -433,56 +450,90 @@ 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::setFlagAllowULRecoverAccettazioneBolla)
|
||||
.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));
|
||||
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("IMBALLI")
|
||||
.setKeySection("COD_DTIP_CARICO")
|
||||
.setSetter(data -> {
|
||||
dbSettingsModelIstance.setFlagTracciamentoImballiCaricoEnabled(!UtilityString.isNullOrEmpty(data));
|
||||
}));
|
||||
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("IMBALLI")
|
||||
.setKeySection("COD_DTIP_SCARICO")
|
||||
.setSetter(data -> {
|
||||
dbSettingsModelIstance.setFlagTracciamentoImballiScaricoEnabled(!UtilityString.isNullOrEmpty(data));
|
||||
}));
|
||||
|
||||
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) {
|
||||
|
||||
@@ -7,12 +7,15 @@ import java.lang.reflect.Modifier;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
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.MtbTcolFlagUiUlDeserializer;
|
||||
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.MtbTcolFlagUiUlSerializer;
|
||||
import it.integry.integrywmsnative.core.rest.serializer.StatoPartitaMagSerializer;
|
||||
|
||||
public class UtilityGson {
|
||||
@@ -27,6 +30,8 @@ public class UtilityGson {
|
||||
.registerTypeAdapter(LocalDateTime.class, new LocalDateTimeSerializer())
|
||||
.registerTypeAdapter(StatoPartitaMag.class, new StatoPartitaMagDeserializer())
|
||||
.registerTypeAdapter(StatoPartitaMag.class, new StatoPartitaMagSerializer())
|
||||
.registerTypeAdapter(MtbTCol.FlagUiUlEnum.class, new MtbTcolFlagUiUlDeserializer())
|
||||
.registerTypeAdapter(MtbTCol.FlagUiUlEnum.class, new MtbTcolFlagUiUlSerializer())
|
||||
.create();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ import android.text.Spanned;
|
||||
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -13,9 +15,101 @@ import java.util.regex.Pattern;
|
||||
*/
|
||||
|
||||
public class UtilityString {
|
||||
private static final Map<String, String> DATE_FORMAT_REGEXPS = new HashMap<String, String>() {{
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//giorno-mese-giorno
|
||||
put("^\\d{1,2}/\\d{1,2}/\\d{4}$", "dd/MM/yyyy");
|
||||
put("^\\d{1,2}\\.\\d{1,2}\\.\\d{4}$", "dd.MM.yyyy");
|
||||
put("^\\d{1,2}-\\d{1,2}-\\d{4}$", "dd-MM-yyyy");
|
||||
|
||||
//anno-mese-giorno
|
||||
put("^\\d{4}/\\d{1,2}/\\d{1,2}$", "yyyy/MM/dd");
|
||||
put("^\\d{4}\\.\\d{1,2}\\.\\d{1,2}$", "yyyy.MM.dd");
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}$", "yyyy-MM-dd");
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//senza spazi
|
||||
put("^\\d{8}$", "yyyyMMdd");
|
||||
put("^\\d{1,2}\\s[a-z]{3}\\s\\d{4}$", "dd MMM yyyy");
|
||||
put("^\\d{1,2}\\s[a-z]{4,}\\s\\d{4}$", "dd MMMM yyyy");
|
||||
|
||||
put("^\\d{12}$", "yyyyMMddHHmm");
|
||||
put("^\\d{8}\\s\\d{4}$", "yyyyMMdd HHmm");
|
||||
|
||||
put("^\\d{14}$", "yyyyMMddHHmmss");
|
||||
put("^\\d{8}\\s\\d{6}$", "yyyyMMdd HHmmss");
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//giorno-mese-anno hhmm
|
||||
put("^\\d{1,2}/\\d{1,2}/\\d{4}\\s\\d{1,2}\\.\\d{2}$", "dd/MM/yyyy HH.mm");
|
||||
put("^\\d{1,2}/\\d{1,2}/\\d{4}\\s\\d{1,2}:\\d{2}$", "dd/MM/yyyy HH:mm");
|
||||
|
||||
put("^\\d{1,2}\\.\\d{1,2}\\.\\d{4}\\s\\d{1,2}\\.\\d{2}$", "dd.MM.yyyy HH.mm");
|
||||
put("^\\d{1,2}\\.\\d{1,2}\\.\\d{4}\\s\\d{1,2}:\\d{2}$", "dd.MM.yyyy HH:mm");
|
||||
|
||||
put("^\\d{1,2}-\\d{1,2}-\\d{4}\\s\\d{1,2}\\.\\d{2}$", "dd-MM-yyyy HH.mm");
|
||||
put("^\\d{1,2}-\\d{1,2}-\\d{4}\\s\\d{1,2}:\\d{2}$", "dd-MM-yyyy HH:mm");
|
||||
|
||||
//anno-mese-giorno hhmm
|
||||
put("^\\d{4}/\\d{1,2}/\\d{1,2}\\s\\d{1,2}\\.\\d{2}$", "yyyy/MM/dd HH.mm");
|
||||
put("^\\d{4}/\\d{1,2}/\\d{1,2}\\s\\d{1,2}:\\d{2}$", "yyyy/MM/dd HH:mm");
|
||||
|
||||
put("^\\d{4}\\.\\d{1,2}\\.\\d{1,2}\\s\\d{1,2}\\.\\d{2}$", "yyyy.MM.dd HH.mm");
|
||||
put("^\\d{4}\\.\\d{1,2}\\.\\d{1,2}\\s\\d{1,2}:\\d{2}$", "yyyy.MM.dd HH:mm");
|
||||
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{1,2}\\.\\d{2}$", "yyyy-MM-dd HH.mm");
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{1,2}:\\d{2}$", "yyyy-MM-dd HH:mm");
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//giorno-mese-anno hhmmss
|
||||
put("^\\d{1,2}/\\d{1,2}/\\d{4}\\s\\d{1,2}\\.\\d{2}\\.\\d{2}$", "dd/MM/yyyy HH.mm.ss");
|
||||
put("^\\d{1,2}/\\d{1,2}/\\d{4}\\s\\d{1,2}:\\d{2}:\\d{2}$", "dd/MM/yyyy HH:mm:ss");
|
||||
|
||||
put("^\\d{1,2}\\.\\d{1,2}\\.\\d{4}\\s\\d{1,2}\\.\\d{2}\\.\\d{2}$", "dd.MM.yyyy HH.mm.ss");
|
||||
put("^\\d{1,2}\\.\\d{1,2}\\.\\d{4}\\s\\d{1,2}:\\d{2}:\\d{2}$", "dd.MM.yyyy HH:mm:ss");
|
||||
|
||||
put("^\\d{1,2}-\\d{1,2}-\\d{4}\\s\\d{1,2}\\.\\d{2}\\.\\d{2}$", "dd-MM-yyyy HH.mm.ss");
|
||||
put("^\\d{1,2}-\\d{1,2}-\\d{4}\\s\\d{1,2}:\\d{2}:\\d{2}$", "dd-MM-yyyy HH:mm:ss");
|
||||
|
||||
//anno-mese-giorno hhmmss
|
||||
put("^\\d{4}/\\d{1,2}/\\d{1,2}\\s\\d{1,2}\\.\\d{2}\\.\\d{2}$", "yyyy/MM/dd HH.mm.ss");
|
||||
put("^\\d{4}/\\d{1,2}/\\d{1,2}\\s\\d{1,2}:\\d{2}:\\d{2}$", "yyyy/MM/dd HH:mm:ss");
|
||||
|
||||
put("^\\d{4}\\.\\d{1,2}\\.\\d{1,2}\\s\\d{1,2}\\.\\d{2}\\.\\d{2}$", "yyyy.MM.dd HH.mm.ss");
|
||||
put("^\\d{4}\\.\\d{1,2}\\.\\d{1,2}\\s\\d{1,2}:\\d{2}:\\d{2}$", "yyyy.MM.dd HH:mm:ss");
|
||||
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{1,2}\\.\\d{2}\\.\\d{2}$", "yyyy-MM-dd HH.mm.ss");
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{1,2}:\\d{2}:\\d{2}$", "yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
//anno-mese-giorno hhmmssS
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{1,2}:\\d{2}:\\d{2}.\\d{1,3}$", "yyyy-MM-dd HH:mm:ss.SSS");
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
//altri formati
|
||||
put("^\\d{1,2}\\s[a-z]{3}\\s\\d{4}\\s\\d{1,2}:\\d{2}:\\d{2}$", "dd MMM yyyy HH:mm:ss");
|
||||
put("^\\d{1,2}\\s[a-z]{4,}\\s\\d{4}\\s\\d{1,2}:\\d{2}:\\d{2}$", "dd MMMM yyyy HH:mm:ss");
|
||||
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}[T]\\d{1,2}:\\d{2}:\\d{2}$", "yyyy-MM-ddTHH:mm:ss");
|
||||
|
||||
put("^\\d{4}-\\d{1,2}-\\d{1,2}t\\d{1,2}:\\d{2}:\\d{2}.\\d{1,3}z$", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
|
||||
put("^(\\d{4})-(\\d{2})-(\\d{2})t(\\d{2}):(\\d{2}):(\\d{2})((\\+|-)(\\d{2}):(\\d{2}))$", "yyyy-MM-dd'T'HH:mm:ss");
|
||||
}};
|
||||
|
||||
public static String determineDateFormat(String dateString) {
|
||||
for (String regexp : DATE_FORMAT_REGEXPS.keySet()) {
|
||||
if (dateString.toLowerCase().matches(regexp)) {
|
||||
return DATE_FORMAT_REGEXPS.get(regexp);
|
||||
}
|
||||
}
|
||||
return null; // Unknown format.
|
||||
}
|
||||
|
||||
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 +117,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){
|
||||
|
||||
@@ -153,7 +153,7 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
// this.initFilters();
|
||||
this.initFab();
|
||||
|
||||
boolean useQtaBolla = SettingsManager.iDB().isFlagAccettazioneUseQtaOrd();
|
||||
boolean useQtaBolla = SettingsManager.iDB().isFlagAccettazioneBollaUseQtaOrd();
|
||||
|
||||
mViewModel.setListeners(this);
|
||||
mViewModel.init(
|
||||
@@ -221,7 +221,7 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
|
||||
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().isFlagAllowULRecoverAccettazioneBolla());
|
||||
fabPopupMenu.getMenu().findItem(R.id.show_created_ul).setVisible(SettingsManager.iDB().isFlagAccettazioneBollaAllowULRecover());
|
||||
|
||||
fabPopupMenu.setOnMenuItemClickListener(item -> {
|
||||
int itemId = item.getItemId();
|
||||
@@ -526,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));
|
||||
|
||||
@@ -78,6 +78,7 @@ import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
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.tracciamento_imballi.DialogTracciamentoImballiView;
|
||||
import it.integry.integrywmsnative.view.dialogs.versamento_automatico_ul_done.DialogVersamentoAutomaticoULDoneView;
|
||||
|
||||
public class AccettazioneOrdiniPickingActivity extends BaseActivity implements AccettazioneOrdiniPickingViewModel.Listener, BottomSheetFragmentLUContentViewModel.Listener, BottomSheetFragmentLUContentView.Listener {
|
||||
@@ -151,28 +152,30 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
boolean useQtaOrd = SettingsManager.iDB().isFlagAccettazioneUseQtaOrd();
|
||||
|
||||
mViewModel.setListeners(this);
|
||||
mViewModel.init(
|
||||
mOrders,
|
||||
mSitArts,
|
||||
useQtaOrd);
|
||||
mViewModel.init(mOrders, mSitArts, 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 = 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());
|
||||
|
||||
if (!SettingsManager.iDB().isFlagTracciamentoImballiCaricoEnabled())
|
||||
fabPopupMenu.getMenu().removeItem(R.id.track_packaging);
|
||||
|
||||
fabPopupMenu.setOnMenuItemClickListener(item -> {
|
||||
int itemId = item.getItemId();
|
||||
|
||||
if (itemId == R.id.show_created_ul) {
|
||||
showCreatedUL();
|
||||
return true;
|
||||
} else if (itemId == R.id.track_packaging) {
|
||||
trackPackaging();
|
||||
return true;
|
||||
} else if (itemId == R.id.create_ul) {
|
||||
createNewLU();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -192,17 +195,11 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
mAppliedFilterViewModel.getCurrentDescrPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
mAppliedFilterViewModel.getCurrentPosPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
|
||||
List<FilterChipDTO> filterList = Stream.of(AccettazioneOrdiniPickingBindings.AVAILABLE_FILTERS.entrySet())
|
||||
.map(Map.Entry::getValue)
|
||||
.sortBy(FilterChipDTO::getPosizione)
|
||||
.toList();
|
||||
List<FilterChipDTO> filterList = Stream.of(AccettazioneOrdiniPickingBindings.AVAILABLE_FILTERS.entrySet()).map(Map.Entry::getValue).sortBy(FilterChipDTO::getPosizione).toList();
|
||||
|
||||
for (FilterChipDTO filterChipDTO : filterList) {
|
||||
|
||||
FilterChipView filterChipView = new FilterChipView(
|
||||
this,
|
||||
filterChipDTO.getFilterChipText(),
|
||||
v -> initBottomSheetDialogFilter(filterChipDTO));
|
||||
FilterChipView filterChipView = new FilterChipView(this, filterChipDTO.getFilterChipText(), v -> initBottomSheetDialogFilter(filterChipDTO));
|
||||
|
||||
switch (filterChipDTO.getID()) {
|
||||
case AccettazioneOrdiniPickingBindings.COD_ART_FILTER_ID -> {
|
||||
@@ -280,52 +277,20 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
|
||||
private void initBottomSheetDialogFilter(FilterChipDTO filterChipDTO) {
|
||||
|
||||
filterChipDTO
|
||||
.getFilterLayoutView()
|
||||
.setFilterName(filterChipDTO.getFilterChipText())
|
||||
.setContext(this);
|
||||
filterChipDTO.getFilterLayoutView().setFilterName(filterChipDTO.getFilterChipText()).setContext(this);
|
||||
|
||||
var filterLayoutView = filterChipDTO
|
||||
.getFilterLayoutView();
|
||||
var filterLayoutView = filterChipDTO.getFilterLayoutView();
|
||||
|
||||
switch (filterChipDTO.getID()) {
|
||||
case AccettazioneOrdiniPickingBindings.COD_ART_FILTER_ID ->
|
||||
((FilterCodArtLayoutView) filterLayoutView)
|
||||
.setAll(mAppliedFilterViewModel.getAllCodArts())
|
||||
.setAvailable(mAppliedFilterViewModel.getAvailableCodArts())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setCodArtFilter)
|
||||
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentCodArtPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentCodArtPredicate().get())
|
||||
.map(x -> x.getSitArtOrdDTO().getCodMart())
|
||||
.toList());
|
||||
((FilterCodArtLayoutView) filterLayoutView).setAll(mAppliedFilterViewModel.getAllCodArts()).setAvailable(mAppliedFilterViewModel.getAvailableCodArts()).setOnFilterApplied(mAppliedFilterViewModel::setCodArtFilter).setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue())).filter(mAppliedFilterViewModel.getCurrentCodArtPredicate().get() == null ? x -> false : mAppliedFilterViewModel.getCurrentCodArtPredicate().get()).map(x -> x.getSitArtOrdDTO().getCodMart()).toList());
|
||||
case AccettazioneOrdiniPickingBindings.DESCR_FILTER_ID ->
|
||||
((FilterDescrLayoutView) filterLayoutView)
|
||||
.setAll(mAppliedFilterViewModel.getAllDescrs())
|
||||
.setAvailable(mAppliedFilterViewModel.getAvailableDescrs())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setDescrFilter)
|
||||
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentDescrPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentDescrPredicate().get())
|
||||
.map(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt())
|
||||
.toList());
|
||||
((FilterDescrLayoutView) filterLayoutView).setAll(mAppliedFilterViewModel.getAllDescrs()).setAvailable(mAppliedFilterViewModel.getAvailableDescrs()).setOnFilterApplied(mAppliedFilterViewModel::setDescrFilter).setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue())).filter(mAppliedFilterViewModel.getCurrentDescrPredicate().get() == null ? x -> false : mAppliedFilterViewModel.getCurrentDescrPredicate().get()).map(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt()).toList());
|
||||
case AccettazioneOrdiniPickingBindings.POS_FILTER_ID ->
|
||||
((FilterPosizioneLayoutView) filterLayoutView)
|
||||
.setAll(mAppliedFilterViewModel.getAllPos())
|
||||
.setAvailable(mAppliedFilterViewModel.getAvailablePos())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setPosFilter)
|
||||
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentPosPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentPosPredicate().get())
|
||||
.map(x -> x.getMtbAart().getPosizione())
|
||||
.toList());
|
||||
((FilterPosizioneLayoutView) filterLayoutView).setAll(mAppliedFilterViewModel.getAllPos()).setAvailable(mAppliedFilterViewModel.getAvailablePos()).setOnFilterApplied(mAppliedFilterViewModel::setPosFilter).setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue())).filter(mAppliedFilterViewModel.getCurrentPosPredicate().get() == null ? x -> false : mAppliedFilterViewModel.getCurrentPosPredicate().get()).map(x -> x.getMtbAart().getPosizione()).toList());
|
||||
}
|
||||
|
||||
if (!filterLayoutView.isAdded())
|
||||
filterLayoutView.show(getSupportFragmentManager(), "TAG");
|
||||
if (!filterLayoutView.isAdded()) filterLayoutView.show(getSupportFragmentManager(), "TAG");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -374,9 +339,7 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
}
|
||||
|
||||
private void initBarcodeReader() {
|
||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessful(onScanSuccessful)
|
||||
.setOnScanFailed(ex -> UtilityExceptions.defaultException(this, ex, false)));
|
||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO().setOnScanSuccessful(onScanSuccessful).setOnScanFailed(ex -> UtilityExceptions.defaultException(this, ex, false)));
|
||||
}
|
||||
|
||||
private void initRecyclerView() {
|
||||
@@ -417,9 +380,7 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
}
|
||||
|
||||
private List<AccettazioneOrdiniPickingListModel> convertDataModelToListModel(List<PickingObjectDTO> dataList) {
|
||||
List<PickingObjectDTO> tmpList = Stream.of(dataList)
|
||||
.filter(x -> !x.isHidden() && UtilityBigDecimal.greaterThan(x.getSitArtOrdDTO().getQtaDaEvadere(), BigDecimal.ZERO))
|
||||
.toList();
|
||||
List<PickingObjectDTO> tmpList = Stream.of(dataList).filter(x -> !x.isHidden() && UtilityBigDecimal.greaterThan(x.getSitArtOrdDTO().getQtaDaEvadere(), BigDecimal.ZERO)).toList();
|
||||
|
||||
return switch (mCurrentOrderBy) {
|
||||
case COD_ART_FOR -> convertDataModelToListModel__CodArtForn(tmpList);
|
||||
@@ -430,133 +391,118 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
|
||||
private List<AccettazioneOrdiniPickingListModel> convertDataModelToListModel__CodArtForn(List<PickingObjectDTO> dataList) {
|
||||
ArrayList<AccettazioneOrdiniPickingListModel> list = new ArrayList<>();
|
||||
Stream.of(dataList)
|
||||
.sortBy(x -> UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()) +
|
||||
(UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()))
|
||||
.forEach(x -> {
|
||||
AccettazioneOrdiniPickingListModel accettazioneOrdiniPickingListModel = new AccettazioneOrdiniPickingListModel();
|
||||
accettazioneOrdiniPickingListModel.setActive(true);
|
||||
Stream.of(dataList).sortBy(x -> UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()) + (UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa())).forEach(x -> {
|
||||
AccettazioneOrdiniPickingListModel accettazioneOrdiniPickingListModel = new AccettazioneOrdiniPickingListModel();
|
||||
accettazioneOrdiniPickingListModel.setActive(true);
|
||||
|
||||
accettazioneOrdiniPickingListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()) +
|
||||
(UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()));
|
||||
accettazioneOrdiniPickingListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()) + (UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSubDescrizione1("Consegna: " + UtilityDate.formatDate(x.getSitArtOrdDTO().getDataCons(), UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH));
|
||||
accettazioneOrdiniPickingListModel.setSubDescrizione1("Consegna: " + UtilityDate.formatDate(x.getSitArtOrdDTO().getDataCons(), UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||
|
||||
//Calc Num CNF
|
||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||
//Calc Num CNF
|
||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||
|
||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||
.map(MtbColr::getNumCnf)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getNumCnf).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
|
||||
//Calc qta col
|
||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||
//Calc qta col
|
||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||
|
||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||
qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||
.map(MtbColr::getQtaCol)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||
qtaEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getQtaCol).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
|
||||
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||
} else {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||
} else {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
|
||||
accettazioneOrdiniPickingListModel.setOriginalModel(x);
|
||||
accettazioneOrdiniPickingListModel.setOriginalModel(x);
|
||||
|
||||
list.add(accettazioneOrdiniPickingListModel);
|
||||
});
|
||||
list.add(accettazioneOrdiniPickingListModel);
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private List<AccettazioneOrdiniPickingListModel> convertDataModelToListModel__DescrArt(List<PickingObjectDTO> dataList) {
|
||||
ArrayList<AccettazioneOrdiniPickingListModel> list = new ArrayList<>();
|
||||
Stream.of(dataList)
|
||||
.sortBy(x -> x.getMtbAart().getDescrizioneEstesa())
|
||||
.forEach(x -> {
|
||||
AccettazioneOrdiniPickingListModel accettazioneOrdiniPickingListModel = new AccettazioneOrdiniPickingListModel();
|
||||
accettazioneOrdiniPickingListModel.setActive(true);
|
||||
Stream.of(dataList).sortBy(x -> x.getMtbAart().getDescrizioneEstesa()).forEach(x -> {
|
||||
AccettazioneOrdiniPickingListModel accettazioneOrdiniPickingListModel = new AccettazioneOrdiniPickingListModel();
|
||||
accettazioneOrdiniPickingListModel.setActive(true);
|
||||
|
||||
accettazioneOrdiniPickingListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart())
|
||||
+ (UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()));
|
||||
accettazioneOrdiniPickingListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()) + (UtilityString.isNullOrEmpty(x.getMtbAart().getDescrizioneEstesa()) ? "" : " - " + x.getMtbAart().getDescrizioneEstesa()));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneCommessa());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||
|
||||
//Calc Num CNF
|
||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||
//Calc Num CNF
|
||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||
|
||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||
.map(MtbColr::getNumCnf)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getNumCnf).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
|
||||
//Calc qta col
|
||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||
//Calc qta col
|
||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||
|
||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||
qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||
.map(MtbColr::getQtaCol)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||
qtaEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getQtaCol).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
|
||||
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||
} else {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||
} else {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
|
||||
accettazioneOrdiniPickingListModel.setOriginalModel(x);
|
||||
accettazioneOrdiniPickingListModel.setOriginalModel(x);
|
||||
|
||||
list.add(accettazioneOrdiniPickingListModel);
|
||||
});
|
||||
list.add(accettazioneOrdiniPickingListModel);
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
@@ -564,136 +510,122 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
private List<AccettazioneOrdiniPickingListModel> convertDataModelToListModel__RagSocCom(List<PickingObjectDTO> dataList) {
|
||||
ArrayList<AccettazioneOrdiniPickingListModel> list = new ArrayList<>();
|
||||
|
||||
Stream.of(dataList)
|
||||
.filter(x -> !UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getDescrizioneCommessa()) && !x.getSitArtOrdDTO().getCodJcom().equalsIgnoreCase(CommonConst.Config.COMMESSA_MAG))
|
||||
.sortBy(x -> x.getSitArtOrdDTO().getDescrizioneCommessa())
|
||||
.forEach(x -> {
|
||||
AccettazioneOrdiniPickingListModel accettazioneOrdiniPickingListModel = new AccettazioneOrdiniPickingListModel();
|
||||
accettazioneOrdiniPickingListModel.setActive(true);
|
||||
Stream.of(dataList).filter(x -> !UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getDescrizioneCommessa()) && !x.getSitArtOrdDTO().getCodJcom().equalsIgnoreCase(CommonConst.Config.COMMESSA_MAG)).sortBy(x -> x.getSitArtOrdDTO().getDescrizioneCommessa()).forEach(x -> {
|
||||
AccettazioneOrdiniPickingListModel accettazioneOrdiniPickingListModel = new AccettazioneOrdiniPickingListModel();
|
||||
accettazioneOrdiniPickingListModel.setActive(true);
|
||||
|
||||
accettazioneOrdiniPickingListModel.setGroupTitle(x.getSitArtOrdDTO().getCodJcom() + (!UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getDescrizioneCommessa()) ? " - " + x.getSitArtOrdDTO().getDescrizioneCommessa() : ""));
|
||||
accettazioneOrdiniPickingListModel.setGroupTitle(x.getSitArtOrdDTO().getCodJcom() + (!UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getDescrizioneCommessa()) ? " - " + x.getSitArtOrdDTO().getDescrizioneCommessa() : ""));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()));
|
||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()));
|
||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||
|
||||
//Calc Num CNF
|
||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||
//Calc Num CNF
|
||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||
|
||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||
.map(MtbColr::getNumCnf)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getNumCnf).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
|
||||
//Calc qta col
|
||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||
//Calc qta col
|
||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||
|
||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||
qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||
.map(MtbColr::getQtaCol)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||
qtaEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getQtaCol).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
|
||||
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||
} else {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||
} else {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
|
||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneEstesaOrd());
|
||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getSitArtOrdDTO().getDescrizioneEstesaOrd());
|
||||
|
||||
if (x.getMtbAart() != null) {
|
||||
accettazioneOrdiniPickingListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||
}
|
||||
if (x.getMtbAart() != null) {
|
||||
accettazioneOrdiniPickingListModel.setPosizione(x.getMtbAart().getPosizione());
|
||||
}
|
||||
|
||||
accettazioneOrdiniPickingListModel.setOriginalModel(x);
|
||||
accettazioneOrdiniPickingListModel.setOriginalModel(x);
|
||||
|
||||
list.add(accettazioneOrdiniPickingListModel);
|
||||
});
|
||||
list.add(accettazioneOrdiniPickingListModel);
|
||||
});
|
||||
|
||||
Stream.of(dataList)
|
||||
.filter(x -> UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getDescrizioneCommessa()) || x.getSitArtOrdDTO().getCodJcom().equalsIgnoreCase(CommonConst.Config.COMMESSA_MAG))
|
||||
.forEach(x -> {
|
||||
AccettazioneOrdiniPickingListModel accettazioneOrdiniPickingListModel = new AccettazioneOrdiniPickingListModel();
|
||||
accettazioneOrdiniPickingListModel.setActive(true);
|
||||
Stream.of(dataList).filter(x -> UtilityString.isNullOrEmpty(x.getSitArtOrdDTO().getDescrizioneCommessa()) || x.getSitArtOrdDTO().getCodJcom().equalsIgnoreCase(CommonConst.Config.COMMESSA_MAG)).forEach(x -> {
|
||||
AccettazioneOrdiniPickingListModel accettazioneOrdiniPickingListModel = new AccettazioneOrdiniPickingListModel();
|
||||
accettazioneOrdiniPickingListModel.setActive(true);
|
||||
|
||||
accettazioneOrdiniPickingListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||
accettazioneOrdiniPickingListModel.setGroupTitle(UtilityString.isNull(x.getSitArtOrdDTO().getCodJcom(), CommonConst.Config.COMMESSA_MAG));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()));
|
||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||
accettazioneOrdiniPickingListModel.setBadge1(UtilityString.isNull(x.getSitArtOrdDTO().getCodArtFor(), x.getSitArtOrdDTO().getCodMart()));
|
||||
accettazioneOrdiniPickingListModel.setBadge2(String.valueOf(x.getSitArtOrdDTO().getNumOrd()));
|
||||
|
||||
|
||||
//Calc Num CNF
|
||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||
//Calc Num CNF
|
||||
BigDecimal numCnfEvasa = BigDecimal.ZERO;
|
||||
|
||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||
.map(MtbColr::getNumCnf)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||
numCnfEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getNumCnf).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
|
||||
//Calc qta col
|
||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||
//Calc qta col
|
||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||
|
||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||
qtaEvasa = Stream.of(x.getWithdrawMtbColrs())
|
||||
.map(MtbColr::getQtaCol)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
if (x.getWithdrawMtbColrs().size() > 0) {
|
||||
qtaEvasa = Stream.of(x.getWithdrawMtbColrs()).map(MtbColr::getQtaCol).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
|
||||
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
if (SettingsManager.iDB().isFlagForceAllToColli() || (x.getMtbAart() == null || !x.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||
} else {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(x.getMtbAart().getUntMis());
|
||||
} else {
|
||||
accettazioneOrdiniPickingListModel.setQtaEvasa(qtaEvasa);
|
||||
accettazioneOrdiniPickingListModel.setQtaTot(x.getSitArtOrdDTO().getQtaDaEvadere());
|
||||
if (x.getMtbAart() != null)
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
accettazioneOrdiniPickingListModel.setSecQtaEvasa(numCnfEvasa);
|
||||
accettazioneOrdiniPickingListModel.setSecQtaTot(x.getSitArtOrdDTO().getNumCnfDaEvadere());
|
||||
accettazioneOrdiniPickingListModel.setSecUntMis(UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
|
||||
|
||||
if (x.getMtbAart() != null) {
|
||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getMtbAart().getDescrizioneEstesa());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
}
|
||||
if (x.getMtbAart() != null) {
|
||||
accettazioneOrdiniPickingListModel.setDescrizione(x.getMtbAart().getDescrizioneEstesa());
|
||||
accettazioneOrdiniPickingListModel.setUntMis(x.getMtbAart().getUntMis());
|
||||
}
|
||||
|
||||
accettazioneOrdiniPickingListModel.setOriginalModel(x);
|
||||
accettazioneOrdiniPickingListModel.setOriginalModel(x);
|
||||
|
||||
list.add(accettazioneOrdiniPickingListModel);
|
||||
});
|
||||
list.add(accettazioneOrdiniPickingListModel);
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
private boolean isThereAnyItemToPick(List<PickingObjectDTO> dataList) {
|
||||
return Stream.of(dataList)
|
||||
.anyMatch(x -> !x.isHidden());
|
||||
return Stream.of(dataList).anyMatch(x -> !x.isHidden());
|
||||
}
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
@@ -713,25 +645,31 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
this.fabPopupMenu.dismiss();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.createNewLU(null, null, false, () -> {
|
||||
this.mViewModel.createNewLU(null, null, null, false, () -> {
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
}
|
||||
|
||||
public void trackPackaging() {
|
||||
this.fabPopupMenu.dismiss();
|
||||
|
||||
DialogTracciamentoImballiView.newInstance(data -> {
|
||||
if (data != null && !data.isEmpty())
|
||||
mViewModel.registraImballi(data);
|
||||
}).show(getSupportFragmentManager(), DialogTracciamentoImballiView.class.getName());
|
||||
}
|
||||
|
||||
|
||||
public void showCreatedUL() {
|
||||
this.fabPopupMenu.dismiss();
|
||||
this.mViewModel.retrieveExistentLU(this::startListaBancaliRegistratiActivity);
|
||||
}
|
||||
|
||||
private void showOrderByDialog() {
|
||||
AlertDialog dialog = new AlertDialog.Builder(this)
|
||||
.setTitle(this.getText(R.string.action_orderBy))
|
||||
.setSingleChoiceItems(AccettazioneOrdineInevasoOrderBy.descriptions, mCurrentOrderBy.getVal(), (dialog12, which) -> {
|
||||
mCurrentOrderBy = AccettazioneOrdineInevasoOrderBy.Enum.fromInt(which);
|
||||
SettingsManager.i().getUserSession().setDefaultOrdinamentoPickingAccettazione(which);
|
||||
})
|
||||
.setPositiveButton(getText(R.string.ok), (dialog1, which) -> this.refreshList())
|
||||
.create();
|
||||
AlertDialog dialog = new AlertDialog.Builder(this).setTitle(this.getText(R.string.action_orderBy)).setSingleChoiceItems(AccettazioneOrdineInevasoOrderBy.descriptions, mCurrentOrderBy.getVal(), (dialog12, which) -> {
|
||||
mCurrentOrderBy = AccettazioneOrdineInevasoOrderBy.Enum.fromInt(which);
|
||||
SettingsManager.i().getUserSession().setDefaultOrdinamentoPickingAccettazione(which);
|
||||
}).setPositiveButton(getText(R.string.ok), (dialog1, which) -> this.refreshList()).create();
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@@ -739,14 +677,9 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
|
||||
Intent myIntent = ListaBancaliActivity.createIntent(this,
|
||||
|
||||
Stream.of(mtbColts)
|
||||
.map(AlreadyRegisteredUDCDTO::getMtbColt)
|
||||
.toList(),
|
||||
Stream.of(mtbColts).map(AlreadyRegisteredUDCDTO::getMtbColt).toList(),
|
||||
|
||||
input -> Stream.of(mtbColts)
|
||||
.filter(x -> x.getMtbColt() == input)
|
||||
.findFirstOrElse(null)
|
||||
.isCanBeRecovered(),
|
||||
input -> Stream.of(mtbColts).filter(x -> x.getMtbColt() == input).findFirstOrElse(null).isCanBeRecovered(),
|
||||
|
||||
ReportManager.getReportNameLUFromGestione(GestioneEnum.ACQUISTO));
|
||||
|
||||
@@ -757,9 +690,7 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
public void onLUSuccessullyPrinted() {
|
||||
Resources res = getResources();
|
||||
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
||||
DialogSimpleMessageView
|
||||
.makeSuccessDialog(res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
DialogSimpleMessageView.makeSuccessDialog(res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null).show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -769,13 +700,7 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
@Override
|
||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||
this.onLoadingEnded();
|
||||
DialogSimpleMessageView.makeErrorDialog(
|
||||
new SpannableString(ex.getMessage()),
|
||||
null,
|
||||
null,
|
||||
R.string.button_ignore_print,
|
||||
onComplete)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
DialogSimpleMessageView.makeErrorDialog(new SpannableString(ex.getMessage()), null, null, R.string.button_ignore_print, onComplete).show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -795,20 +720,12 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
|
||||
@Override
|
||||
public void onVersamentoAutomaticoULRequest(RunnableArgs<Boolean> onComplete) {
|
||||
runOnUiThread(() -> {
|
||||
DialogAskShouldVersamentoAutomaticoULView.newInstance(onComplete)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
DialogAskShouldVersamentoAutomaticoULView.newInstance(onComplete).show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@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());
|
||||
DialogInfoAggiuntiveLUView.newInstance(onComplete, this::onLoadingEnded).show(getSupportFragmentManager(), DialogInfoAggiuntiveLUView.class.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -826,41 +743,13 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
|
||||
@Override
|
||||
public void onItemDispatched(PickingObjectDTO pickingObjectDTO, MtbAart mtbAart, BigDecimal initialNumCnf, BigDecimal initialQtaCnf, BigDecimal initialQtaTot, BigDecimal totalQtaOrd, BigDecimal totalNumCnfOrd, BigDecimal qtaCnfOrd, BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, BigDecimal totalQtaAvailable, BigDecimal totalNumCnfAvailable, BigDecimal qtaCnfAvailable, String partitaMag, LocalDate dataScad, boolean canPartitaMagBeChanged, boolean canOverflowQuantity, String customArtDescription, RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
||||
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
||||
.setMtbAart(mtbAart)
|
||||
.setInitialNumCnf(initialNumCnf)
|
||||
.setInitialQtaCnf(initialQtaCnf)
|
||||
.setInitialQtaTot(initialQtaTot)
|
||||
.setTotalQtaOrd(totalQtaOrd)
|
||||
.setTotalNumCnfOrd(totalNumCnfOrd)
|
||||
.setQtaCnfOrd(qtaCnfOrd)
|
||||
.setTotalQtaToBeTaken(totalQtaToBeTaken)
|
||||
.setTotalNumCnfToBeTaken(totalNumCnfToBeTaken)
|
||||
.setQtaCnfToBeTaken(qtaCnfToBeTaken)
|
||||
.setTotalQtaAvailable(totalQtaAvailable)
|
||||
.setTotalNumCnfAvailable(totalNumCnfAvailable)
|
||||
.setQtaCnfAvailable(qtaCnfAvailable)
|
||||
.setPartitaMag(partitaMag)
|
||||
.setDataScad(dataScad)
|
||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||
.setCanLUBeClosed(true)
|
||||
.setCanOverflowOrderQuantity(canOverflowQuantity)
|
||||
.setCustomArtDescription(customArtDescription);
|
||||
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO().setMtbAart(mtbAart).setInitialNumCnf(initialNumCnf).setInitialQtaCnf(initialQtaCnf).setInitialQtaTot(initialQtaTot).setTotalQtaOrd(totalQtaOrd).setTotalNumCnfOrd(totalNumCnfOrd).setQtaCnfOrd(qtaCnfOrd).setTotalQtaToBeTaken(totalQtaToBeTaken).setTotalNumCnfToBeTaken(totalNumCnfToBeTaken).setQtaCnfToBeTaken(qtaCnfToBeTaken).setTotalQtaAvailable(totalQtaAvailable).setTotalNumCnfAvailable(totalNumCnfAvailable).setQtaCnfAvailable(qtaCnfAvailable).setPartitaMag(partitaMag).setDataScad(dataScad).setCanPartitaMagBeChanged(canPartitaMagBeChanged).setCanLUBeClosed(true).setCanOverflowOrderQuantity(canOverflowQuantity).setCustomArtDescription(customArtDescription);
|
||||
|
||||
if (!mDialogInputQuantityV2View.isVisible())
|
||||
mDialogInputQuantityV2View
|
||||
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
|
||||
.setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO()
|
||||
.setNumCnf(resultDTO.getNumCnf())
|
||||
.setQtaCnf(resultDTO.getQtaCnf())
|
||||
.setQtaTot(resultDTO.getQtaTot())
|
||||
.setPartitaMag(resultDTO.getPartitaMag())
|
||||
.setDataScad(resultDTO.getDataScad());
|
||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||
})
|
||||
.setOnAbort(() -> this.mViewModel.resetMatchedRows())
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
mDialogInputQuantityV2View.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO).setOnComplete((resultDTO, shouldCloseLU) -> {
|
||||
PickedQuantityDTO pickedQuantityDTO = new PickedQuantityDTO().setNumCnf(resultDTO.getNumCnf()).setQtaCnf(resultDTO.getQtaCnf()).setQtaTot(resultDTO.getQtaTot()).setPartitaMag(resultDTO.getPartitaMag()).setDataScad(resultDTO.getDataScad());
|
||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||
}).setOnAbort(() -> this.mViewModel.resetMatchedRows()).show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -894,9 +783,7 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
public void onULVersata(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete) {
|
||||
|
||||
runOnUiThread(() -> {
|
||||
DialogVersamentoAutomaticoULDoneView
|
||||
.newInstance(versamentoAutomaticoULResponseDTO, onComplete)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
DialogVersamentoAutomaticoULDoneView.newInstance(versamentoAutomaticoULResponseDTO, onComplete).show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
|
||||
}
|
||||
@@ -905,11 +792,7 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
public void onMtbColrDeleteRequest(RunnableArgs<Boolean> onComplete) {
|
||||
runOnUiThread(() -> {
|
||||
String text = getResources().getString(R.string.alert_delete_mtb_colr);
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text),
|
||||
null,
|
||||
() -> onComplete.run(true),
|
||||
() -> onComplete.run(false)
|
||||
).show(getSupportFragmentManager(), "tag");
|
||||
DialogSimpleMessageView.makeWarningDialog(new SpannableString(text), null, () -> onComplete.run(true), () -> onComplete.run(false)).show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -925,12 +808,11 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
|
||||
@Override
|
||||
public void onLUClosed() {
|
||||
runOnUiThread(() -> {
|
||||
noLUPresent.set(true);
|
||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
||||
noLUPresent.set(true);
|
||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
||||
this.refreshList();
|
||||
|
||||
if (this.mShouldCloseActivity) super.onBackPressed();
|
||||
});
|
||||
if (this.mShouldCloseActivity) super.onBackPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,12 +2,13 @@ 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;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ImballiRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.rest.AccettazioneOrdiniPickingRESTConsumer;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
||||
@@ -30,17 +31,19 @@ public class AccettazioneOrdiniPickingModule {
|
||||
ArticoloRESTConsumer articoloRESTConsumer,
|
||||
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||
PrinterRESTConsumer printerRESTConsumer,
|
||||
AccettazioneOrdiniPickingRESTConsumer accettazioneOrdiniPickingRESTConsumer,
|
||||
ColliAccettazioneRESTConsumer colliAccettazioneRESTConsumer,
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer) {
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
|
||||
Ean128Service ean128Service,
|
||||
ImballiRESTConsumer imballiRESTConsumer) {
|
||||
return new AccettazioneOrdiniPickingViewModel(articoloRESTConsumer,
|
||||
barcodeRESTConsumer,
|
||||
colliMagazzinoRESTConsumer,
|
||||
printerRESTConsumer,
|
||||
accettazioneOrdiniPickingRESTConsumer,
|
||||
colliAccettazioneRESTConsumer,
|
||||
colliLavorazioneRESTConsumer);
|
||||
colliLavorazioneRESTConsumer,
|
||||
ean128Service,
|
||||
imballiRESTConsumer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,11 +11,13 @@ import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.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 +33,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;
|
||||
@@ -38,10 +41,12 @@ import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliAccettazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ImballiRESTConsumer;
|
||||
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.imballi.ImballoQuantityDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CreateUDCRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CreateUDCRequestOrderDTO;
|
||||
@@ -55,7 +60,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;
|
||||
@@ -64,16 +68,18 @@ import it.integry.integrywmsnative.gest.accettazione_ordini_picking.rest.Accetta
|
||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.NotCurrentYearLUException;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.tracciamento_imballi.TracciamentoImballoDTO;
|
||||
|
||||
public class AccettazioneOrdiniPickingViewModel {
|
||||
|
||||
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
|
||||
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||
private final PrinterRESTConsumer mPrinterRESTConsumer;
|
||||
private final AccettazioneOrdiniPickingRESTConsumer mAccettazioneOrdiniPickingRESTConsumer;
|
||||
private final ColliAccettazioneRESTConsumer mColliAccettazioneRESTConsumer;
|
||||
private final ColliLavorazioneRESTConsumer mColliLavorazioneRESTConsumer;
|
||||
private final Ean128Service mEan128Service;
|
||||
private final ImballiRESTConsumer mImballiRESTConsumer;
|
||||
|
||||
private ColliCaricoRESTConsumerInterface mColliCaricoRESTConsumer;
|
||||
|
||||
@@ -85,6 +91,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
|
||||
private MtbColt mCurrentMtbColt = null;
|
||||
private GestioneEnum defaultGestioneOfUL = null;
|
||||
private String foundCodAnag = null;
|
||||
|
||||
private final List<HistoryMtbAartDTO> mHistoryUsedAarts = new ArrayList<>();
|
||||
|
||||
@@ -92,17 +99,19 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
public AccettazioneOrdiniPickingViewModel(ArticoloRESTConsumer articoloRESTConsumer,
|
||||
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||
PrinterRESTConsumer printerRESTConsumer,
|
||||
AccettazioneOrdiniPickingRESTConsumer accettazioneOrdiniPickingRESTConsumer,
|
||||
ColliAccettazioneRESTConsumer colliAccettazioneRESTConsumer,
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer) {
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
|
||||
Ean128Service ean128Service,
|
||||
ImballiRESTConsumer imballiRESTConsumer) {
|
||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||
this.mPrinterRESTConsumer = printerRESTConsumer;
|
||||
this.mAccettazioneOrdiniPickingRESTConsumer = accettazioneOrdiniPickingRESTConsumer;
|
||||
this.mColliAccettazioneRESTConsumer = colliAccettazioneRESTConsumer;
|
||||
this.mColliLavorazioneRESTConsumer = colliLavorazioneRESTConsumer;
|
||||
this.mEan128Service = ean128Service;
|
||||
this.mImballiRESTConsumer = imballiRESTConsumer;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,6 +135,15 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
.findFirst()
|
||||
.get();
|
||||
|
||||
//Definizione codAnag
|
||||
var codAnagsOrd = mOrders.stream()
|
||||
.map(OrdineAccettazioneInevasoDTO::getCodAnagOrd)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if(codAnagsOrd.size() == 1) foundCodAnag = codAnagsOrd.get(0);
|
||||
|
||||
|
||||
//Definizione della gestione collo di default
|
||||
List<GestioneEnum> foundGestioni = Stream.of(mOrders)
|
||||
.map(OrdineAccettazioneInevasoDTO::getGestioneEnum)
|
||||
@@ -209,7 +227,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 +243,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 +267,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 +281,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 +300,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 +308,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 +405,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 +415,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 +434,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
.setCodTcol(tCol != null ? tCol.getCodTcol() : null)
|
||||
.setNumCollo(customNumCollo)
|
||||
.setSerCollo(customSerCollo)
|
||||
.setBarcodeUl(customSSCC)
|
||||
.setOrders(orders);
|
||||
|
||||
this.mColliCaricoRESTConsumer.createUDC(createUDCRequestDTO, createdUDS -> {
|
||||
@@ -741,9 +780,6 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
} else {
|
||||
postCloseOperations();
|
||||
}
|
||||
|
||||
this.sendLUClosed();
|
||||
this.sendOnLoadingEnded();
|
||||
};
|
||||
|
||||
sendVersamentoAutomaticoULRequest(response -> {
|
||||
@@ -782,11 +818,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.isEmpty()) {
|
||||
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);
|
||||
@@ -832,6 +897,22 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
return optional.isPresent() ? optional.get() : null;
|
||||
}
|
||||
|
||||
public void registraImballi(List<TracciamentoImballoDTO> data) {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
|
||||
var inputData = data.stream()
|
||||
.map(x -> new ImballoQuantityDTO()
|
||||
.setQta(x.getQta().get())
|
||||
.setCodMart(x.getCodMart().get()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
mImballiRESTConsumer.registraCarico(foundCodAnag, inputData, () -> {
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
|
||||
private void sendOnLoadingStarted() {
|
||||
if (this.mListener != null) mListener.onLoadingStarted();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -29,8 +29,11 @@ public class ArtDTO {
|
||||
private LocalDate dataScad;
|
||||
|
||||
private String systemNote;
|
||||
|
||||
private String codAlis;
|
||||
|
||||
private Date datetimeRow;
|
||||
|
||||
public Integer getRigaOrd() {
|
||||
return rigaOrd;
|
||||
}
|
||||
@@ -135,4 +138,13 @@ public class ArtDTO {
|
||||
this.codAlis = codAlis;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDatetimeRow() {
|
||||
return datetimeRow;
|
||||
}
|
||||
|
||||
public ArtDTO setDatetimeRow(Date datetimeRow) {
|
||||
this.datetimeRow = datetimeRow;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.annimon.stream.Stream;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -125,7 +126,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()
|
||||
@@ -234,6 +240,7 @@ public class DocInterniEditFormViewModel {
|
||||
artDto.setBarcode(row.getCodBarre());
|
||||
artDto.setQta(BigDecimal.valueOf(row.getQtaCol()));
|
||||
artDto.setDataIns(row.getDataCollo());
|
||||
artDto.setDatetimeRow(row.getDatetimeRow());
|
||||
artDto.setColli(BigDecimal.valueOf(row.getNumCnf()));
|
||||
artDto.setUntMis(row.getUntMis());
|
||||
artDto.setCodMart(row.getCodMart());
|
||||
@@ -350,6 +357,7 @@ public class DocInterniEditFormViewModel {
|
||||
row.setQtaCnf(resultDTO.getQtaCnf().floatValue());
|
||||
row.setNumCnf(resultDTO.getNumCnf().floatValue());
|
||||
row.setQtaCol(resultDTO.getQtaTot().floatValue());
|
||||
row.setDatetimeRow(new Date());
|
||||
row.setNote(resultDTO.getNote());
|
||||
row.setDataScad(resultDTO.getDataScad());
|
||||
row.setPartitaMag(resultDTO.getPartitaMag());
|
||||
|
||||
@@ -55,6 +55,7 @@ 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.ask_linea_prod.dto.DialogAskLineaProdResponse;
|
||||
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;
|
||||
@@ -297,7 +298,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLULineaProdRequired(RunnableArgs<String> onComplete, Runnable onAbort) {
|
||||
public void onLULineaProdRequired(RunnableArgs<DialogAskLineaProdResponse> onComplete, Runnable onAbort) {
|
||||
DialogAskLineaProdView.newInstance(onComplete, onAbort)
|
||||
.show(getParentFragmentManager(), DialogAskLineaProdView.class.getName());
|
||||
}
|
||||
|
||||
@@ -55,6 +55,7 @@ import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_linea_prod.dto.DialogAskLineaProdResponse;
|
||||
|
||||
public class PickingLiberoViewModel {
|
||||
|
||||
@@ -324,25 +325,27 @@ public class PickingLiberoViewModel {
|
||||
|
||||
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);
|
||||
}, () -> {
|
||||
this.sendLULineaProdRequired(response -> {
|
||||
createNewLU_PostLineaProdAsk(customNumCollo, customSerCollo, vtbDest, response.getPosizione(), response.getIdLotto(), onComplete);
|
||||
|
||||
}, () -> {
|
||||
this.sendOnLoadingEnded();
|
||||
});
|
||||
} else {
|
||||
createNewLU_PostLineaProdAsk(customNumCollo, customSerCollo, vtbDest, null, onComplete);
|
||||
createNewLU_PostLineaProdAsk(customNumCollo, customSerCollo, vtbDest, null, null, onComplete);
|
||||
}
|
||||
}
|
||||
|
||||
private void createNewLU_PostLineaProdAsk(Integer customNumCollo, String customSerCollo, VtbDest vtbDest, String codJfas, Runnable onComplete) {
|
||||
private void createNewLU_PostLineaProdAsk(Integer customNumCollo, String customSerCollo, VtbDest vtbDest, String codJfas, Integer idLotto, Runnable onComplete) {
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
var createUDSRequest = new CreateUDSRequestDTO()
|
||||
.setRifOrd(mDefaultGestione == GestioneEnum.LAVORAZIONE ? "PICKING LIBERO" : null)
|
||||
.setRifOrd(mDefaultGestione == GestioneEnum.LAVORAZIONE && !mFlagAskLineaProd ? "PICKING LIBERO" : null)
|
||||
.setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep())
|
||||
.setCausaleCollo(CreateUDSRequestDTO.Causale.SCARICO)
|
||||
.setOrderRequired(mFlagAskLineaProd);
|
||||
.setIdLotto(idLotto)
|
||||
.setOrderRequired(false);
|
||||
|
||||
if (customNumCollo != null) {
|
||||
createUDSRequest.setNumCollo(customNumCollo);
|
||||
@@ -529,9 +532,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);
|
||||
|
||||
@@ -563,8 +566,6 @@ public class PickingLiberoViewModel {
|
||||
|
||||
clonedTestata.setMtbColr(mtbColrObservableField);
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
new Thread(() -> {
|
||||
mColliMagazzinoRESTConsumer.saveCollo(clonedTestata, value -> {
|
||||
for (int i = 0; i < mtbColrObservableField.size(); i++) {
|
||||
@@ -950,7 +951,7 @@ public class PickingLiberoViewModel {
|
||||
if (this.mListener != null) mListener.onLUClienteRequired(onComplete, onAbort);
|
||||
}
|
||||
|
||||
private void sendLULineaProdRequired(RunnableArgs<String> onComplete, Runnable onAbort) {
|
||||
private void sendLULineaProdRequired(RunnableArgs<DialogAskLineaProdResponse> onComplete, Runnable onAbort) {
|
||||
if (this.mListener != null) mListener.onLULineaProdRequired(onComplete, onAbort);
|
||||
}
|
||||
|
||||
@@ -1010,7 +1011,7 @@ public class PickingLiberoViewModel {
|
||||
|
||||
void onLUClienteRequired(RunnableArgss<VtbDest, String> onComplete, Runnable onAbort);
|
||||
|
||||
void onLULineaProdRequired(RunnableArgs<String> onComplete, Runnable onAbort);
|
||||
void onLULineaProdRequired(RunnableArgs<DialogAskLineaProdResponse> onComplete, Runnable onAbort);
|
||||
|
||||
void onArtSelectionRequest(List<MtbColr> mtbColrsToPick, MtbAart mtbAart, RunnableArgs<List<MtbColr>> onComplete, Runnable onAbort);
|
||||
|
||||
|
||||
@@ -2,19 +2,27 @@ package it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterGruppoMercLayoutView;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.filters.FilterCommessaLayoutView;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.filters.FilterNumeroOrdineLayoutView;
|
||||
|
||||
public class ProdFabbisognoLineeProdBindings {
|
||||
public static final int NUM_ORD_FILTER_ID = 0;
|
||||
public static final int MGRP_FILTER_ID = 1;
|
||||
|
||||
public static final HashMap<Integer, FilterChipDTO> AVAILABLE_FILTERS = new HashMap<>() {{
|
||||
|
||||
put(NUM_ORD_FILTER_ID, new FilterChipDTO()
|
||||
.setID(NUM_ORD_FILTER_ID)
|
||||
.setPosizione(0)
|
||||
.setFilterChipText("Numero ordine")
|
||||
.setFilterLayoutView(new FilterNumeroOrdineLayoutView()));
|
||||
|
||||
put(MGRP_FILTER_ID, new FilterChipDTO()
|
||||
.setID(MGRP_FILTER_ID)
|
||||
.setPosizione(1)
|
||||
.setFilterChipText("Gruppo merceologico")
|
||||
.setFilterLayoutView(new FilterGruppoMercLayoutView()));
|
||||
}};
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -33,8 +34,13 @@ import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.OnGeneralChangedCallback;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.model.JtbComt;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.CommessaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
@@ -44,6 +50,7 @@ import it.integry.integrywmsnative.databinding.FragmentProdFabbisognoLineeListSi
|
||||
import it.integry.integrywmsnative.databinding.FragmentProdFabbisognoLineeProdBinding;
|
||||
import it.integry.integrywmsnative.databinding.FragmentProdFabbisognoLineeTitleItemBinding;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.dto.OrdineAccettazioneInevasoDTO;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterGruppoMercLayoutView;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ui.MainListProdOrdineProduzioneElencoClienteListModel;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ui.MainListProdOrdineProduzioneElencoListModel;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.GroupTitleModel;
|
||||
@@ -68,11 +75,17 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
||||
|
||||
@Inject
|
||||
ProdFabbisognoLineeProdViewModel mViewModel;
|
||||
@Inject
|
||||
ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||
@Inject
|
||||
CommessaRESTConsumer mCommessaRESTConsumer;
|
||||
|
||||
private final ArrayList<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||
private final ObservableArrayList<Object> mProdFabbisognoItemModel = new ObservableArrayList<>();
|
||||
private FragmentProdFabbisognoLineeProdBinding mBindings;
|
||||
private ProdFabbisognoLineeProdFilterViewModel mFilterViewModel = new ProdFabbisognoLineeProdFilterViewModel();
|
||||
private List<MtbGrup> mtbGrupCache;
|
||||
private List<JtbComt> jtbComtCache;
|
||||
|
||||
public ProdFabbisognoLineeProdFragment() {
|
||||
// Required empty public constructor
|
||||
@@ -120,6 +133,11 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
||||
mViewModel.getOrdiniList().observe(getViewLifecycleOwner(), data -> {
|
||||
mBindings.emptyView.setVisibility(data == null || data.isEmpty() ? View.VISIBLE : View.GONE);
|
||||
|
||||
this.onLoadingStarted();
|
||||
this.initMtbGrupsCache(() -> {
|
||||
this.initJtbComtCache(this::onLoadingEnded);
|
||||
});
|
||||
|
||||
mFilterViewModel.init(mViewModel.getOrdiniList().getValue());
|
||||
this.refreshList(null);
|
||||
});
|
||||
@@ -211,34 +229,67 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
||||
};
|
||||
|
||||
mFilterViewModel.getCurrentNumOrdsPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
mFilterViewModel.getCurrentGruppoMercPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
|
||||
for (var filterChipDTO : ProdFabbisognoLineeProdBindings.AVAILABLE_FILTERS.entrySet()) {
|
||||
List<FilterChipDTO> filterList = Stream.of(ProdFabbisognoLineeProdBindings.AVAILABLE_FILTERS.entrySet())
|
||||
.map(Map.Entry::getValue)
|
||||
.sortBy(FilterChipDTO::getPosizione)
|
||||
.toList();
|
||||
|
||||
for (FilterChipDTO filterChipDTO : filterList) {
|
||||
|
||||
FilterChipView filterChipView = new FilterChipView(
|
||||
requireActivity(),
|
||||
filterChipDTO.getValue().getFilterChipText(),
|
||||
v -> initBottomSheetDialogFilter(filterChipDTO.getValue()));
|
||||
filterChipDTO.getFilterChipText(),
|
||||
v -> initBottomSheetDialogFilter(filterChipDTO));
|
||||
|
||||
if (filterChipDTO.getKey() == ProdFabbisognoLineeProdBindings.NUM_ORD_FILTER_ID) {
|
||||
mFilterViewModel.getCurrentNumOrdsPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mFilterViewModel.getCurrentNumOrdsPredicate().get() == null) {
|
||||
filterChipView.disableCloseIcon();
|
||||
switch (filterChipDTO.getID()) {
|
||||
case ProdFabbisognoLineeProdBindings.NUM_ORD_FILTER_ID -> {
|
||||
mFilterViewModel.getCurrentNumOrdsPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mFilterViewModel.getCurrentNumOrdsPredicate().get() == null) {
|
||||
filterChipView.disableCloseIcon();
|
||||
|
||||
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||
mBindings.filterChipsGroup.addView(filterChipView);
|
||||
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||
} else {
|
||||
filterChipView.enableCloseIcon();
|
||||
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||
mBindings.filterChipsGroup.addView(filterChipView);
|
||||
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||
} else {
|
||||
filterChipView.enableCloseIcon();
|
||||
|
||||
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||
mBindings.filterChipsGroup.addView(filterChipView, 0);
|
||||
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||
mBindings.filterChipsGroup.addView(filterChipView, 0);
|
||||
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
filterChipView.setOnResetClicked(() -> mFilterViewModel.getCurrentNumOrdsPredicate().set(null));
|
||||
});
|
||||
filterChipView.setOnResetClicked(() -> mFilterViewModel.getCurrentNumOrdsPredicate().set(null));
|
||||
}
|
||||
|
||||
case ProdFabbisognoLineeProdBindings.MGRP_FILTER_ID -> {
|
||||
mFilterViewModel.getCurrentGruppoMercPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mFilterViewModel.getCurrentGruppoMercPredicate().get() == null) {
|
||||
filterChipView.disableCloseIcon();
|
||||
|
||||
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||
mBindings.filterChipsGroup.addView(filterChipView);
|
||||
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||
} else {
|
||||
filterChipView.enableCloseIcon();
|
||||
|
||||
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||
mBindings.filterChipsGroup.addView(filterChipView, 0);
|
||||
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
filterChipView.setOnResetClicked(() -> {
|
||||
mFilterViewModel.setGruppoMercFilter(null);
|
||||
mFilterViewModel.getCurrentGruppoMercPredicate().set(null);
|
||||
});
|
||||
}
|
||||
}
|
||||
this.mBindings.filterChipsGroup.addView(filterChipView);
|
||||
}
|
||||
@@ -253,16 +304,24 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
||||
var filterLayoutView = filterChipDTO
|
||||
.getFilterLayoutView();
|
||||
|
||||
if (filterChipDTO.getID() == ProdFabbisognoLineeProdBindings.NUM_ORD_FILTER_ID) {
|
||||
((FilterNumeroOrdineLayoutView) filterLayoutView)
|
||||
.setAllNumOrds(mFilterViewModel.getAllNumOrds())
|
||||
.setAvailableNumOrds(mFilterViewModel.getAvailableNumOrds())
|
||||
.setOnFilterApplied(mFilterViewModel::setNumOrdFilter)
|
||||
.setPreSelectedNumOrds(Stream.of(Objects.requireNonNull(mViewModel.getOrdiniList().getValue()))
|
||||
.filter(mFilterViewModel.getCurrentNumOrdsPredicate().get() == null ?
|
||||
x -> false : Objects.requireNonNull(mFilterViewModel.getCurrentNumOrdsPredicate().get()))
|
||||
.map(x -> x.getOrdineLavorazioneDTO().getNumOrd())
|
||||
.toList());
|
||||
switch (filterChipDTO.getID()) {
|
||||
case ProdFabbisognoLineeProdBindings.NUM_ORD_FILTER_ID ->
|
||||
((FilterNumeroOrdineLayoutView) filterLayoutView)
|
||||
.setAllNumOrds(mFilterViewModel.getAllNumOrds())
|
||||
.setAvailableNumOrds(mFilterViewModel.getAvailableNumOrds())
|
||||
.setOnFilterApplied(mFilterViewModel::setNumOrdFilter)
|
||||
.setPreSelectedNumOrds(Stream.of(Objects.requireNonNull(mViewModel.getOrdiniList().getValue()))
|
||||
.filter(mFilterViewModel.getCurrentNumOrdsPredicate().get() == null ?
|
||||
x -> false : Objects.requireNonNull(mFilterViewModel.getCurrentNumOrdsPredicate().get()))
|
||||
.map(x -> x.getOrdineLavorazioneDTO().getNumOrd())
|
||||
.toList());
|
||||
|
||||
case ProdFabbisognoLineeProdBindings.MGRP_FILTER_ID ->
|
||||
((FilterGruppoMercLayoutView) filterLayoutView)
|
||||
.setAllGroupMerc(mFilterViewModel.getAllGruppoMerc(mtbGrupCache))
|
||||
.setAvailableGroupMerc(mFilterViewModel.getAvailableGruppoMerc(mtbGrupCache))
|
||||
.setOnFilterApplied(mFilterViewModel::setGruppoMercFilter)
|
||||
.setPreSelectedGroupMerc(mFilterViewModel.getSelectedMtbGrup());
|
||||
}
|
||||
|
||||
if (!filterLayoutView.isAdded())
|
||||
@@ -270,6 +329,44 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
||||
|
||||
}
|
||||
|
||||
private void initMtbGrupsCache(Runnable onComplete) {
|
||||
var codMgrpArts = Stream.of(Objects.requireNonNull(this.mViewModel.getOrdiniList().getValue()))
|
||||
.flatMap(x -> Stream.of(x.getOrdineLavorazioneDTO().getAvailableClassMerc() != null ?
|
||||
x.getOrdineLavorazioneDTO().getAvailableClassMerc() : new ArrayList<>()))
|
||||
.map(OrdineLavorazioneDTO.AvailableClassMerc::getCodMgrp)
|
||||
.withoutNulls()
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
this.mArticoloRESTConsumer.getArtsGroups(codMgrpArts, mtbGrupCache -> {
|
||||
this.mtbGrupCache = mtbGrupCache;
|
||||
onComplete.run();
|
||||
}, this::onError);
|
||||
}
|
||||
|
||||
private void initJtbComtCache(Runnable onComplete) {
|
||||
if (this.mViewModel.getOrdiniList().getValue() == null) {
|
||||
this.jtbComtCache = new ArrayList<>();
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
var jtbComts = Stream.of(Objects.requireNonNull(this.mViewModel.getOrdiniList().getValue()))
|
||||
.flatMap(x -> Stream.of(x.getOrdineLavorazioneDTO().getCodJcom()))
|
||||
.distinct().withoutNulls()
|
||||
.toList();
|
||||
|
||||
if (jtbComts.isEmpty()) {
|
||||
this.jtbComtCache = new ArrayList<>();
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
this.mCommessaRESTConsumer.getJtbComts(jtbComts, jtbComtCache -> {
|
||||
this.jtbComtCache = jtbComtCache;
|
||||
onComplete.run();
|
||||
}, this::onError);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
||||
@@ -305,15 +402,32 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
||||
.max(Date::compareTo)
|
||||
.orElse(null);
|
||||
|
||||
this.mViewModel.loadFabbisogno(ordini, codMdep, dataInizio, dataFine, this::startPickingActivity);
|
||||
List<MtbGrup> listMtbGrup = Stream.of(mProdFabbisognoItemModel)
|
||||
.filter(x -> x instanceof ProdFabbisognoLineeItemModelDto && ((ProdFabbisognoLineeItemModelDto) x).selected.get())
|
||||
.flatMap(x -> Stream.of(((ProdFabbisognoLineeItemModelDto) x).getSelectedMtbGrup()))
|
||||
.toList();
|
||||
|
||||
this.mViewModel.loadFabbisogno(ordini, codMdep, dataInizio, dataFine, onCompleteData -> {
|
||||
startPickingActivity(listMtbGrup, onCompleteData);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void startPickingActivity(List<ProdFabbisognoLineeProdDTO> fabbisognoList) {
|
||||
private void startPickingActivity(List<MtbGrup> listMtbGrup, List<ProdFabbisognoLineeProdDTO> fabbisognoList) {
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
|
||||
List<SitArtOrdDTO> sitArtOrdDTOS = Stream.of(fabbisognoList)
|
||||
.map(x -> {
|
||||
String ordini = UtilityDB.listValueToString(Stream.of(mProdFabbisognoItemModel)
|
||||
.filter(x -> x instanceof ProdFabbisognoLineeItemModelDto && ((ProdFabbisognoLineeItemModelDto) x).selected.get())
|
||||
.map(x -> ((ProdFabbisognoLineeItemModelDto) x).getOrdineLavorazioneDTO().getNumOrd().toString())
|
||||
.toList());
|
||||
|
||||
Stream<ProdFabbisognoLineeProdDTO> streamSitArtOrd = Stream.of(fabbisognoList);
|
||||
|
||||
streamSitArtOrd = listMtbGrup != null && !listMtbGrup.isEmpty() ?
|
||||
streamSitArtOrd.filter(x -> Stream.of(listMtbGrup).anyMatch(y -> y.getCodMgrp().equalsIgnoreCase(x.getCodMgrp()))) :
|
||||
streamSitArtOrd;
|
||||
|
||||
List<SitArtOrdDTO> sitArtOrdDTOS = streamSitArtOrd.map(x -> {
|
||||
SitArtOrdDTO sitArtOrdDTO = new SitArtOrdDTO()
|
||||
.setCodMart(x.getCodMart())
|
||||
.setCodMdep(codMdep)
|
||||
@@ -328,6 +442,7 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
||||
|
||||
sitArtOrdDTO.getExtraInfo().put("dataInizio", x.getDataInizio());
|
||||
sitArtOrdDTO.getExtraInfo().put("dataFine", x.getDataFine());
|
||||
sitArtOrdDTO.getExtraInfo().put("ordini", ordini);
|
||||
|
||||
return sitArtOrdDTO;
|
||||
})
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
package it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||
|
||||
public class ProdFabbisognoLineeItemModelDto {
|
||||
|
||||
public BindableBoolean selected = new BindableBoolean();
|
||||
public OrdineLavorazioneDTO ordineLavorazioneDTO;
|
||||
List<MtbGrup> selectedMtbGrup = new ArrayList<>();
|
||||
|
||||
public BindableBoolean getSelected() {
|
||||
return selected;
|
||||
@@ -20,4 +25,13 @@ public class ProdFabbisognoLineeItemModelDto {
|
||||
this.ordineLavorazioneDTO = ordineLavorazioneDTO;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbGrup> getSelectedMtbGrup() {
|
||||
return selectedMtbGrup;
|
||||
}
|
||||
|
||||
public ProdFabbisognoLineeItemModelDto setSelectedMtbGrup(List<MtbGrup> selectedMtbGrup) {
|
||||
this.selectedMtbGrup = selectedMtbGrup;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,18 +6,25 @@ import androidx.lifecycle.MutableLiveData;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.annimon.stream.function.Predicate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoDTO;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.ProdFabbisognoLineeItemModelDto;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||
|
||||
public class ProdFabbisognoLineeProdFilterViewModel {
|
||||
private final ObservableField<Predicate<ProdFabbisognoLineeItemModelDto>> currentNumOrdsPredicate = new ObservableField<>();
|
||||
private final ObservableField<Predicate<ProdFabbisognoLineeItemModelDto>> currentGruppoMercPredicate = new ObservableField<>();
|
||||
|
||||
private List<ProdFabbisognoLineeItemModelDto> initialList;
|
||||
private List<MtbGrup> selectedMtbGrup = new ArrayList<>();
|
||||
private final MutableLiveData<List<ProdFabbisognoLineeItemModelDto>> currentList = new MutableLiveData<>();
|
||||
|
||||
public void init(List<ProdFabbisognoLineeItemModelDto> initialList){
|
||||
public void init(List<ProdFabbisognoLineeItemModelDto> initialList) {
|
||||
this.initialList = initialList;
|
||||
this.currentList.setValue(this.initialList);
|
||||
}
|
||||
@@ -26,23 +33,37 @@ public class ProdFabbisognoLineeProdFilterViewModel {
|
||||
return this.currentList;
|
||||
}
|
||||
|
||||
public void setNumOrdFilter(List<Integer> numOrds){
|
||||
public void setNumOrdFilter(List<Integer> numOrds) {
|
||||
if (numOrds == null || numOrds.isEmpty()) currentNumOrdsPredicate.set(null);
|
||||
else{
|
||||
else {
|
||||
currentNumOrdsPredicate.set(x -> numOrds.contains(x.getOrdineLavorazioneDTO().getNumOrd()));
|
||||
}
|
||||
}
|
||||
|
||||
public void applyAllTests(){
|
||||
public void setGruppoMercFilter(List<MtbGrup> mtbGrupList) {
|
||||
if (mtbGrupList == null || mtbGrupList.isEmpty()) {
|
||||
currentGruppoMercPredicate.set(null);
|
||||
this.selectedMtbGrup = new ArrayList<>();
|
||||
} else {
|
||||
this.selectedMtbGrup = mtbGrupList;
|
||||
var mtbGrups = Stream.of(mtbGrupList).map(MtbGrup::getCodMgrp).toList();
|
||||
|
||||
currentGruppoMercPredicate.set(x -> Stream.of(x.getOrdineLavorazioneDTO().getAvailableClassMerc())
|
||||
.anyMatch(y -> mtbGrups.contains(y.getCodMgrp())));
|
||||
}
|
||||
}
|
||||
|
||||
public void applyAllTests() {
|
||||
List<ProdFabbisognoLineeItemModelDto> returnList = null;
|
||||
|
||||
if (currentNumOrdsPredicate.get() == null){
|
||||
if (currentNumOrdsPredicate.get() == null &&
|
||||
currentGruppoMercPredicate.get() == null) {
|
||||
returnList = this.initialList;
|
||||
}else {
|
||||
Stream<ProdFabbisognoLineeItemModelDto> tmpStream = Stream.of(this.initialList)
|
||||
.filter(x -> (currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))));
|
||||
|
||||
returnList = tmpStream.toList();
|
||||
} else {
|
||||
returnList = Stream.of(this.initialList)
|
||||
.filter(x -> (currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||
).map(x -> x.setSelectedMtbGrup(this.selectedMtbGrup)).toList();
|
||||
}
|
||||
|
||||
this.currentList.setValue(returnList);
|
||||
@@ -52,7 +73,11 @@ public class ProdFabbisognoLineeProdFilterViewModel {
|
||||
return currentNumOrdsPredicate;
|
||||
}
|
||||
|
||||
public List<Integer> getAllNumOrds(){
|
||||
public ObservableField<Predicate<ProdFabbisognoLineeItemModelDto>> getCurrentGruppoMercPredicate() {
|
||||
return currentGruppoMercPredicate;
|
||||
}
|
||||
|
||||
public List<Integer> getAllNumOrds() {
|
||||
return Stream
|
||||
.of(Objects.requireNonNull(initialList))
|
||||
.filter(x -> x.getOrdineLavorazioneDTO().getNumOrd() != null)
|
||||
@@ -62,13 +87,59 @@ public class ProdFabbisognoLineeProdFilterViewModel {
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<Integer> getAvailableNumOrds(){
|
||||
if (currentNumOrdsPredicate.get() == null) return getAllNumOrds();
|
||||
public List<Integer> getAvailableNumOrds() {
|
||||
if (currentGruppoMercPredicate.get() == null) return getAllNumOrds();
|
||||
else {
|
||||
return Stream.of(this.initialList)
|
||||
.filter(x -> (currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x))))
|
||||
.map(x -> x.getOrdineLavorazioneDTO().getNumOrd())
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
public List<MtbGrup> getSelectedMtbGrup() {
|
||||
return selectedMtbGrup;
|
||||
}
|
||||
|
||||
public List<MtbGrup> getAllGruppoMerc(List<MtbGrup> mtbGrupFullList) {
|
||||
var codMgrp = Stream.of(initialList)
|
||||
.flatMap(x ->
|
||||
Stream.of(x.getOrdineLavorazioneDTO().getAvailableClassMerc() != null ?
|
||||
x.getOrdineLavorazioneDTO().getAvailableClassMerc() :
|
||||
new ArrayList<>()))
|
||||
.map(OrdineLavorazioneDTO.AvailableClassMerc::getCodMgrp)
|
||||
.withoutNulls()
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
return Stream.of(Objects.requireNonNull(mtbGrupFullList))
|
||||
.filter(x -> codMgrp.contains(x.getCodMgrp()))
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sortBy(MtbGrup::getDescrizione)
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<MtbGrup> getAvailableGruppoMerc(List<MtbGrup> mtbGrupFullList){
|
||||
if (currentNumOrdsPredicate.get() == null){
|
||||
return getAllGruppoMerc(mtbGrupFullList);
|
||||
} else {
|
||||
List<String> availableCodMgrups = Stream.of(this.initialList)
|
||||
.filter(x ->
|
||||
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x)))
|
||||
)
|
||||
.flatMap(x -> Stream.of(x.getOrdineLavorazioneDTO().getAvailableClassMerc()))
|
||||
.map(OrdineLavorazioneDTO.AvailableClassMerc::getCodMgrp)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
return Stream.of(Objects.requireNonNull(mtbGrupFullList))
|
||||
.filter(x -> availableCodMgrups.contains(x.getCodMgrp()))
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sortBy(MtbGrup::getDescrizione)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,123 +50,26 @@ public class ProdFabbisognoLineeProdRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
public void loadFabbisogno(String codMart, Date startDate, Date endDate, String codMdep, RunnableArgs<List<ProdFabbisognoLineeProdDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
String sql = "WITH input_values AS ( " +
|
||||
" SELECT " + UtilityDB.valueToString(startDate) + " AS data_inizio, " +
|
||||
" " + UtilityDB.valueToString(endDate) + " AS data_fine, " +
|
||||
// " " + UtilityDB.valueToString(lineaProd) + " AS linea_prod, " +
|
||||
" " + UtilityDB.valueToString(codMdep) + " AS cod_mdep)," +
|
||||
" withdraw_mtb_colr AS ( " +
|
||||
" SELECT cod_mart, " +
|
||||
" SUM(ISNULL(qta_col, 0)) as qta_col, " +
|
||||
" SUM(ISNULL(num_cnf, 0)) as num_cnf, " +
|
||||
" mtb_colr.data_ord, " +
|
||||
" mtb_colr.num_ord, " +
|
||||
" mtb_colr.gestione " +
|
||||
" FROM mtb_colr " +
|
||||
" INNER JOIN mtb_colt mc on mtb_colr.gestione = mc.gestione and mtb_colr.data_collo = mc.data_collo and " +
|
||||
" mtb_colr.ser_collo = mc.ser_collo and mtb_colr.num_collo = mc.num_collo " +
|
||||
" WHERE segno = -1 " +
|
||||
" AND cod_dtip IS NULL " +
|
||||
" GROUP BY cod_mart, " +
|
||||
" mtb_colr.data_ord, " +
|
||||
" mtb_colr.num_ord, " +
|
||||
" mtb_colr.gestione " +
|
||||
" ), " +
|
||||
" custom_mtb_colr AS (SELECT cod_mart, " +
|
||||
" SUM(qta_col) AS qta_col, " +
|
||||
" SUM(num_cnf) AS num_cnf, " +
|
||||
" posizione " +
|
||||
" FROM mvw_sitart_udc_det_inventario " +
|
||||
" GROUP BY cod_mart, posizione), " +
|
||||
" grouped_ord AS ( " +
|
||||
" SELECT dtb_ordr.cod_mart, " +
|
||||
" dtb_ordt.cod_jfas, " +
|
||||
" dtb_ordt.cod_mdep, " +
|
||||
" dtb_ordt.gestione, " +
|
||||
" CONVERT(NUMERIC(15, 5), SUM(dtb_ordr.qta_ord * dtb_ordr.rap_conv) - " +
|
||||
" SUM(dtb_ordr.qta_evasa * dtb_ordr.rap_conv)) AS qta_ord, " +
|
||||
" SUM(dtb_ordr.num_cnf - dtb_ordr.num_cnf_evasa) AS num_cnf_ord, " +
|
||||
" SUM(ISNULL(withdraw_mtb_colr.qta_col, 0)) AS qta_col_scaricata, " +
|
||||
" SUM(ISNULL(withdraw_mtb_colr.num_cnf, 0)) AS num_cnf_scaricata " +
|
||||
" FROM dtb_ordr " +
|
||||
" INNER JOIN dtb_ordt on dtb_ordr.gestione = dtb_ordt.gestione AND " +
|
||||
" dtb_ordr.data_ord = dtb_ordt.data_ord AND " +
|
||||
" dtb_ordr.num_ord = dtb_ordt.num_ord " +
|
||||
" LEFT OUTER JOIN withdraw_mtb_colr " +
|
||||
" ON withdraw_mtb_colr.gestione = dtb_ordt.gestione AND " +
|
||||
" withdraw_mtb_colr.num_ord = dtb_ordt.num_ord AND " +
|
||||
" withdraw_mtb_colr.data_ord = dtb_ordt.data_ord AND " +
|
||||
" withdraw_mtb_colr.cod_mart = dtb_ordr.cod_mart " +
|
||||
" CROSS APPLY input_values " +
|
||||
" WHERE dtb_ordt.gestione = 'L' " +
|
||||
" AND flag_evaso = 'I' " +
|
||||
" AND dtb_ordr.flag_evaso_forzato = 'N' " +
|
||||
" AND flag_annulla = 'N' " +
|
||||
" AND dtb_ordt.cod_mdep = input_values.cod_mdep " +
|
||||
" AND dtb_ordt.data_ord BETWEEN input_values.data_inizio AND input_values.data_fine " +
|
||||
" GROUP BY dtb_ordr.cod_mart, dtb_ordt.cod_jfas, dtb_ordt.cod_mdep, dtb_ordt.gestione " +
|
||||
" ), " +
|
||||
" tmp_ord AS (SELECT grouped_ord.cod_mart, " +
|
||||
" mtb_aart.unt_mis, " +
|
||||
" grouped_ord.cod_jfas, " +
|
||||
" SUM(qta_ord) - SUM(qta_col_scaricata) AS qta_ord, " +
|
||||
" SUM(num_cnf_ord) - SUM(num_cnf_scaricata) AS num_cnf_ord " +
|
||||
" FROM grouped_ord " +
|
||||
" INNER JOIN mtb_aart ON grouped_ord.cod_mart = mtb_aart.cod_mart " +
|
||||
" CROSS APPLY input_values " +
|
||||
" GROUP BY grouped_ord.cod_mart, mtb_aart.unt_mis, grouped_ord.cod_jfas " +
|
||||
" ), " +
|
||||
" ord_without_positioned_mtb_colt AS ( " +
|
||||
" SELECT tmp_ord.cod_mart, " +
|
||||
" tmp_ord.cod_jfas, " +
|
||||
" ISNULL(custom_mtb_colr_on_linea.posizione, tmp_ord.cod_jfas) AS posizione, " +
|
||||
" unt_mis, " +
|
||||
" qta_ord AS qta_ord_calc, " +
|
||||
" num_cnf_ord AS num_cnf_ord_calc, " +
|
||||
" ISNULL(custom_mtb_colr_on_linea.qta_col, 0) AS qta_gia_posizionata, " +
|
||||
" ISNULL(custom_mtb_colr_on_linea.num_cnf, 0) AS num_cnf_gia_posizionata, " +
|
||||
" qta_ord - ISNULL(custom_mtb_colr_on_linea.qta_col, 0) AS qta_fabbisogno, " +
|
||||
" num_cnf_ord - ISNULL(custom_mtb_colr_on_linea.num_cnf, 0) AS num_cnf_fabbisogno " +
|
||||
" FROM tmp_ord " +
|
||||
" INNER JOIN jrl_fase_posizioni ON tmp_ord.cod_jfas = jrl_fase_posizioni.cod_jfas " +
|
||||
" AND tmp_ord.cod_jfas = jrl_fase_posizioni.posizione " +
|
||||
" LEFT OUTER JOIN custom_mtb_colr custom_mtb_colr_on_linea " +
|
||||
" ON tmp_ord.cod_mart = custom_mtb_colr_on_linea.cod_mart AND " +
|
||||
" tmp_ord.cod_jfas = custom_mtb_colr_on_linea.posizione " +
|
||||
" " +
|
||||
" UNION ALL " +
|
||||
" " +
|
||||
" SELECT DISTINCT tmp_ord.cod_mart, " +
|
||||
" null AS cod_jfas, " +
|
||||
" jrl_fase_posizioni.posizione, " +
|
||||
" unt_mis, " +
|
||||
" 0 AS qta_ord_calc, " +
|
||||
" 0 AS num_cnf_ord_calc, " +
|
||||
" ISNULL(custom_mtb_colr_on_linea.qta_col, 0) AS qta_gia_posizionata, " +
|
||||
" ISNULL(custom_mtb_colr_on_linea.num_cnf, 0) AS num_cnf_gia_posizionata, " +
|
||||
" 0 AS qta_fabbisogno, " +
|
||||
" 0 AS num_cnf_fabbisogno " +
|
||||
" FROM tmp_ord " +
|
||||
" INNER JOIN jrl_fase_posizioni ON tmp_ord.cod_jfas = jrl_fase_posizioni.cod_jfas " +
|
||||
" AND tmp_ord.cod_jfas <> jrl_fase_posizioni.posizione " +
|
||||
" " +
|
||||
" " +
|
||||
" LEFT OUTER JOIN custom_mtb_colr custom_mtb_colr_on_linea " +
|
||||
" ON tmp_ord.cod_mart = custom_mtb_colr_on_linea.cod_mart AND " +
|
||||
" jrl_fase_posizioni.posizione = custom_mtb_colr_on_linea.posizione " +
|
||||
" ) " +
|
||||
"SELECT DISTINCT cod_mart, " +
|
||||
" unt_mis, " +
|
||||
" cod_jfas, " +
|
||||
" input_values.data_inizio, " +
|
||||
" input_values.data_fine " +
|
||||
"FROM ord_without_positioned_mtb_colt " +
|
||||
"CROSS APPLY input_values " +
|
||||
"WHERE cod_mart = " + UtilityDB.valueToString(codMart) + " " +
|
||||
"GROUP BY cod_mart, unt_mis, cod_jfas, input_values.data_inizio, input_values.data_fine " +
|
||||
"HAVING SUM(qta_ord_calc - qta_gia_posizionata) > 0 AND SUM(num_cnf_ord_calc - num_cnf_gia_posizionata) > 0 " +
|
||||
"ORDER BY cod_mart";
|
||||
public void loadFabbisogno(String codMart, String ordini, Date startDate, Date endDate, String codMdep, RunnableArgs<List<ProdFabbisognoLineeProdDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
String sql = "SELECT DISTINCT cod_jfas\n" +
|
||||
"FROM (SELECT DENSE_RANK() OVER (PARTITION BY dtb_ordt.gestione, dtb_ordt.data_ord, dtb_ordt.num_ord ORDER BY dtb_ord_steps.data_iniz DESC) AS row_n,\n" +
|
||||
" dtb_ord_steps.*\n" +
|
||||
" FROM dtb_ord_steps\n" +
|
||||
" INNER JOIN dtb_ordt ON dtb_ord_steps.data_ord = dtb_ordt.data_ord\n" +
|
||||
" AND dtb_ord_steps.num_ord = dtb_ordt.num_ord\n" +
|
||||
" AND dtb_ord_steps.gestione = dtb_ordt.gestione\n" +
|
||||
" INNER JOIN dtb_ordr ON dtb_ordr.gestione = dtb_ord_steps.gestione AND\n" +
|
||||
" dtb_ordr.data_ord = dtb_ord_steps.data_ord AND\n" +
|
||||
" dtb_ordr.num_ord = dtb_ord_steps.num_ord\n" +
|
||||
" WHERE dtb_ordt.gestione = 'L'\n" +
|
||||
" AND dtb_ordr.flag_evaso = 'I'\n" +
|
||||
" AND dtb_ordr.flag_evaso_forzato = 'N'\n" +
|
||||
" AND flag_annulla = 'N'\n" +
|
||||
" AND dtb_ordt.cod_mdep = " + UtilityDB.valueToString(codMdep) + "\n" +
|
||||
" AND dtb_ordt.num_ord IN ( " + ordini + " )\n" +
|
||||
" AND dtb_ordt.data_ord BETWEEN " + UtilityDB.valueToString(startDate) + " AND " + UtilityDB.valueToString(endDate) + "\n" +
|
||||
" AND dtb_ordr.cod_mart = " + UtilityDB.valueToString(codMart) + ") t\n" +
|
||||
"WHERE t.row_n = 1";
|
||||
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<ProdFabbisognoLineeProdDTO>>() {}.getType();
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.filters.FilterPosizioneLayoutView;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||
|
||||
public class ProdRiposizionamentoDaProdBindings {
|
||||
public static final int POSITIONS_FILTER_ID = 0;
|
||||
|
||||
public static final HashMap<Integer, FilterChipDTO> AVAILABLE_FILTERS = new HashMap<>() {{
|
||||
|
||||
put(POSITIONS_FILTER_ID, new FilterChipDTO()
|
||||
.setID(POSITIONS_FILTER_ID)
|
||||
.setFilterChipText("Posizione")
|
||||
.setFilterLayoutView(new FilterPosizioneLayoutView()));
|
||||
|
||||
}};
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod;
|
||||
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface ProdRiposizionamentoDaProdComponent {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
ProdRiposizionamentoDaProdComponent create();
|
||||
}
|
||||
|
||||
void inject(ProdRiposizionamentoDaProdFragment ProdRiposizionamentoDaProdFragment);
|
||||
}
|
||||
@@ -0,0 +1,355 @@
|
||||
package it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
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.annimon.stream.Stream;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
import com.ravikoradiya.liveadapter.Type;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.OnGeneralChangedCallback;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.interfaces.ISearchableFragment;
|
||||
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.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.databinding.FragmentProdRiposizionamentoDaProdBinding;
|
||||
import it.integry.integrywmsnative.databinding.ProdRiposizionamentoDaProdListItemBinding;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.filters.FilterPosizioneLayoutView;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dialogs.info_giacenza.DialogInfoGiacenzaView;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.ArtsInGiacenzaDTO;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.filter.ProdRiposizionamentoDaProdFilterViewModel;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterChipView;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_position_of_lu.DialogAskPositionOfLUView;
|
||||
|
||||
public class ProdRiposizionamentoDaProdFragment extends BaseFragment implements ISearchableFragment, ITitledFragment, ProdRiposizionamentoDaProdViewModel.Listener {
|
||||
|
||||
@Inject
|
||||
ProdRiposizionamentoDaProdViewModel mViewModel;
|
||||
private FragmentProdRiposizionamentoDaProdBinding mBindings;
|
||||
|
||||
private final ObservableArrayList<ArtsInGiacenzaDTO> mItemsInventario = new ObservableArrayList<>();
|
||||
private ProdRiposizionamentoDaProdFilterViewModel mFilterViewModel = new ProdRiposizionamentoDaProdFilterViewModel();
|
||||
private final Handler mHandler = new Handler();
|
||||
private final int mInterval = 120 * 1000; //2 minuti
|
||||
private int barcodeScannerIstanceID = -1;
|
||||
private AppCompatTextView mAppBarTitle;
|
||||
private String mTextFilter;
|
||||
|
||||
|
||||
public ProdRiposizionamentoDaProdFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static ProdRiposizionamentoDaProdFragment newInstance() {
|
||||
return new ProdRiposizionamentoDaProdFragment();
|
||||
}
|
||||
|
||||
@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_prod_riposizionamento_da_prod, container, false);
|
||||
|
||||
MainApplication.appComponent
|
||||
.prodRiposizionamentoDaprodComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
mViewModel.setListener(this);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
mBindings.setView(this);
|
||||
mBindings.setViewmodel(mViewModel);
|
||||
|
||||
mBindings.swiperefresh.setRefreshing(true);
|
||||
mBindings.swiperefresh.setOnRefreshListener(() -> {
|
||||
mViewModel.loadData();
|
||||
});
|
||||
|
||||
mHandler.postDelayed(mRunnable, mInterval);
|
||||
|
||||
this.initBarcodeReader();
|
||||
this.initRecyclerView();
|
||||
this.initFilters();
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
public void refreshList(List<ArtsInGiacenzaDTO> filteredList) {
|
||||
List<ArtsInGiacenzaDTO> tmpList;
|
||||
|
||||
if (filteredList != null) {
|
||||
tmpList = filteredList;
|
||||
} else if (mFilterViewModel != null) {
|
||||
mFilterViewModel.applyAllTests();
|
||||
tmpList = mFilterViewModel.getCurrentList().getValue();
|
||||
} else {
|
||||
tmpList = mViewModel.getItemsInventario().getValue();
|
||||
}
|
||||
this.mItemsInventario.clear();
|
||||
if (tmpList != null) {
|
||||
this.mItemsInventario.addAll(tmpList);
|
||||
}
|
||||
}
|
||||
|
||||
private void initRecyclerView() {
|
||||
mViewModel.getItemsInventario().observe(getViewLifecycleOwner(), data -> {
|
||||
mBindings.emptyView.setVisibility(data == null || data.isEmpty() ? View.VISIBLE : View.GONE);
|
||||
|
||||
mFilterViewModel.init(getFilteredList(mTextFilter));
|
||||
this.refreshList(null);
|
||||
});
|
||||
|
||||
var itemType = new Type<ArtsInGiacenzaDTO, ProdRiposizionamentoDaProdListItemBinding>(R.layout.prod_riposizionamento_da_prod__list_item, BR.item);
|
||||
|
||||
itemType.onBind(x -> {
|
||||
x.getBinding().setView(this);
|
||||
return null;
|
||||
});
|
||||
|
||||
itemType.areContentsTheSame((oldObject, newObject) ->
|
||||
oldObject.getCodMart().equalsIgnoreCase(newObject.getCodMart()) &&
|
||||
oldObject.getNumOrd().equals(newObject.getNumOrd()) &&
|
||||
oldObject.getDataOrd().equals(newObject.getDataOrd())
|
||||
);
|
||||
|
||||
itemType.areItemSame((oldObject, newObject) -> oldObject == newObject);
|
||||
|
||||
new LiveAdapter(mItemsInventario)
|
||||
.map(ArtsInGiacenzaDTO.class, itemType)
|
||||
.into(this.mBindings.inventarioList);
|
||||
}
|
||||
|
||||
private void initFilters() {
|
||||
var onPredicateChanged = new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
refreshList(null);
|
||||
}
|
||||
};
|
||||
|
||||
mFilterViewModel.getCurrentPositionPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
|
||||
for (var filterChipDTO : ProdRiposizionamentoDaProdBindings.AVAILABLE_FILTERS.entrySet()) {
|
||||
|
||||
FilterChipView filterChipView = new FilterChipView(
|
||||
requireActivity(),
|
||||
filterChipDTO.getValue().getFilterChipText(),
|
||||
v -> initBottomSheetDialogFilter(filterChipDTO.getValue()));
|
||||
|
||||
if (filterChipDTO.getKey() == ProdRiposizionamentoDaProdBindings.POSITIONS_FILTER_ID) {
|
||||
mFilterViewModel.getCurrentPositionPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mFilterViewModel.getCurrentPositionPredicate().get() == null) {
|
||||
filterChipView.disableCloseIcon();
|
||||
|
||||
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||
mBindings.filterChipsGroup.addView(filterChipView);
|
||||
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||
} else {
|
||||
filterChipView.enableCloseIcon();
|
||||
|
||||
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||
mBindings.filterChipsGroup.addView(filterChipView, 0);
|
||||
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
filterChipView.setOnResetClicked(() -> mFilterViewModel.getCurrentPositionPredicate().set(null));
|
||||
}
|
||||
this.mBindings.filterChipsGroup.addView(filterChipView);
|
||||
}
|
||||
}
|
||||
|
||||
private void initBottomSheetDialogFilter(FilterChipDTO filterChipDTO) {
|
||||
filterChipDTO
|
||||
.getFilterLayoutView()
|
||||
.setFilterName(filterChipDTO.getFilterChipText())
|
||||
.setContext(requireActivity());
|
||||
|
||||
var filterLayoutView = filterChipDTO
|
||||
.getFilterLayoutView();
|
||||
|
||||
if (filterChipDTO.getID() == ProdRiposizionamentoDaProdBindings.POSITIONS_FILTER_ID) {
|
||||
((FilterPosizioneLayoutView) filterLayoutView)
|
||||
.setAll(mFilterViewModel.getAllPosition())
|
||||
.setAvailable(mFilterViewModel.getAvailablePosition())
|
||||
.setOnFilterApplied(mFilterViewModel::setPositionFilter)
|
||||
.setPreselected(
|
||||
Stream.of(Objects.requireNonNull(mViewModel.getItemsInventario().getValue()))
|
||||
.filter(mFilterViewModel.getCurrentPositionPredicate().get() == null ?
|
||||
x -> false : Objects.requireNonNull(mFilterViewModel.getCurrentPositionPredicate().get()))
|
||||
.map(ArtsInGiacenzaDTO::getPosizione)
|
||||
.toList()
|
||||
);
|
||||
}
|
||||
|
||||
if (!filterLayoutView.isAdded())
|
||||
filterLayoutView.show(requireActivity().getSupportFragmentManager(), "TAG");
|
||||
|
||||
}
|
||||
|
||||
public void onInfoClick(ArtsInGiacenzaDTO item) {
|
||||
try {
|
||||
BarcodeManager.disable();
|
||||
DialogInfoGiacenzaView.newInstance(item).show(getChildFragmentManager(), DialogInfoGiacenzaView.class.getName());
|
||||
} catch (Exception e) {
|
||||
UtilityExceptions.defaultException(this.getContext(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private final Runnable mRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mBindings.swiperefresh.setRefreshing(true);
|
||||
mViewModel.loadData();
|
||||
mHandler.postDelayed(this, mInterval);
|
||||
}
|
||||
};
|
||||
|
||||
private void initBarcodeReader() {
|
||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessful(onScanSuccessful)
|
||||
.setOnScanFailed(ex -> UtilityExceptions.defaultException(getActivity(), ex, false)));
|
||||
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
mHandler.removeCallbacks(mRunnable);
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.processBarcodeDTO(data, this::onLoadingEnded);
|
||||
};
|
||||
|
||||
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 onSearchEnabled() {
|
||||
mAppBarTitle.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSearchDisabled() {
|
||||
mAppBarTitle.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
List<ArtsInGiacenzaDTO> originalList = this.mViewModel.getItemsInventario().getValue();
|
||||
if (originalList == null || originalList.isEmpty()) return false;
|
||||
mTextFilter = newText;
|
||||
List<ArtsInGiacenzaDTO> filteredOrders = getFilteredList(newText);
|
||||
|
||||
refreshList(filteredOrders);
|
||||
return true;
|
||||
}
|
||||
|
||||
private List<ArtsInGiacenzaDTO> getFilteredList(String newText) {
|
||||
List<ArtsInGiacenzaDTO> filteredOrders = new ArrayList<>();
|
||||
List<ArtsInGiacenzaDTO> originalList = this.mViewModel.getItemsInventario().getValue();
|
||||
if (originalList == null || originalList.isEmpty() || newText == null) return originalList;
|
||||
for (int i = 0; i < originalList.size(); i++) {
|
||||
if (originalList.get(i).getDescrizione().toLowerCase().contains(newText.toLowerCase())) {
|
||||
filteredOrders.add(originalList.get(i));
|
||||
}
|
||||
}
|
||||
return filteredOrders;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
mViewModel.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||
mHandler.removeCallbacks(mRunnable);
|
||||
mViewModel.setListener(null);
|
||||
|
||||
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
||||
onPreDestroy.run();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||
mAppBarTitle = titleText;
|
||||
mAppBarTitle.setText(context.getText(R.string.prod_riposizionamento_da_prod_title).toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInventoriesLoadingStarted() {
|
||||
mBindings.swiperefresh.setRefreshing(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInventoriesLoadingEnded() {
|
||||
mBindings.swiperefresh.setRefreshing(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInventoriesLoadingError(Exception ex) {
|
||||
mBindings.swiperefresh.setRefreshing(false);
|
||||
this.onError(ex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestChoosePosition(RunnableArgs<MtbDepoPosizione> onComplete) {
|
||||
choosePosition(onComplete);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataSaved() {
|
||||
mHandler.postDelayed(mRunnable, mInterval);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoAutomaticoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.sound.SoundAlertService;
|
||||
|
||||
@Module(subcomponents = ProdRiposizionamentoDaProdComponent.class)
|
||||
public class ProdRiposizionamentoDaProdModule {
|
||||
|
||||
@Provides
|
||||
ProdRiposizionamentoDaProdViewModel providesProdRiposizionamentoDaProdViewModel(GiacenzaRESTConsumer giacenzaRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, SoundAlertService soundAlertService) {
|
||||
return new ProdRiposizionamentoDaProdViewModel(giacenzaRESTConsumer, barcodeRESTConsumer, colliMagazzinoRESTConsumer, soundAlertService);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,298 @@
|
||||
package it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||
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.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.sound.SoundAlertService;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.ArtsInGiacenzaDTO;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.StatoArtInventarioDTO;
|
||||
|
||||
public class ProdRiposizionamentoDaProdViewModel {
|
||||
private final SoundAlertService mSoundAlertService;
|
||||
private final GiacenzaRESTConsumer mGiacenzaRESTConsumer;
|
||||
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
|
||||
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||
private final MutableLiveData<List<ArtsInGiacenzaDTO>> itemsInventario = new MutableLiveData<>();
|
||||
private final MutableLiveData<MtbColt> mtbColtMutableLiveData = new MutableLiveData<>();
|
||||
private final MutableLiveData<List<MvwSitArtUdcDetInventario>> mMvwSitArtUdcDetInventarioLiveData = new MutableLiveData<>();
|
||||
private final MutableLiveData<List<StatoArtInventarioDTO>> mStatoArticoli = new MutableLiveData<>();
|
||||
private Listener mListener;
|
||||
|
||||
public ProdRiposizionamentoDaProdViewModel(GiacenzaRESTConsumer giacenzaRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, SoundAlertService soundAlertService) {
|
||||
this.mGiacenzaRESTConsumer = giacenzaRESTConsumer;
|
||||
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||
this.mSoundAlertService = soundAlertService;
|
||||
}
|
||||
|
||||
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||
if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), true, onComplete);
|
||||
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||
this.executeEtichettaEan128(barcodeScanDTO, onComplete);
|
||||
} else {
|
||||
onComplete.run();
|
||||
}
|
||||
}
|
||||
|
||||
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO, Runnable onBarcodeScanComplete) {
|
||||
this.mBarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
||||
|
||||
String barcodeProd = null;
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Content))
|
||||
barcodeProd = ean128Model.Content;
|
||||
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
|
||||
this.executeEtichettaLU(ean128Model.Sscc, false, onBarcodeScanComplete);
|
||||
} else {
|
||||
this.mSoundAlertService.warning();
|
||||
this.sendError(new NoLUFoundException());
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
|
||||
onBarcodeScanComplete.run();
|
||||
}
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private void executeEtichettaLU(String sscc, boolean isAnonima, Runnable onComplete) {
|
||||
this.mColliMagazzinoRESTConsumer.getBySSCC(sscc, true, false, mtbColt -> {
|
||||
if (mtbColt == null && !isAnonima) {
|
||||
this.mSoundAlertService.warning();
|
||||
this.sendError(new NoLUFoundException());
|
||||
} else {
|
||||
List<MvwSitArtUdcDetInventario> mvwSitArtUdcDetInventario = Stream.of(Objects.requireNonNull(itemsInventario.getValue()))
|
||||
.flatMap(item -> Stream.of(item.getMvwSitArtUdcDetInventarioDTO()))
|
||||
.toList();
|
||||
|
||||
mMvwSitArtUdcDetInventarioLiveData.setValue(mvwSitArtUdcDetInventario);
|
||||
|
||||
List<StatoArtInventarioDTO> statoArticolo = Stream.of(Objects.requireNonNull(itemsInventario.getValue()))
|
||||
.flatMap(x -> Stream.of(x.getStatoArtInventario())
|
||||
.filter(Objects::nonNull))
|
||||
.toList();
|
||||
|
||||
mStatoArticoli.setValue(statoArticolo);
|
||||
|
||||
boolean isPresent = Stream.of(mvwSitArtUdcDetInventario)
|
||||
.anyMatch(x ->
|
||||
x.getGestione().equals(mtbColt.getGestione()) &&
|
||||
x.getDataCollo().isEqual(UtilityDate.toLocalDate(mtbColt.getDataColloD())) &&
|
||||
x.getSerCollo().equals(mtbColt.getSerCollo()) &&
|
||||
x.getNumCollo().equals(mtbColt.getNumCollo()));
|
||||
|
||||
if (isPresent && mtbColt != null) {
|
||||
this.mSoundAlertService.success();
|
||||
mtbColt.setDisablePrint(true);
|
||||
onComplete.run();
|
||||
this.onLUOpened(mtbColt);
|
||||
} else {
|
||||
this.mSoundAlertService.warning();
|
||||
this.sendError(new NoLUFoundException());
|
||||
}
|
||||
}
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private void onLUOpened(MtbColt mtbColt) {
|
||||
this.mtbColtMutableLiveData.setValue(mtbColt);
|
||||
this.sendRequestChoosePosition(this::setPosizione);
|
||||
}
|
||||
|
||||
public void setPosizione(MtbDepoPosizione mtbDepoPosizione) {
|
||||
MtbColt mtbColt = mtbColtMutableLiveData.getValue();
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
if (mtbDepoPosizione == null) {
|
||||
//Nessuna posizione trovata con questo barcode
|
||||
this.sendError(new ScannedPositionNotExistException());
|
||||
} else {
|
||||
if (mtbColt != null) {
|
||||
mColliMagazzinoRESTConsumer.changePosizione(mtbColt, mtbDepoPosizione, () -> {
|
||||
List<MvwSitArtUdcDetInventario> mvwSitArtUdcDetInventarioList = mMvwSitArtUdcDetInventarioLiveData.getValue();
|
||||
|
||||
if (mvwSitArtUdcDetInventarioList != null) {
|
||||
Optional<MvwSitArtUdcDetInventario> mvwSitArtUdcDetInventario = Stream.of(mvwSitArtUdcDetInventarioList)
|
||||
.filter(x ->
|
||||
x.getGestione().equals(mtbColt.getGestione()) &&
|
||||
x.getDataCollo().isEqual(UtilityDate.toLocalDate(mtbColt.getDataColloD())) &&
|
||||
x.getSerCollo().equals(mtbColt.getSerCollo()) &&
|
||||
x.getNumCollo().equals(mtbColt.getNumCollo()))
|
||||
.findFirst();
|
||||
|
||||
mvwSitArtUdcDetInventario.ifPresent(mvwSitArtUdcDetInventarioList::remove);
|
||||
|
||||
Map<String, List<MvwSitArtUdcDetInventario>> groupedByCodMartAndPartitaMag =
|
||||
mvwSitArtUdcDetInventarioList.stream()
|
||||
.collect(Collectors.groupingBy(dto -> dto.getCodMart() + dto.getPartitaMag()));
|
||||
|
||||
List<ArtsInGiacenzaDTO> artsInGiacenza = Stream.of(groupedByCodMartAndPartitaMag.entrySet())
|
||||
.map(entry -> {
|
||||
List<MvwSitArtUdcDetInventario> dtoList = entry.getValue();
|
||||
|
||||
BigDecimal totalNumCnf = dtoList.stream()
|
||||
.map(MvwSitArtUdcDetInventario::getNumCnf)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
List<StatoArtInventarioDTO> statoArticoli = mStatoArticoli.getValue();
|
||||
|
||||
if (statoArticoli == null)
|
||||
statoArticoli = new ArrayList<>();
|
||||
|
||||
StatoArtInventarioDTO statoArticolo = Stream.of(statoArticoli)
|
||||
.filter(x -> x.getCodProd().equalsIgnoreCase(dtoList.get(0).getCodMart()) &&
|
||||
Objects.equals(x.getNumOrd(), dtoList.get(0).getNumOrd()) &&
|
||||
Objects.equals(x.getDataOrd(), dtoList.get(0).getDataOrd())
|
||||
)
|
||||
.findFirstOrElse(new StatoArtInventarioDTO());
|
||||
|
||||
MvwSitArtUdcDetInventario mvwInventario = mvwSitArtUdcDetInventario.get();
|
||||
|
||||
if (mvwInventario.getCodMart().equalsIgnoreCase(dtoList.get(0).getCodMart()) &&
|
||||
Objects.equals(mvwInventario.getNumOrd(), dtoList.get(0).getNumOrd()) &&
|
||||
Objects.equals(mvwInventario.getDataOrd(), dtoList.get(0).getDataOrd())) {
|
||||
BigDecimal colliMag = statoArticolo.getColliMag();
|
||||
Integer pedMag = statoArticolo.getPedMag();
|
||||
BigDecimal qtaMag = statoArticolo.getQtaMag();
|
||||
|
||||
BigDecimal numCnf = mvwInventario.getNumCnf();
|
||||
BigDecimal qtaCol = mvwInventario.getQtaCol();
|
||||
|
||||
statoArticolo.setColliMag(colliMag.add(numCnf));
|
||||
statoArticolo.setQtaMag(qtaMag.add(qtaCol));
|
||||
statoArticolo.setPedMag(pedMag + 1);
|
||||
}
|
||||
|
||||
return new ArtsInGiacenzaDTO()
|
||||
.setCodMart(dtoList.get(0).getCodMart())
|
||||
.setPartitaMag(dtoList.get(0).getPartitaMag())
|
||||
.setPosizione(dtoList.get(0).getPosizione())
|
||||
.setDescrizione(dtoList.get(0).getDescrizioneEstesa())
|
||||
.setNumOrd(dtoList.get(0).getNumOrd())
|
||||
.setNumCnf(totalNumCnf)
|
||||
.setCount(dtoList.size())
|
||||
.setStatoArtInventario(statoArticolo)
|
||||
.setMvwSitArtUdcDetInventarioDTO(dtoList);
|
||||
})
|
||||
.sorted(Comparator.comparing(ArtsInGiacenzaDTO::getPosizione))
|
||||
.toList();
|
||||
|
||||
itemsInventario.postValue(artsInGiacenza);
|
||||
this.sendOnLoadingEnded();
|
||||
this.sendOnDataSaved();
|
||||
}
|
||||
}, this::sendError);
|
||||
} else {
|
||||
this.mSoundAlertService.warning();
|
||||
this.sendError(new NoLUFoundException());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void init() {
|
||||
loadData();
|
||||
}
|
||||
|
||||
public void loadData() {
|
||||
List<String> posizioni = Arrays.asList(SettingsManager.iDB().getViewPosizioni().split("\\|"));
|
||||
|
||||
this.mGiacenzaRESTConsumer.getGiacenzeInPosizione(posizioni, true, availableItems -> {
|
||||
availableItems = Stream.of(availableItems)
|
||||
.sorted(Comparator.comparing(ArtsInGiacenzaDTO::getPosizione))
|
||||
.toList();
|
||||
|
||||
itemsInventario.postValue(availableItems);
|
||||
this.sendOnInventoriesLoadingEnded();
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
public MutableLiveData<List<ArtsInGiacenzaDTO>> getItemsInventario() {
|
||||
return itemsInventario;
|
||||
}
|
||||
|
||||
private void sendOnLoadingStarted() {
|
||||
if (this.mListener != null) mListener.onLoadingStarted();
|
||||
}
|
||||
|
||||
private void sendOnLoadingEnded() {
|
||||
if (this.mListener != null) mListener.onLoadingEnded();
|
||||
}
|
||||
|
||||
private void sendError(Exception ex) {
|
||||
if (this.mListener != null) mListener.onError(ex);
|
||||
}
|
||||
|
||||
private void sendOnInventoriesLoadingStarted() {
|
||||
if (this.mListener != null) mListener.onInventoriesLoadingStarted();
|
||||
}
|
||||
|
||||
private void sendOnInventoriesLoadingEnded() {
|
||||
if (this.mListener != null) mListener.onInventoriesLoadingEnded();
|
||||
}
|
||||
|
||||
private void sendOnInventoriesLoadingError(Exception ex) {
|
||||
if (this.mListener != null) mListener.onInventoriesLoadingError(ex);
|
||||
}
|
||||
|
||||
private void sendRequestChoosePosition(RunnableArgs<MtbDepoPosizione> onComplete) {
|
||||
if (this.mListener != null) mListener.onRequestChoosePosition(onComplete);
|
||||
}
|
||||
|
||||
private void sendOnDataSaved() {
|
||||
if (this.mListener != null) mListener.onDataSaved();
|
||||
}
|
||||
|
||||
public void setListener(Listener listener) {
|
||||
this.mListener = listener;
|
||||
}
|
||||
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
void onError(Exception ex);
|
||||
|
||||
void onInventoriesLoadingStarted();
|
||||
|
||||
void onInventoriesLoadingEnded();
|
||||
|
||||
void onInventoriesLoadingError(Exception ex);
|
||||
|
||||
void onRequestChoosePosition(RunnableArgs<MtbDepoPosizione> onComplete);
|
||||
|
||||
void onDataSaved();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dialogs.info_giacenza;
|
||||
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface DialogInfoGiacenzaComponent {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
DialogInfoGiacenzaComponent create();
|
||||
}
|
||||
|
||||
void inject(DialogInfoGiacenzaView dialogInfoGiacenzaView);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dialogs.info_giacenza;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = DialogInfoGiacenzaComponent.class)
|
||||
public class DialogInfoGiacenzaModule {
|
||||
|
||||
@Provides
|
||||
DialogInfoGiacenzaViewModel providesDialogInfoGiacenzaViewModel() {
|
||||
return new DialogInfoGiacenzaViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dialogs.info_giacenza;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
|
||||
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.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.databinding.DialogInfoGiacenzaBinding;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.ArtsInGiacenzaDTO;
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.StatoArtInventarioDTO;
|
||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.info_situazione_articolo.ui.DialogInfoSituazioneArticoloAvailableListItem;
|
||||
|
||||
public class DialogInfoGiacenzaView extends BaseDialogFragment {
|
||||
@Inject
|
||||
DialogInfoGiacenzaViewModel mViewModel;
|
||||
|
||||
private DialogInfoGiacenzaBinding mBindings;
|
||||
private final ArtsInGiacenzaDTO item;
|
||||
|
||||
public static DialogInfoGiacenzaView newInstance(ArtsInGiacenzaDTO item) {
|
||||
return new DialogInfoGiacenzaView(item);
|
||||
}
|
||||
|
||||
public DialogInfoGiacenzaView(ArtsInGiacenzaDTO item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
Context mContext = requireContext();
|
||||
|
||||
mBindings = DialogInfoGiacenzaBinding.inflate(LayoutInflater.from(mContext), null, false);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
|
||||
MainApplication.appComponent
|
||||
.dialogInfoGiacenzaComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
setCancelable(true);
|
||||
|
||||
var alertDialog = new MaterialAlertDialogBuilder(mContext)
|
||||
.setView(mBindings.getRoot())
|
||||
.setNeutralButton(R.string.action_close, null)
|
||||
.setCancelable(isCancelable())
|
||||
.create();
|
||||
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
alertDialog.setOnShowListener(this);
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShow(DialogInterface dialogInterface) {
|
||||
super.onShow(dialogInterface);
|
||||
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.initAvailableItemsList(item);
|
||||
|
||||
this.onLoadingEnded();
|
||||
}
|
||||
|
||||
private void initAvailableItemsList(ArtsInGiacenzaDTO availableItems) {
|
||||
if (availableItems == null)
|
||||
return;
|
||||
|
||||
StatoArtInventarioDTO statoArtInventario = availableItems.getStatoArtInventario();
|
||||
if (statoArtInventario != null) {
|
||||
if (statoArtInventario.colliArrivoIsLessThenZero() &&
|
||||
statoArtInventario.colliMagIsLessThenZero()) {
|
||||
this.mBindings.situazioneArticolo.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
this.mBindings.situazioneArticolo.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
new LiveAdapter(this.item.getSituazioneArticoloAvailableListItem(), BR.item)
|
||||
.map(DialogInfoSituazioneArticoloAvailableListItem.class, R.layout.dialog_info_giacenza_list_item)
|
||||
.into(this.mBindings.availableList);
|
||||
|
||||
new LiveAdapter(this.item.getStatoInventario(), BR.item)
|
||||
.map(StatoArtInventarioDTO.class, R.layout.dialog_info_giacenza_situazione_articolo)
|
||||
.into(this.mBindings.situazioneArticolo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingStarted() {
|
||||
this.mBindings.loadingView.setVisibility(View.VISIBLE);
|
||||
this.mBindings.listItem.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingEnded() {
|
||||
this.mBindings.loadingView.setVisibility(View.GONE);
|
||||
this.mBindings.listItem.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dialogs.info_giacenza;
|
||||
|
||||
public class DialogInfoGiacenzaViewModel {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.info_situazione_articolo.ui.DialogInfoSituazioneArticoloAvailableListItem;
|
||||
|
||||
public class ArtsInGiacenzaDTO {
|
||||
|
||||
private String codMart;
|
||||
private String partitaMag;
|
||||
private String descrizione;
|
||||
private String posizione;
|
||||
private BigDecimal numCnf;
|
||||
private Integer numOrd;
|
||||
private Date dataOrd;
|
||||
private Integer count;
|
||||
private StatoArtInventarioDTO statoArtInventario;
|
||||
private List<MvwSitArtUdcDetInventario> mvwSitArtUdcDetInventarioDTO;
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public ArtsInGiacenzaDTO setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public ArtsInGiacenzaDTO setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPosizione() {
|
||||
return posizione;
|
||||
}
|
||||
|
||||
public ArtsInGiacenzaDTO setPosizione(String posizione) {
|
||||
this.posizione = posizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNumCnf() {
|
||||
return numCnf;
|
||||
}
|
||||
|
||||
public ArtsInGiacenzaDTO setNumCnf(BigDecimal numCnf) {
|
||||
this.numCnf = numCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public ArtsInGiacenzaDTO setCount(Integer count) {
|
||||
this.count = count;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MvwSitArtUdcDetInventario> getMvwSitArtUdcDetInventarioDTO() {
|
||||
return mvwSitArtUdcDetInventarioDTO;
|
||||
}
|
||||
|
||||
public ArtsInGiacenzaDTO setMvwSitArtUdcDetInventarioDTO(List<MvwSitArtUdcDetInventario> mvwSitArtUdcDetInventarioDTO) {
|
||||
this.mvwSitArtUdcDetInventarioDTO = mvwSitArtUdcDetInventarioDTO;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public ArtsInGiacenzaDTO setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumOrd() {
|
||||
return numOrd;
|
||||
}
|
||||
|
||||
public String getNumOrdS() {
|
||||
if (numOrd == null) return "/";
|
||||
return numOrd.toString();
|
||||
}
|
||||
|
||||
public ArtsInGiacenzaDTO setNumOrd(Integer numOrd) {
|
||||
this.numOrd = numOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO getStatoArtInventario() {
|
||||
return statoArtInventario;
|
||||
}
|
||||
|
||||
public ArtsInGiacenzaDTO setStatoArtInventario(StatoArtInventarioDTO statoArtInventario) {
|
||||
this.statoArtInventario = statoArtInventario;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public ArtsInGiacenzaDTO setDataOrd(Date dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<DialogInfoSituazioneArticoloAvailableListItem> getSituazioneArticoloAvailableListItem() {
|
||||
return Stream.of(this)
|
||||
.flatMap(x -> Stream.of(x.getMvwSitArtUdcDetInventarioDTO())
|
||||
.map(DialogInfoSituazioneArticoloAvailableListItem::fromMvwSitArtUdcDetInventario)
|
||||
)
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<StatoArtInventarioDTO> getStatoInventario(){
|
||||
return Stream.of(this.statoArtInventario).toList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
package it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
public class StatoArtInventarioDTO {
|
||||
private String codProd;
|
||||
private Integer numOrd;
|
||||
private Date dataOrd;
|
||||
private String untMis;
|
||||
private BigDecimal qtaProd;
|
||||
private BigDecimal colliProd;
|
||||
private BigDecimal pedProd;
|
||||
private BigDecimal qtaInArrivo;
|
||||
private BigDecimal colliArrivo;
|
||||
private BigDecimal pedArrivo;
|
||||
private BigDecimal qtaLinea;
|
||||
private BigDecimal colliLinea;
|
||||
private Integer pedLinea;
|
||||
private BigDecimal qtaMag;
|
||||
private BigDecimal colliMag;
|
||||
private Integer pedMag;
|
||||
|
||||
public String getCodProd() {
|
||||
return codProd;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO setCodProd(String codProd) {
|
||||
this.codProd = codProd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumOrd() {
|
||||
return numOrd;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO setNumOrd(Integer numOrd) {
|
||||
this.numOrd = numOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO setUntMis(String untMis) {
|
||||
this.untMis = untMis;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaProd() {
|
||||
return qtaProd;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO setQtaProd(BigDecimal qtaProd) {
|
||||
this.qtaProd = qtaProd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getColliProd() {
|
||||
return colliProd;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO setColliProd(BigDecimal colliProd) {
|
||||
this.colliProd = colliProd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getPedProd() {
|
||||
return pedProd;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO setPedProd(BigDecimal pedProd) {
|
||||
this.pedProd = pedProd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaInArrivo() {
|
||||
return qtaInArrivo;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO setQtaInArrivo(BigDecimal qtaInArrivo) {
|
||||
this.qtaInArrivo = qtaInArrivo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getColliArrivo() {
|
||||
return colliArrivo;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO setColliArrivo(BigDecimal colliArrivo) {
|
||||
this.colliArrivo = colliArrivo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getPedArrivo() {
|
||||
if (pedArrivo.compareTo(BigDecimal.ZERO) < 0)
|
||||
return BigDecimal.ZERO;
|
||||
else
|
||||
return pedArrivo;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO setPedArrivo(BigDecimal pedArrivo) {
|
||||
this.pedArrivo = pedArrivo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaLinea() {
|
||||
return qtaLinea;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO setQtaLinea(BigDecimal qtaLinea) {
|
||||
this.qtaLinea = qtaLinea;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getColliLinea() {
|
||||
return colliLinea;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO setColliLinea(BigDecimal colliLinea) {
|
||||
this.colliLinea = colliLinea;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getPedLinea() {
|
||||
return pedLinea;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO setPedLinea(Integer pedLinea) {
|
||||
this.pedLinea = pedLinea;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaMag() {
|
||||
return qtaMag;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO setQtaMag(BigDecimal qtaMag) {
|
||||
this.qtaMag = qtaMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getColliMag() {
|
||||
return colliMag;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO setColliMag(BigDecimal colliMag) {
|
||||
this.colliMag = colliMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getPedMag() {
|
||||
if (pedMag == null || pedMag < 0)
|
||||
return 0;
|
||||
else
|
||||
return pedMag;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO setPedMag(Integer pedMag) {
|
||||
this.pedMag = pedMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public StatoArtInventarioDTO setDataOrd(Date dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean colliArrivoIsLessThenZero(){
|
||||
return this.colliArrivo.compareTo(BigDecimal.ZERO) <= 0;
|
||||
}
|
||||
|
||||
public boolean colliMagIsLessThenZero(){
|
||||
return this.colliMag.compareTo(BigDecimal.ZERO) <= 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.filter;
|
||||
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.annimon.stream.function.Predicate;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto.ArtsInGiacenzaDTO;
|
||||
|
||||
public class ProdRiposizionamentoDaProdFilterViewModel {
|
||||
private final ObservableField<Predicate<ArtsInGiacenzaDTO>> currentPositionPredicate = new ObservableField<>();
|
||||
|
||||
private List<ArtsInGiacenzaDTO> initialList;
|
||||
private final MutableLiveData<List<ArtsInGiacenzaDTO>> currentList = new MutableLiveData<>();
|
||||
|
||||
public void init(List<ArtsInGiacenzaDTO> initialList){
|
||||
this.initialList = initialList;
|
||||
this.currentList.setValue(this.initialList);
|
||||
}
|
||||
|
||||
public MutableLiveData<List<ArtsInGiacenzaDTO>> getCurrentList() {
|
||||
return currentList;
|
||||
}
|
||||
|
||||
public void setPositionFilter(List<String> positions){
|
||||
if (positions == null || positions.isEmpty()) currentPositionPredicate.set(null);
|
||||
else{
|
||||
currentPositionPredicate.set(x -> positions.contains(x.getPosizione()));
|
||||
}
|
||||
}
|
||||
|
||||
public void applyAllTests(){
|
||||
List<ArtsInGiacenzaDTO> returnList = null;
|
||||
|
||||
if (currentPositionPredicate.get() == null){
|
||||
returnList = this.initialList;
|
||||
}else {
|
||||
Stream<ArtsInGiacenzaDTO> tmpStream = Stream.of(this.initialList)
|
||||
.filter(x -> (currentPositionPredicate.get() == null || (Objects.requireNonNull(currentPositionPredicate.get()).test(x))));
|
||||
returnList = tmpStream.toList();
|
||||
}
|
||||
|
||||
this.currentList.setValue(returnList);
|
||||
}
|
||||
|
||||
public ObservableField<Predicate<ArtsInGiacenzaDTO>> getCurrentPositionPredicate() {
|
||||
return currentPositionPredicate;
|
||||
}
|
||||
|
||||
public List<String> getAllPosition(){
|
||||
return Stream
|
||||
.of(initialList)
|
||||
.filter(x -> x.getPosizione() != null)
|
||||
.sortBy(ArtsInGiacenzaDTO::getPosizione)
|
||||
.map(ArtsInGiacenzaDTO::getPosizione)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<String> getAvailablePosition(){
|
||||
if (currentPositionPredicate.get() == null) return getAllPosition();
|
||||
else {
|
||||
return Stream.of(this.initialList)
|
||||
.map(ArtsInGiacenzaDTO::getPosizione)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,10 @@ package it.integry.integrywmsnative.gest.prod_versamento_materiale.dto;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.di.BindableFloat;
|
||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
|
||||
public class OrdineLavorazioneDTO {
|
||||
@@ -101,6 +103,7 @@ public class OrdineLavorazioneDTO {
|
||||
private Object mtbColtToEdit;
|
||||
|
||||
private int hrNum;
|
||||
private List<AvailableClassMerc> availableClassMerc;
|
||||
|
||||
|
||||
private BindableFloat qtaColVersamento = new BindableFloat();
|
||||
@@ -533,4 +536,37 @@ public class OrdineLavorazioneDTO {
|
||||
this.descrizioneAttivita = descrizioneAttivita;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<AvailableClassMerc> getAvailableClassMerc() {
|
||||
return availableClassMerc;
|
||||
}
|
||||
|
||||
public OrdineLavorazioneDTO setAvailableClassMerc(List<AvailableClassMerc> availableClassMerc) {
|
||||
this.availableClassMerc = availableClassMerc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static class AvailableClassMerc {
|
||||
|
||||
private String codMgrp;
|
||||
private List<String> codMsgr;
|
||||
|
||||
public String getCodMgrp() {
|
||||
return codMgrp;
|
||||
}
|
||||
|
||||
public AvailableClassMerc setCodMgrp(String codMgrp) {
|
||||
this.codMgrp = codMgrp;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getCodMsgr() {
|
||||
return codMsgr;
|
||||
}
|
||||
|
||||
public AvailableClassMerc setCodMsgr(List<String> codMsgr) {
|
||||
this.codMsgr = codMsgr;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user