Finish v1.39.02(415)
This commit is contained in:
commit
a0c9c40ab5
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>
|
||||
3
.idea/deploymentTargetDropDown.xml
generated
3
.idea/deploymentTargetDropDown.xml
generated
@ -2,6 +2,9 @@
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<value>
|
||||
<entry key="Prod_Android.WMS.app">
|
||||
<State />
|
||||
</entry>
|
||||
<entry key="app">
|
||||
<State />
|
||||
</entry>
|
||||
|
||||
97
.idea/fileTemplates/Android Activity.java
generated
Normal file
97
.idea/fileTemplates/Android Activity.java
generated
Normal file
@ -0,0 +1,97 @@
|
||||
#set( $regex = "([a-z])([A-Z]+)")
|
||||
#set( $replacement = "$1_$2")
|
||||
#set( $dashName = $NAME.replaceAll($regex, $replacement).toLowerCase())
|
||||
#set( $variableName = $NAME.replace($NAME.substring(0, 1), $NAME.substring(0, 1).toLowerCase()))
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||
|
||||
public class ${NAME}Activity extends BaseActivity {
|
||||
|
||||
/*
|
||||
- Create the following layout resource file [activity_${dashName}.xml]
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
|
||||
<data>
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
|
||||
|
||||
|
||||
|
||||
- Create an entry in AndroidManifest.xml
|
||||
Fix the android:name tag with current path
|
||||
|
||||
<activity
|
||||
android:name="${NAME}Activity"
|
||||
android:label="@string/activity_${dashName}_title"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Light" />
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@Inject
|
||||
${NAME}ViewModel mViewModel;
|
||||
|
||||
//private Activity${NAME}Binding mBindings;
|
||||
|
||||
//Pass here all external parameters
|
||||
public static void startActivity(Context context) {
|
||||
Intent myIntent = new Intent(context, ${NAME}Activity.class);
|
||||
|
||||
//String keyExtraItem = DataCache.addItem(var);
|
||||
//myIntent.putExtra("keyExtraItem", keyExtraItem);
|
||||
|
||||
context.startActivity(myIntent);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
//mBindings = DataBindingUtil.setContentView(this, R.layout.activity_${dashName});
|
||||
//mBindings.setLifecycleOwner(this);
|
||||
|
||||
|
||||
/*
|
||||
- Add following lines into MainApplicationComponent
|
||||
|
||||
[a] into @Component
|
||||
${NAME}Module.class
|
||||
|
||||
[b] into interface body
|
||||
${NAME}Component.Factory ${variableName}Component();
|
||||
*/
|
||||
MainApplication.appComponent
|
||||
.${variableName}Component()
|
||||
.create()
|
||||
.inject(this);
|
||||
}
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Activity.java.child.0.java
generated
Normal file
12
.idea/fileTemplates/Android Activity.java.child.0.java
generated
Normal file
@ -0,0 +1,12 @@
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = ${NAME}Component.class)
|
||||
public class ${NAME}Module {
|
||||
|
||||
@Provides
|
||||
${NAME}ViewModel provides${NAME}ViewModel() {
|
||||
return new ${NAME}ViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Activity.java.child.1.java
generated
Normal file
12
.idea/fileTemplates/Android Activity.java.child.1.java
generated
Normal file
@ -0,0 +1,12 @@
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface ${NAME}Component {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
${NAME}Component create();
|
||||
}
|
||||
|
||||
void inject(${NAME}Activity ${NAME}Activity);
|
||||
}
|
||||
3
.idea/fileTemplates/Android Activity.java.child.2.java
generated
Normal file
3
.idea/fileTemplates/Android Activity.java.child.2.java
generated
Normal file
@ -0,0 +1,3 @@
|
||||
public class ${NAME}ViewModel {
|
||||
|
||||
}
|
||||
125
.idea/fileTemplates/Android Dialog.java
generated
Normal file
125
.idea/fileTemplates/Android Dialog.java
generated
Normal file
@ -0,0 +1,125 @@
|
||||
#set( $regex = "([a-z])([A-Z]+)")
|
||||
#set( $replacement = "$1_$2")
|
||||
#set( $dashName = $NAME.replaceAll($regex, $replacement).toLowerCase())
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
|
||||
public class Dialog${NAME}View extends BaseDialogFragment {
|
||||
|
||||
/*
|
||||
Create the following layout resource file [dialog_${dashName}.xml]
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="16dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
style="@style/MaterialAlertDialog.Material3.Title.Icon.CenterStacked"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:src="@drawable/ic_error_white_24dp"
|
||||
app:tint="?colorPrimary" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/title_text"
|
||||
style="@style/MaterialAlertDialog.Material3.Title.Text.CenterStacked"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="Title here" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/description_text"
|
||||
style="@style/TextAppearance.Material3.BodyMedium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="Description here" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</layout>
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@Inject
|
||||
Dialog${NAME}ViewModel mViewModel;
|
||||
|
||||
//private Dialog${NAME}Binding mBindings;
|
||||
private Context mContext;
|
||||
|
||||
//Pass here all external parameters
|
||||
public static Dialog${NAME}View newInstance() {
|
||||
return new Dialog${NAME}View();
|
||||
}
|
||||
|
||||
private Dialog${NAME}View() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
this.mContext = requireContext();
|
||||
|
||||
//mBindings = Dialog${NAME}Binding.inflate(LayoutInflater.from(this.mContext), null, false);
|
||||
//mBindings.setLifecycleOwner(this);
|
||||
|
||||
|
||||
/*
|
||||
- Add following lines into MainApplicationComponent
|
||||
|
||||
[a] into @Component
|
||||
Dialog${NAME}Module.class
|
||||
|
||||
[b] into interface body
|
||||
Dialog${NAME}Component.Factory dialog${NAME}Component();
|
||||
*/
|
||||
MainApplication.appComponent
|
||||
.dialog${NAME}Component()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
setCancelable(false);
|
||||
|
||||
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
|
||||
.setView(mBindings.getRoot())
|
||||
.setCancelable(isCancelable())
|
||||
.create();
|
||||
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
alertDialog.setOnShowListener(this);
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Dialog.java.child.0.java
generated
Normal file
12
.idea/fileTemplates/Android Dialog.java.child.0.java
generated
Normal file
@ -0,0 +1,12 @@
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = Dialog${NAME}Component.class)
|
||||
public class Dialog${NAME}Module {
|
||||
|
||||
@Provides
|
||||
Dialog${NAME}ViewModel providesDialog${NAME}ViewModel() {
|
||||
return new Dialog${NAME}ViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Dialog.java.child.1.java
generated
Normal file
12
.idea/fileTemplates/Android Dialog.java.child.1.java
generated
Normal file
@ -0,0 +1,12 @@
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface Dialog${NAME}Component {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
Dialog${NAME}Component create();
|
||||
}
|
||||
|
||||
void inject(Dialog${NAME}View dialog${NAME}View);
|
||||
}
|
||||
3
.idea/fileTemplates/Android Dialog.java.child.2.java
generated
Normal file
3
.idea/fileTemplates/Android Dialog.java.child.2.java
generated
Normal file
@ -0,0 +1,3 @@
|
||||
public class Dialog${NAME}ViewModel {
|
||||
|
||||
}
|
||||
82
.idea/fileTemplates/Android Fragment.java
generated
Normal file
82
.idea/fileTemplates/Android Fragment.java
generated
Normal file
@ -0,0 +1,82 @@
|
||||
#set( $regex = "([a-z])([A-Z]+)")
|
||||
#set( $replacement = "$1_$2")
|
||||
#set( $dashName = $NAME.replaceAll($regex, $replacement).toLowerCase())
|
||||
#set( $variableName = $NAME.replace($NAME.substring(0, 1), $NAME.substring(0, 1).toLowerCase()))
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
|
||||
public class ${NAME}Fragment extends BaseFragment {
|
||||
|
||||
/*
|
||||
- Create the following layout resource file [fragment_${dashName}.xml]
|
||||
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
|
||||
<data>
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@Inject
|
||||
${NAME}ViewModel mViewModel;
|
||||
|
||||
//private Fragment${NAME}Binding mBindings;
|
||||
|
||||
|
||||
public ${NAME}Fragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static ${NAME}Fragment newInstance() {
|
||||
return new ${NAME}Fragment();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
setRetainInstance(true);
|
||||
|
||||
//mBindings = Fragment${NAME}Binding.inflate(inflater, container, false);
|
||||
//mBindings.setLifecycleOwner(this);
|
||||
|
||||
|
||||
/*
|
||||
- Add following lines into MainApplicationComponent
|
||||
|
||||
[a] into @Component
|
||||
${NAME}Module.class
|
||||
|
||||
[b] into interface body
|
||||
${NAME}Component.Factory ${variableName}Component();
|
||||
*/
|
||||
MainApplication.appComponent
|
||||
.${variableName}Component()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
}
|
||||
3
.idea/fileTemplates/Android Fragment.java.child.0.java
generated
Normal file
3
.idea/fileTemplates/Android Fragment.java.child.0.java
generated
Normal file
@ -0,0 +1,3 @@
|
||||
public class ${NAME}ViewModel {
|
||||
|
||||
}
|
||||
12
.idea/fileTemplates/Android Fragment.java.child.1.java
generated
Normal file
12
.idea/fileTemplates/Android Fragment.java.child.1.java
generated
Normal file
@ -0,0 +1,12 @@
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface ${NAME}Component {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
${NAME}Component create();
|
||||
}
|
||||
|
||||
void inject(${NAME}Fragment ${NAME}Fragment);
|
||||
}
|
||||
12
.idea/fileTemplates/Android Fragment.java.child.2.java
generated
Normal file
12
.idea/fileTemplates/Android Fragment.java.child.2.java
generated
Normal file
@ -0,0 +1,12 @@
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = ${NAME}Component.class)
|
||||
public class ${NAME}Module {
|
||||
|
||||
@Provides
|
||||
${NAME}ViewModel provides${NAME}ViewModel() {
|
||||
return new ${NAME}ViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
2
.idea/runConfigurations/app.xml
generated
2
.idea/runConfigurations/app.xml
generated
@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="app" type="AndroidRunConfigurationType" factoryName="Android App">
|
||||
<module name="WMS.app.main" />
|
||||
<module name="WMS_Native.app.main" />
|
||||
<option name="DEPLOY" value="true" />
|
||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
|
||||
@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 407
|
||||
def appVersionName = '1.36.14'
|
||||
def appVersionCode = 415
|
||||
def appVersionName = '1.39.02'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@ -25,8 +25,8 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.all { output ->
|
||||
applicationVariants.configureEach { variant ->
|
||||
variant.outputs.configureEach { output ->
|
||||
output.outputFileName = "android-release.apk"
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,6 +67,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;
|
||||
@ -200,7 +204,9 @@ 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
|
||||
})
|
||||
public interface MainApplicationComponent {
|
||||
|
||||
@ -336,6 +342,10 @@ public interface MainApplicationComponent {
|
||||
|
||||
DialogAskLineaProdComponent.Factory dialogAskLineaProdComponent();
|
||||
|
||||
ProdRiposizionamentoDaProdComponent.Factory prodRiposizionamentoDaprodComponent();
|
||||
|
||||
DialogInfoGiacenzaComponent.Factory dialogInfoGiacenzaComponent();
|
||||
|
||||
void inject(MainApplication mainApplication);
|
||||
|
||||
void inject(AppContext mainApplication);
|
||||
|
||||
@ -16,6 +16,7 @@ import it.integry.integrywmsnative.core.context.AppContext;
|
||||
import it.integry.integrywmsnative.core.context.MainContext;
|
||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
||||
import it.integry.integrywmsnative.core.ean128.Ean128Service;
|
||||
import it.integry.integrywmsnative.core.menu.MenuRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.menu.MenuService;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
@ -43,6 +44,7 @@ import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsum
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.services.inventario.InventarioService;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.sound.SoundAlertService;
|
||||
import it.integry.integrywmsnative.core.update.UpdatesManager;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.rest.DocInterniRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
||||
@ -102,6 +104,12 @@ public class MainApplicationModule {
|
||||
return colliDataRecoverService;
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
Ean128Service provideEan128Service() {
|
||||
return new Ean128Service();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MenuService provideMenuService(MenuRESTConsumer menuRESTConsumer) {
|
||||
@ -197,8 +205,8 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
BarcodeRESTConsumer provideBarcodeRESTConsumer() {
|
||||
return new BarcodeRESTConsumer();
|
||||
BarcodeRESTConsumer provideBarcodeRESTConsumer(Ean128Service ean128Service) {
|
||||
return new BarcodeRESTConsumer(ean128Service);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@ -291,4 +299,12 @@ public class MainApplicationModule {
|
||||
return new MagazzinoBufferRESTConsumer();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
SoundAlertService provideSoundAlertService() {
|
||||
SoundAlertService soundAlertService = new SoundAlertService(mApplication.getApplicationContext());
|
||||
soundAlertService.init();
|
||||
return soundAlertService;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ public class BarcodeManager {
|
||||
var scanMode = sharedPreferences.getString(MainSettingsFragment.KEY_TRIGGER_SCAN_MODE, null);
|
||||
var scanModeSetting = new Pair<String, Object>(BarcodeSetting.P_TRIGGER_SCAN_MODE, scanMode);
|
||||
additionalSettings.add(scanModeSetting);
|
||||
|
||||
|
||||
BarcodeManager.changeSettings(additionalSettings);
|
||||
|
||||
});
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
package it.integry.integrywmsnative.core.base;
|
||||
|
||||
public interface Callable<I, O> {
|
||||
O call(I input);
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
package it.integry.integrywmsnative.core.base;
|
||||
|
||||
public interface CallableII<I, L, O> {
|
||||
O call(I input, L input2);
|
||||
}
|
||||
@ -14,6 +14,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;
|
||||
@ -86,7 +87,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setTitleText(R.string.free_picking)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_picking_libero)
|
||||
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.VENDITA, SettingsManager.iDB().isFlagAskClienteInPickingLibero(), false)))
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.free_picking, GestioneEnum.VENDITA, SettingsManager.iDB().isFlagAskClienteInPickingLibero(), false)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_resi_cliente)
|
||||
@ -122,7 +123,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setTitleText(R.string.free_lav_picking)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_picking_libero)
|
||||
.setDrawerIcon(R.drawable.ic_black_barcode_scanner)
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.LAVORAZIONE, SettingsManager.iDB().isFlagAskClienteInPickingLibero(), false)))
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.free_lav_picking, GestioneEnum.LAVORAZIONE, SettingsManager.iDB().isFlagAskClienteInPickingLibero(), false)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_prod_posizionamento_da_ord)
|
||||
@ -171,6 +172,22 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_materiale)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(ProdVersamentoMaterialeInBufferFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_prod_versamento_su_ordine)
|
||||
.setCodMenu("MG068")
|
||||
.setTitleText(R.string.prod_versamento_su_ordine_title_fragment)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_prod_versamento_su_ord)
|
||||
.setDrawerIcon(R.drawable.ic_black_external)
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(R.string.prod_versamento_su_ordine_title_fragment, GestioneEnum.LAVORAZIONE, false, true)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(R.id.nav_prod_riposizionamento_da_ord)
|
||||
.setCodMenu("MG069")
|
||||
.setTitleText(R.string.prod_riposizionamento_da_prod_title)
|
||||
.setTitleIcon(R.drawable.ic_production_line_produzione)
|
||||
.setDrawerIcon(R.drawable.ic_black_load_shelf)
|
||||
.setFragmentFactory(ProdRiposizionamentoDaProdFragment::newInstance))
|
||||
).addGroup(
|
||||
new MenuGroup()
|
||||
.setGroupText(R.string.internal_handling)
|
||||
|
||||
@ -0,0 +1,127 @@
|
||||
package it.integry.integrywmsnative.core.ean128;
|
||||
|
||||
public enum Ean128AI {
|
||||
|
||||
|
||||
NULL, //Valore nullo (usato solo in logica)
|
||||
SSCC, //Numero sequenziale del collo n2+n18
|
||||
GTIN, //Codice EAN/UCC unità logistica n2+n14
|
||||
CONTENT, //Codice EAN/UCC dei prodotti contenuti all'interno di unità log n2+n14
|
||||
BATCH_LOT, //Numero del lotto di fabbricazione n2+an.20
|
||||
PROD_DATE, //Data di produzione (yymmdd) 0~50 (2000~2050) - 51~99 (1951~1999) n2+n6
|
||||
DUE_DATE, //Data di scadenza pagamento fattura n2+n6
|
||||
PACK_DATE, //Data di confezionamento n2+n6
|
||||
BEST_BEFORE,//Data minima di validità n2+n6
|
||||
EXPIRY, //Data massima di validità n2+n6
|
||||
VARIANT, //Variante di prodotto - uso interno aziendale n2+n2
|
||||
SERIAL, //Numero di serie n2+an.20
|
||||
QTY_DATE_BATCH, //Dati supplementari per prodotti farmaceutici n2+an.29
|
||||
ADDITIONAL_ID, //Numedi di identificazione supplementare del prodotto n3+an.30
|
||||
CUST_PART_NO, //Codice prodotto interno del cliente n3+an.30
|
||||
SECONDARY_SERIAL, //Numero di serie secondario n3+an.30
|
||||
REF_TO_SOURCE, //Entità di origine o marca auricolare n3+an.30
|
||||
VAR_COUNT, //Quantità variabile n2+n.8
|
||||
|
||||
//Misure commerciali e logistiche FORMATO: n4+n6
|
||||
NET_WEIGHT_KG, //Peso netto in Kg
|
||||
LENGTH_M, //Lunghezza o 1° dimensione, in mt, uso commerciale
|
||||
WIDTH_M, //Larghezza, diametro o 2° dimensione, in mt, uso commerciale
|
||||
HEIGHT_M, //Profondità, spessore, altezza o 3° dimensione, in mt, uso commerciale
|
||||
AREA_M2, //Superficie, in metriquadri, uso commerciale
|
||||
NET_VOLUME_L, //Volume, in litri, uso commerciale
|
||||
NET_VOLUME_M3, //Volume, in metricubi, uso commerciale
|
||||
NET_WEIGHT_LB, //Peso netto, in libbre, uso commerciale
|
||||
LENGTH_I, //Lunghezza o 1° dimensione, in pollici, uso commerciale
|
||||
LENGTH_F, //Lunghezza o 1° dimensione, in piedi, uso commerciale
|
||||
LENGTH_Y, //Lunghezza o 1° dimensione, in yards, uso commerciale
|
||||
WIDTH_I, //Larghezza, diametro o 2° dimensione, in pollici, uso commerciale
|
||||
WIDTH_F, //Larghezza, diametro o 2° dimensione, in piedi, uso commerciale
|
||||
WIDTH_Y, //Larghezza, diametro o 2° dimensione, in yards, uso commerciale
|
||||
HEIGHT_I, //Profondità, spessore, altezza o 3° dimensione, in pollici, uso commerciale
|
||||
HEIGHT_F, //Profondità, spessore, altezza o 3° dimensione, in piedi, uso commerciale
|
||||
HEIGHT_Y, //Profondità, spessore, altezza o 3° dimensione, in yards, uso commerciale
|
||||
CROSSWEIGHT_KG_LOG, //Peso lordo, in Kg, uso logistico
|
||||
LENGTH_M_LOG, //Lunghezza o 1° dimensione, in metri, uso logistico
|
||||
WIDTH_M_LOG, //Larghezza, diametro o 2° dimensione, in metri, uso logistico
|
||||
HEIGHT_M_LOG, //Profondità, spessore, altezza o 3° dimensione, in metri, uso logistico
|
||||
AREA_M2_LOG, //Superficie, in metriquadri, uso logistico
|
||||
VOLUME_L_LOG, //Volume lordo, in litri, uso logistico
|
||||
VOLUME_M3_LOG, //Volume lordo, in metricubi, uso logistico
|
||||
CROSSWEIGHT_LB_LOG, //Peso lordo, in libbre, uso logistico
|
||||
LENGTH_I_LOG, //Lunghezza o 1° dimensione, in pollici, uso logistico
|
||||
LENGTH_F_LOG, //Lunghezza o 1° dimensione, in piedi, uso logistico
|
||||
LENGTH_Y_LOG, //Lunghezza o 1° dimensione, in yards, uso logistico
|
||||
WIDTH_I_LOG, //Larghezza, diametro o 2° dimensione, in pollici, uso logistico
|
||||
WIDTH_F_LOG, //Larghezza, diametro o 2° dimensione, in piedi, uso logistico
|
||||
WIDTH_Y_LOG, //Larghezza, diametro o 2° dimensione, in yards, uso logistico
|
||||
HEIGHT_I_LOG, //Profondità, spessore, altezza o 3° dimensione, in pollici, uso logistico
|
||||
HEIGHT_F_LOG, //Profondità, spessore, altezza o 3° dimensione, in piedi, uso logistico
|
||||
HEIGHT_Y_LOG, //Profondità, spessore, altezza o 3° dimensione, in yards, uso logistico
|
||||
AREA_I2, //Superficie, in pollici quadrati, uso commerciale
|
||||
AREA_F2, //Superficie, in piedi quadrati, uso commerciale
|
||||
AREA_Y2, //Superficie, in yards quadrati, uso commerciale
|
||||
AREA_I2_LOG, //Superficie, in pollici quadrati, uso logistico
|
||||
AREA_F2_LOG, //Superficie, in piedi quadrati, uso logistico
|
||||
AREA_Y2_LOG, //Superficie, in yards quadrati, uso logistico
|
||||
NET_WEIGHT_T, //Peso netto, in once troy, uso commerciale
|
||||
NET_VOLUME_OZ, //Volume netto, in once (U.S.), uso commerciale
|
||||
NET_VOLUME_LB, //Volume netto, in quarti di gallone, uso commerciale
|
||||
NET_VOLUME_G, //Volume netto, in galloni (U.S.), uso commerciale
|
||||
VOLUME_Q_LOG, //Volume lordo, in quarti di gallone, uso logistico
|
||||
VOLUME_G_LOG, //Volume lordo, in galloni (U.S.), uso logistico
|
||||
NET_VOLUME_I3, //Volume netto, in pollici cubi, uso commerciale
|
||||
NET_VOLUME_F3, //Volume netto, in piedi cubi, uso commerciale
|
||||
NET_VOLUME_Y3, //Volume netto, in yards cubi, uso commerciale
|
||||
VOLUME_I3_LOG, //Volume lordo, in pollici cubi, uso logistico
|
||||
VOLUME_F3_LOG, //Volume lordo, in piedi cubi, uso logistico
|
||||
VOLUME_Y3_LOG, //Volume lordo, in yards cubi, uso logistico
|
||||
COUNT, //Quantità prodotti contenuti in un'unità logistica
|
||||
AMOUNT, //Importo da pagare singola area monetaria
|
||||
AMOUNT_ISO, //Importo da pagare con codice valuta ISO
|
||||
PRICE, //Importo da pagare singola unità monetaria (prodotti a peso variabile)
|
||||
PRICE_ISO, //Importo da pagare con codice valuta ISO (prodotti a peso variabile)
|
||||
ORDER_NUMBER, //Numero d'ordine d'acquisto cliente
|
||||
CONSIGNMENT, //Numero di consegna
|
||||
SHIPMENT_NO, //Numero di spedizione
|
||||
ROUTE, //Codice di smistamento pacchi
|
||||
SHIP_TO_LOC, //Codice di locazione EAN/UCC "Spedire a, Consegnare a"
|
||||
BILL_TO_LOC, //Codice di locazione EAN/UCC "Fatturare a"
|
||||
PURCHASE_FROM_LOC, //Codice di locazione EAN/UCC "Acquistato da"
|
||||
SHIP_FOR_LOC, //Codice di locazione EAN/UCC "Sperdire per, Consegnare per, Inoltrare a"
|
||||
LOC_NO, //Codice di locazione EAN/UCC: identificazione di una locazione fisica
|
||||
PAY_TO_LOC, //Codice di locazione EAN/UCC di chi emette la fattura
|
||||
SHIP_TO_POST, //Codice postale "Spedire a, Consegnare a" (nazionale)
|
||||
SHIP_TO_POST_ISO, //Codice postale "Spedire a, Consegnare a" con codice nazione ISO
|
||||
ORIGIN, //Paese di origine del prodotto
|
||||
COUNTRY_INITIAL_PROCESS, //Paese di lavorazione iniziale del prodotto con codice nazionale ISO
|
||||
COUNTRY_PROCESS, //Paese di lavorazione con codice nazionale ISO
|
||||
COUNTRY_DISASSEMBLY, //Paese di scomposizione con codice nazionale ISO
|
||||
COUNTRY_FULL_PROCESS,//Paese di lavorazione completa con codice nazionale ISO
|
||||
NSN, //Numero di stock NATO
|
||||
MEAT_CUT, //Carcasse animali e classificazione dei tagli UN/ECE
|
||||
PROCESSORS, //Numero di approvazione del laboratorio di lavorazione intermedio con codice nazionale ISO
|
||||
DIMENSIONS, //Prodotti in rotoli - larghezza, lunghezza, diametro interno, senso di svolgimento e giunte
|
||||
CMT_NO, //Numero sequenziale elettronico per applicazioni di telefonia cellulare
|
||||
GRAI, //Numero di identificazione per beni a rendere,
|
||||
GIAI, //Numero di identificazione globale per beni individuali
|
||||
PRICE_PER_UNIT, //Prezzo per unità di misura
|
||||
GCTIN, //Identificazione dei componenti di un prodotto
|
||||
IBAN, //Numero di contocorrente bancario internazionale
|
||||
PROD_TIME, //Data e ora di produzione
|
||||
GSRN, //Numedo Globale di Relazione di Servizio
|
||||
REF_NO, //Numero del bollettino di pagamento
|
||||
COUPON_1, //Codice esteso per i coupons, UCC
|
||||
COUPON_2, //Codice esteso per i coupons, UCC
|
||||
COUPON_3, //Codice esteso per i coupons, UCC
|
||||
INTERNAL_PART, //Informazioni concordate tra i partners commerciali
|
||||
INTERNAL_1, //Informazioni interne
|
||||
INTERNAL_2, //Informazioni interne
|
||||
INTERNAL_3, //Informazioni interne
|
||||
INTERNAL_4, //Informazioni interne
|
||||
INTERNAL_5, //Informazioni interne
|
||||
INTERNAL_6, //Informazioni interne
|
||||
INTERNAL_7, //Informazioni interne
|
||||
INTERNAL_8, //Informazioni interne
|
||||
INTERNAL_9, //Informazioni interne
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package it.integry.integrywmsnative.core.ean128;
|
||||
|
||||
public class Ean128AIModel implements Cloneable {
|
||||
|
||||
|
||||
public Ean128AI AI;
|
||||
|
||||
public String code;
|
||||
|
||||
public int dataLength;
|
||||
|
||||
public boolean flagVariableLength;
|
||||
|
||||
public boolean flagOnlyNumeric;
|
||||
|
||||
public int decimalDigits;
|
||||
|
||||
public Ean128AIModel(Ean128AI AI, String code, int dataLength, boolean flagVariableLength, boolean flagOnlyNumeric, int decimalDigits) {
|
||||
this.AI = AI;
|
||||
this.code = code;
|
||||
this.dataLength = dataLength;
|
||||
this.flagVariableLength = flagVariableLength;
|
||||
this.flagOnlyNumeric = flagOnlyNumeric;
|
||||
this.decimalDigits = decimalDigits;
|
||||
}
|
||||
|
||||
public Ean128AIModel(Ean128AI AI, String code, int dataLength, boolean flagVariableLength, boolean flagOnlyNumeric) {
|
||||
this.AI = AI;
|
||||
this.code = code;
|
||||
this.dataLength = dataLength;
|
||||
this.flagVariableLength = flagVariableLength;
|
||||
this.flagOnlyNumeric = flagOnlyNumeric;
|
||||
}
|
||||
|
||||
protected Object clone() throws CloneNotSupportedException {
|
||||
return super.clone();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,209 @@
|
||||
package it.integry.integrywmsnative.core.ean128;
|
||||
|
||||
import java.util.regex.MatchResult;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class Ean128AIModelBij {
|
||||
|
||||
private final Ean128AIModel[] _aiModelArray = new Ean128AIModel[]{
|
||||
new Ean128AIModel(Ean128AI.SSCC, "^00", 18, false, true),
|
||||
new Ean128AIModel(Ean128AI.GTIN, "^01", 14, false, true),
|
||||
new Ean128AIModel(Ean128AI.CONTENT, "^02", 14, false, true),
|
||||
new Ean128AIModel(Ean128AI.BATCH_LOT, "^10", 20, true, false),
|
||||
new Ean128AIModel(Ean128AI.PROD_DATE, "^11", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.DUE_DATE, "^12", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.PACK_DATE, "^13", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.BEST_BEFORE, "^15", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.EXPIRY, "^17", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VARIANT, "^20", 2, false, true),
|
||||
new Ean128AIModel(Ean128AI.SERIAL, "^21", 20, true, false),
|
||||
new Ean128AIModel(Ean128AI.QTY_DATE_BATCH, "^22", 29, true, false),
|
||||
new Ean128AIModel(Ean128AI.ADDITIONAL_ID, "^240", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.CUST_PART_NO, "^241", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.SECONDARY_SERIAL, "^250", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.REF_TO_SOURCE, "^251", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.VAR_COUNT, "^30", 8, true, true),
|
||||
new Ean128AIModel(Ean128AI.NET_WEIGHT_KG, "^310(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_M, "^311(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_M, "^312(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_M, "^313(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_M2, "^314(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_L, "^315(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_M3, "^316(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_WEIGHT_LB, "^320(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_I, "^321(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_F, "^322(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_Y, "^323(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_I, "^324(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_F, "^325(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_Y, "^326(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_I, "^327(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_F, "^328(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_Y, "^329(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.CROSSWEIGHT_KG_LOG, "^330(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_M_LOG, "^331(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_M_LOG, "^332(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_M_LOG, "^333(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_M2_LOG, "^334(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_L_LOG, "^335(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_M3_LOG, "^336(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.CROSSWEIGHT_LB_LOG, "^340(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_I_LOG, "^341(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_F_LOG, "^342(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.LENGTH_Y_LOG, "^343(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_I_LOG, "^344(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_F_LOG, "^345(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.WIDTH_Y_LOG, "^346(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_I_LOG, "^347(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_F_LOG, "^348(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.HEIGHT_Y_LOG, "^349(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_I2, "^350(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_F2, "^351(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_Y2, "^352(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_I2_LOG, "^353(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_F2_LOG, "^354(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.AREA_Y2_LOG, "^355(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_WEIGHT_T, "^356(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_OZ, "^357(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_LB, "^360(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_G, "^361(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_Q_LOG, "^362(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_G_LOG, "^363(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_I3, "^364(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_F3, "^365(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.NET_VOLUME_Y3, "^366(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_I3_LOG, "^367(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_F3_LOG, "^368(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.VOLUME_Y3_LOG, "^369(\\d{1})", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUNT, "^37", 8, true, true),
|
||||
new Ean128AIModel(Ean128AI.AMOUNT, "^390(\\d{1})", 15, true, true),
|
||||
new Ean128AIModel(Ean128AI.AMOUNT_ISO, "^391(\\d{1})", 18, true, true),
|
||||
new Ean128AIModel(Ean128AI.PRICE, "^392(\\d{1})", 15, true, true),
|
||||
new Ean128AIModel(Ean128AI.PRICE_ISO, "^393(\\d{1})", 18, true, true),
|
||||
new Ean128AIModel(Ean128AI.ORDER_NUMBER, "^400", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.CONSIGNMENT, "^401", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.SHIPMENT_NO, "^402", 17, false, true),
|
||||
new Ean128AIModel(Ean128AI.ROUTE, "^403", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.SHIP_TO_LOC, "^410", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.BILL_TO_LOC, "^411", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.PURCHASE_FROM_LOC, "^412", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.SHIP_FOR_LOC, "^413", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.LOC_NO, "^414", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.PAY_TO_LOC, "^415", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.SHIP_TO_POST, "^420", 20, true, false),
|
||||
new Ean128AIModel(Ean128AI.SHIP_TO_POST_ISO, "^421", 12, true, false),
|
||||
new Ean128AIModel(Ean128AI.ORIGIN, "^422", 3, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUNTRY_INITIAL_PROCESS, "^423", 15, true, true),
|
||||
new Ean128AIModel(Ean128AI.COUNTRY_PROCESS, "^424", 3, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUNTRY_DISASSEMBLY, "^425", 3, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUNTRY_FULL_PROCESS, "^426", 3, false, true),
|
||||
new Ean128AIModel(Ean128AI.NSN, "^7001", 13, false, true),
|
||||
new Ean128AIModel(Ean128AI.MEAT_CUT, "^7002", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.DIMENSIONS, "^8001", 14, false, true),
|
||||
new Ean128AIModel(Ean128AI.CMT_NO, "^8002", 20, true, false),
|
||||
new Ean128AIModel(Ean128AI.GRAI, "^8003", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.GIAI, "^8004", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.PRICE_PER_UNIT, "^8005", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.GCTIN, "^8006", 18, false, false),
|
||||
new Ean128AIModel(Ean128AI.IBAN, "^8007", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.PROD_TIME, "^8008", 12, true, true),
|
||||
new Ean128AIModel(Ean128AI.GSRN, "^8018", 18, false, true),
|
||||
new Ean128AIModel(Ean128AI.REF_NO, "^8020", 25, true, false),
|
||||
new Ean128AIModel(Ean128AI.COUPON_1, "^8100", 6, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUPON_2, "^8101", 10, false, true),
|
||||
new Ean128AIModel(Ean128AI.COUPON_3, "^8102", 2, false, true),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_PART, "^90", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_1, "^91", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_2, "^92", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_3, "^93", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_4, "^94", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_5, "^95", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_6, "^96", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_7, "^97", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_8, "^98", 30, true, false),
|
||||
new Ean128AIModel(Ean128AI.INTERNAL_9, "^99", 30, true, false)
|
||||
};
|
||||
|
||||
|
||||
public int checkAI(String aiToCheck) {
|
||||
int count = -1;
|
||||
|
||||
if (aiToCheck.length() > 1) {
|
||||
for (int i = 0; i < _aiModelArray.length; i++) {
|
||||
final String groupSeparatorCharInHexForRegex = "\\x1D";
|
||||
String codePattern = "";
|
||||
|
||||
if (aiToCheck.charAt(0) == (char) 29) {
|
||||
codePattern += groupSeparatorCharInHexForRegex;
|
||||
}
|
||||
|
||||
codePattern += _aiModelArray[i].code;
|
||||
|
||||
|
||||
Pattern pattern = Pattern.compile(codePattern, Pattern.CASE_INSENSITIVE);
|
||||
Matcher matcher = pattern.matcher(aiToCheck);
|
||||
|
||||
|
||||
if (matcher.find()) {
|
||||
count = i;
|
||||
MatchResult matchResult = matcher.toMatchResult();
|
||||
|
||||
if (matchResult.groupCount() >= 1) {
|
||||
String digitsString = matchResult.group(1);
|
||||
_aiModelArray[i].decimalDigits = Integer.parseInt(digitsString);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
public Ean128AIModel readAI(String aiToSearch) {
|
||||
|
||||
Ean128AIModel barcodeAIModel = null;
|
||||
|
||||
for (Ean128AIModel singleBarcodeAIModel : _aiModelArray) {
|
||||
final String groupSeparatorCharInHexForRegex = "\\x1D";
|
||||
String codePattern = "";
|
||||
|
||||
if (aiToSearch.charAt(0) == (char) 29) {
|
||||
codePattern += groupSeparatorCharInHexForRegex;
|
||||
}
|
||||
|
||||
codePattern += singleBarcodeAIModel.code;
|
||||
|
||||
|
||||
Pattern pattern = Pattern.compile(codePattern, Pattern.CASE_INSENSITIVE);
|
||||
Matcher matcher = pattern.matcher(aiToSearch);
|
||||
|
||||
if (matcher.matches()) {
|
||||
try {
|
||||
barcodeAIModel = (Ean128AIModel) singleBarcodeAIModel.clone();
|
||||
|
||||
MatchResult matchResult = matcher.toMatchResult();
|
||||
|
||||
if (matchResult.groupCount() > 1) {
|
||||
String digitsString = matchResult.group(1);
|
||||
barcodeAIModel.decimalDigits = Integer.parseInt(digitsString);
|
||||
}
|
||||
break;
|
||||
} catch (CloneNotSupportedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return barcodeAIModel;
|
||||
}
|
||||
|
||||
public Ean128AIModel getAI(int index) {
|
||||
return _aiModelArray[index];
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package it.integry.integrywmsnative.core.ean128;
|
||||
|
||||
public class Ean128ISOValueModel<T> {
|
||||
|
||||
public String ISOCode;
|
||||
public T Value;
|
||||
|
||||
}
|
||||
@ -0,0 +1,331 @@
|
||||
package it.integry.integrywmsnative.core.ean128;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.base.Callable;
|
||||
import it.integry.integrywmsnative.core.base.CallableII;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
|
||||
public class Ean128Service {
|
||||
|
||||
public Ean128Model decode(BarcodeScanDTO barcodeScanDTO) throws Exception {
|
||||
byte[] inputEan128ByteArr = barcodeScanDTO.getStringValue().replaceAll("" + ((char) 29), "|").getBytes();
|
||||
Ean128AIModelBij ean128AIModelBij = new Ean128AIModelBij();
|
||||
|
||||
String aiCodeBuffer = "";
|
||||
|
||||
Ean128Model model = new Ean128Model();
|
||||
|
||||
for (int i = 0; i < inputEan128ByteArr.length; i++) {
|
||||
aiCodeBuffer += (char) inputEan128ByteArr[i];
|
||||
|
||||
if (aiCodeBuffer.startsWith("|")) {
|
||||
aiCodeBuffer = aiCodeBuffer.substring(1);
|
||||
}
|
||||
|
||||
if (aiCodeBuffer.length() <= 5) {
|
||||
int aiIndex = ean128AIModelBij.checkAI(aiCodeBuffer);
|
||||
|
||||
if (aiIndex != -1) {
|
||||
|
||||
Ean128AIModel aiModel = ean128AIModelBij.getAI(aiIndex);
|
||||
|
||||
StringBuilder aiValue = new StringBuilder();
|
||||
|
||||
if (!aiModel.flagVariableLength) {
|
||||
|
||||
for (int j = (i + 1); j < (i + 1) + aiModel.dataLength; j++) {
|
||||
aiValue.append((char) inputEan128ByteArr[j]);
|
||||
}
|
||||
|
||||
//aiValue = barcodeAsString.Substring(i + 1, aiModel.DataLength);
|
||||
i += aiModel.dataLength;
|
||||
} else {
|
||||
String tempBuffer = "";
|
||||
|
||||
i++;
|
||||
|
||||
while (i < inputEan128ByteArr.length && i < (aiModel.dataLength + i)) {
|
||||
byte currentChar = inputEan128ByteArr[i];
|
||||
|
||||
if (currentChar != 29 && currentChar != '|') { //Controllo carattere FNC1
|
||||
tempBuffer += (char) currentChar;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
aiValue = new StringBuilder(tempBuffer.replace("\r", "").replace("\n", ""));
|
||||
}
|
||||
|
||||
switch (aiModel.AI) {
|
||||
case SSCC -> {
|
||||
if (aiValue.length() > 0 && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
|
||||
aiValue = new StringBuilder(aiValue.substring(1));
|
||||
}
|
||||
model.Sscc = aiValue.toString();
|
||||
}
|
||||
case GTIN -> {
|
||||
if (aiValue.length() > 0 && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
|
||||
aiValue = new StringBuilder(aiValue.substring(1));
|
||||
}
|
||||
model.Gtin = aiValue.toString();
|
||||
}
|
||||
case CONTENT -> {
|
||||
if (aiValue.length() > 0 && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
|
||||
aiValue = new StringBuilder(aiValue.substring(1));
|
||||
}
|
||||
model.Content = aiValue.toString();
|
||||
}
|
||||
case BATCH_LOT -> model.BatchLot = aiValue.toString();
|
||||
case PROD_DATE -> model.ProdDate = convertToDateTime(aiValue.toString());
|
||||
case DUE_DATE -> model.DueDate = convertToDateTime(aiValue.toString());
|
||||
case PACK_DATE -> model.PackDate = convertToDateTime(aiValue.toString());
|
||||
case BEST_BEFORE ->
|
||||
model.BestBefore = UtilityDate.formatDate(convertToDateTime(aiValue.toString()), UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
|
||||
case EXPIRY -> model.Expiry = UtilityDate.formatDate(convertToDateTime(aiValue.toString()), UtilityDate.COMMONS_DATE_FORMATS.DMY_SLASH);
|
||||
case VARIANT -> model.Variant = aiValue.toString();
|
||||
case SERIAL -> model.Serial = aiValue.toString();
|
||||
case QTY_DATE_BATCH -> model.QtyDateBatch = aiValue.toString();
|
||||
case ADDITIONAL_ID -> model.AdditionalID = aiValue.toString();
|
||||
case CUST_PART_NO -> model.CustPartNumber = aiValue.toString();
|
||||
case SECONDARY_SERIAL -> model.SecondarySerial = aiValue.toString();
|
||||
case REF_TO_SOURCE -> model.RefToSource = aiValue.toString();
|
||||
case VAR_COUNT -> model.VarCount = aiValue.toString();
|
||||
case NET_WEIGHT_KG ->
|
||||
model.NetWeightKg = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_M ->
|
||||
model.LengthM = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_M ->
|
||||
model.WidthM = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_M ->
|
||||
model.HeightM = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_M2 ->
|
||||
model.AreaM2 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_L ->
|
||||
model.NetVolumeL = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_M3 ->
|
||||
model.NetVolumeM3 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_WEIGHT_LB ->
|
||||
model.NetWeightLb = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_I ->
|
||||
model.LengthI = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_F ->
|
||||
model.LengthF = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_Y ->
|
||||
model.LengthY = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_I ->
|
||||
model.WidthI = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_F ->
|
||||
model.WidthF = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_Y ->
|
||||
model.WidthY = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_I ->
|
||||
model.HeightI = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_F ->
|
||||
model.HeightF = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_Y ->
|
||||
model.HeightY = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case CROSSWEIGHT_KG_LOG ->
|
||||
model.CrossweightKgLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case CROSSWEIGHT_LB_LOG ->
|
||||
model.CrossweightLbLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_M_LOG ->
|
||||
model.LengthMLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_M_LOG ->
|
||||
model.WidthMLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_M_LOG ->
|
||||
model.HeigthMLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_M2_LOG ->
|
||||
model.AreaM2Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_L_LOG ->
|
||||
model.VolumeLLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_M3_LOG ->
|
||||
model.VolumeM3Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_I_LOG ->
|
||||
model.LengthILog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_F_LOG ->
|
||||
model.LengthFLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case LENGTH_Y_LOG ->
|
||||
model.LengthYLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_I_LOG ->
|
||||
model.WidthILog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_F_LOG ->
|
||||
model.WidthFLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case WIDTH_Y_LOG ->
|
||||
model.WidthYLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_I_LOG ->
|
||||
model.HeigthILog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_F_LOG ->
|
||||
model.HeigthFLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case HEIGHT_Y_LOG ->
|
||||
model.HeigthYLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_I2 ->
|
||||
model.AreaI2 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_F2 ->
|
||||
model.AreaF2 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_Y2 ->
|
||||
model.AreaY2 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_I2_LOG ->
|
||||
model.AreaI2Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_F2_LOG ->
|
||||
model.AreaF2Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AREA_Y2_LOG ->
|
||||
model.AreaY2Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_WEIGHT_T ->
|
||||
model.NetWeightT = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_OZ ->
|
||||
model.NetVolumeOz = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_LB ->
|
||||
model.NetVolumeLb = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_G ->
|
||||
model.NetVolumeG = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_Q_LOG ->
|
||||
model.VolumeQLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_G_LOG ->
|
||||
model.VolumeGLog = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_I3 ->
|
||||
model.NetVolumeI3 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_F3 ->
|
||||
model.NetVolumeF3 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case NET_VOLUME_Y3 ->
|
||||
model.NetVolumeY3 = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_I3_LOG ->
|
||||
model.VolumeI3Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_F3_LOG ->
|
||||
model.VolumeF3Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case VOLUME_Y3_LOG ->
|
||||
model.VolumeY3Log = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case COUNT -> model.Count = Integer.parseInt(aiValue.toString());
|
||||
case AMOUNT ->
|
||||
model.Amount = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case AMOUNT_ISO ->
|
||||
model.AmountISO = convertToIsoValueModel(aiValue.toString(), aiModel.decimalDigits,
|
||||
Double::parseDouble,
|
||||
(input, input2) -> String.valueOf(convertToDecimalString(input, input2)));
|
||||
case PRICE ->
|
||||
model.Price = convertToDecimalString(aiValue.toString(), aiModel.decimalDigits);
|
||||
case PRICE_ISO ->
|
||||
model.PriceISO = convertToIsoValueModel(aiValue.toString(), aiModel.decimalDigits,
|
||||
Double::parseDouble,
|
||||
(input, input2) -> String.valueOf(convertToDecimalString(input, input2)));
|
||||
case ORDER_NUMBER -> model.OrderNumber = aiValue.toString();
|
||||
case CONSIGNMENT -> model.Consignment = aiValue.toString();
|
||||
case SHIPMENT_NO -> model.ShipmentNo = aiValue.toString();
|
||||
case ROUTE -> model.Route = aiValue.toString();
|
||||
case SHIP_TO_LOC -> model.ShipToLoc = aiValue.toString();
|
||||
case BILL_TO_LOC -> model.BillToLoc = aiValue.toString();
|
||||
case PURCHASE_FROM_LOC -> model.PurchaseFromLoc = aiValue.toString();
|
||||
case SHIP_FOR_LOC -> model.ShipForLoc = aiValue.toString();
|
||||
case LOC_NO -> model.LocationNumber = aiValue.toString();
|
||||
case PAY_TO_LOC -> model.PayToLoc = aiValue.toString();
|
||||
case SHIP_TO_POST -> model.ShipToPost = aiValue.toString();
|
||||
case SHIP_TO_POST_ISO ->
|
||||
model.ShipToPostISO = convertToIsoValueModel(aiValue.toString(), 0,
|
||||
new Callable<String, String>() {
|
||||
@Override
|
||||
public String call(String input) {
|
||||
return input;
|
||||
}
|
||||
},
|
||||
new CallableII<String, Integer, String>() {
|
||||
@Override
|
||||
public String call(String input, Integer input2) {
|
||||
return input;
|
||||
}
|
||||
});
|
||||
case ORIGIN -> model.Origin = aiValue.toString();
|
||||
case COUNTRY_INITIAL_PROCESS ->
|
||||
model.ShipToPostISO = convertToIsoValueModel(aiValue.toString(), 0,
|
||||
input -> input,
|
||||
(input, input2) -> input);
|
||||
case COUNTRY_PROCESS -> model.CountryProcess = aiValue.toString();
|
||||
case COUNTRY_DISASSEMBLY -> model.CountryDisassembly = aiValue.toString();
|
||||
case COUNTRY_FULL_PROCESS -> model.CountryFullProcess = aiValue.toString();
|
||||
case NSN -> model.NSN = aiValue.toString();
|
||||
case MEAT_CUT -> model.MeatCut = aiValue.toString();
|
||||
case DIMENSIONS -> model.Dimensions = aiValue.toString();
|
||||
case CMT_NO -> model.CmtNo = aiValue.toString();
|
||||
case GRAI -> model.Grai = aiValue.toString();
|
||||
case GIAI -> model.Giai = aiValue.toString();
|
||||
case PRICE_PER_UNIT -> model.PricePerUnit = aiValue.toString();
|
||||
case GCTIN -> model.Gctin = aiValue.toString();
|
||||
case IBAN -> model.Iban = aiValue.toString();
|
||||
case PROD_TIME -> model.ProdTime = convertToDateTime(aiValue.toString());
|
||||
case GSRN -> model.Gsrn = aiValue.toString();
|
||||
case REF_NO -> model.RefNo = aiValue.toString();
|
||||
case COUPON_1 -> model.Coupon1 = aiValue.toString();
|
||||
case COUPON_2 -> model.Coupon2 = aiValue.toString();
|
||||
case COUPON_3 -> model.Coupon3 = aiValue.toString();
|
||||
case INTERNAL_PART -> model.InternalPart = aiValue.toString();
|
||||
case INTERNAL_1 -> model.Internal1 = aiValue.toString();
|
||||
case INTERNAL_2 -> model.Internal2 = aiValue.toString();
|
||||
case INTERNAL_3 -> model.Internal3 = aiValue.toString();
|
||||
case INTERNAL_4 -> model.Internal4 = aiValue.toString();
|
||||
case INTERNAL_5 -> model.Internal5 = aiValue.toString();
|
||||
case INTERNAL_6 -> model.Internal6 = aiValue.toString();
|
||||
case INTERNAL_7 -> model.Internal7 = aiValue.toString();
|
||||
case INTERNAL_8 -> model.Internal8 = aiValue.toString();
|
||||
case INTERNAL_9 -> model.Internal9 = aiValue.toString();
|
||||
default -> {
|
||||
}
|
||||
}
|
||||
|
||||
aiCodeBuffer = "";
|
||||
}
|
||||
} else {
|
||||
throw new Exception(String.format("Il barcode non è un EAN128 valido (%s)", new String(inputEan128ByteArr)));
|
||||
}
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
private float convertToDecimalString(String sourceString, int numberOfdecimalDigits) {
|
||||
|
||||
int divider = (int) Math.pow(10, numberOfdecimalDigits);
|
||||
|
||||
return Float.parseFloat(sourceString) / divider;
|
||||
}
|
||||
|
||||
private <T> Ean128ISOValueModel<T> convertToIsoValueModel(String sourceString, int numberOfDecimalDigits, Callable<String, T> castFunc, CallableII<String, Integer, String> splitFunc) {
|
||||
String isoCode = sourceString.substring(0, 3);
|
||||
|
||||
T value = castFunc.call(splitFunc.call(sourceString.substring(3), numberOfDecimalDigits));
|
||||
|
||||
Ean128ISOValueModel<T> isoModel = new Ean128ISOValueModel<T>();
|
||||
isoModel.ISOCode = isoCode;
|
||||
isoModel.Value = value;
|
||||
|
||||
return isoModel;
|
||||
}
|
||||
|
||||
private Date convertToDateTime(String sourceString) {
|
||||
int year = Integer.parseInt(sourceString.substring(0, 2));
|
||||
|
||||
//Se l'anno è minore di 50 indica 2000-2050 altrimenti 1951-1999
|
||||
int correctedYear = year <= 50 ? (2000 + year) : (1900 + year);
|
||||
|
||||
int month = Integer.parseInt(sourceString.substring(2, 4));
|
||||
int day = Integer.parseInt(sourceString.substring(4, 6));
|
||||
|
||||
Date d = null;
|
||||
|
||||
try {
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
|
||||
d = formatter.parse(day + "/" + month + "/" + correctedYear);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public final class InvalidCodMdepException extends Exception {
|
||||
public InvalidCodMdepException() {
|
||||
super(UtilityResources.getString(R.string.invalid_codmdep));
|
||||
}
|
||||
}
|
||||
@ -7,6 +7,7 @@ import java.util.Date;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
|
||||
public class MtbColr extends EntityBase {
|
||||
|
||||
@ -372,7 +373,7 @@ public class MtbColr extends EntityBase {
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
return UtilityString.isNull(descrizione, getMtbAart() != null ? UtilityString.isNull(getMtbAart().getDescrizioneEstesa(), getMtbAart().getDescrizione()) : null);
|
||||
}
|
||||
|
||||
public MtbColr setDescrizione(String descrizione) {
|
||||
|
||||
@ -38,6 +38,7 @@ public class MvwSitArtUdcDetInventario {
|
||||
private BigDecimal pesoLordoKg;
|
||||
private String codJfas;
|
||||
private MtbAart mtbAart;
|
||||
private Integer numOrd;
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
@ -282,6 +283,15 @@ public class MvwSitArtUdcDetInventario {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumOrd() {
|
||||
return numOrd;
|
||||
}
|
||||
|
||||
public MvwSitArtUdcDetInventario setNumOrd(Integer numOrd) {
|
||||
this.numOrd = numOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbColr toMtbColr() {
|
||||
return new MtbColr()
|
||||
.setCodJcom(getCodJcom())
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@ import java.util.List;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepo;
|
||||
|
||||
@Singleton
|
||||
@ -28,27 +27,4 @@ public class DepositoRESTConsumer extends _BaseRESTConsumer {
|
||||
}.getType();
|
||||
this.systemRESTConsumer.processSql("SELECT * FROM mtb_depo", typeOfObjectsList, onComplete, onFailed);
|
||||
}
|
||||
|
||||
public void getDepoByCodMdep(String codMdep, RunnableArgs<MtbDepo> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
MtbDepo mtbDepo = new MtbDepo();
|
||||
mtbDepo.setCodMdep(codMdep);
|
||||
mtbDepo.setOperation(CommonModelConsts.OPERATION.SELECT);
|
||||
mtbDepo.setOnlyPkMaster(false);
|
||||
|
||||
this.entityRESTConsumer.selectEntity(mtbDepo, new ISimpleOperationCallback<>() {
|
||||
@Override
|
||||
public void onSuccess(List<MtbDepo> value) {
|
||||
if (value != null && value.size() > 0) {
|
||||
onComplete.run(value.get(0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
onFailed.run(ex);
|
||||
}
|
||||
}, MtbDepo.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -121,11 +121,12 @@ public class EntityRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
@Deprecated
|
||||
public <T extends EntityBase> void selectEntity(T entityToSave, final ISimpleOperationCallback<List<T>> callback, Class type) {
|
||||
|
||||
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
|
||||
Call<ServiceRESTResponse<JsonObject>> request = service.processEntity(entityToSave);
|
||||
request.enqueue(new Callback<ServiceRESTResponse<JsonObject>>() {
|
||||
request.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||
if (response.isSuccessful()) {
|
||||
|
||||
@ -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;
|
||||
@ -71,6 +72,48 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
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)
|
||||
.map(x -> x.getCodMart().trim())
|
||||
.toList();
|
||||
|
||||
mArticoloRESTConsumer.getByCodMarts(codMarts, mtbAarts -> {
|
||||
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();
|
||||
|
||||
if (mtbAartOpt.isPresent()) {
|
||||
foundMtbAart = mtbAartOpt.get();
|
||||
}
|
||||
|
||||
row.setMtbAart(foundMtbAart);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onComplete.run(inventarioList);
|
||||
}, onFailed);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<List<ArtsInGiacenzaDTO>>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getGiacenzeByArticolo(String codMart, String partitaMag, RunnableArgs<List<MvwSitArtUdcDetInventario>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
GiacenzaRESTConsumerService giacenzaRESTConsumerService = RESTBuilder.getService(GiacenzaRESTConsumerService.class);
|
||||
var serviceRESTResponseCall =
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -64,10 +64,10 @@ public class MesRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
public void getOrdiniLavorazione(Date dateStart, String flagEvaso, String codJfas, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public void getOrdiniLavorazione(String flagEvaso, RunnableArgs<List<OrdineLavorazioneDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MesRESTConsumerService mesRESTConsumerService = RESTBuilder.getService(MesRESTConsumerService.class);
|
||||
|
||||
mesRESTConsumerService.getOrdiniLavorazione(UtilityDate.formatDate(dateStart, UtilityDate.COMMONS_DATE_FORMATS.YMD_DASH), flagEvaso, codJfas)
|
||||
mesRESTConsumerService.getOrdiniLavorazione(flagEvaso)
|
||||
.enqueue(new Callback<ServiceRESTResponse<List<OrdineLavorazioneDTO>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> call, Response<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> response) {
|
||||
|
||||
@ -20,7 +20,7 @@ public interface MesRESTConsumerService {
|
||||
|
||||
|
||||
@GET("mes_v2/getOrdiniLavorazione")
|
||||
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazione(@Query("startDate") String startDate, @Query("flagEvaso") String flagEvaso, @Query("codJfas") String codJfas);
|
||||
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazione(@Query("flagEvaso") String flagEvaso);
|
||||
|
||||
@GET("mes_v2/getOrdiniLavorazione")
|
||||
Call<ServiceRESTResponse<List<OrdineLavorazioneDTO>>> getOrdiniLavorazione(@Query("startDate") String startDate, @Query("flagEvaso") String flagEvaso, @Query("codJfas") String codJfas, @Query("codAnag") String codAnag);
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package it.integry.integrywmsnative.core.rest.model;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import it.integry.integrywmsnative.core.ean128.Ean128ISOValueModel;
|
||||
|
||||
public class Ean128Model {
|
||||
|
||||
@ -16,13 +19,13 @@ public class Ean128Model {
|
||||
public String BatchLot;
|
||||
|
||||
///<summary>Data di produzione (yymmdd) 0~50 (2000~2050) - 51~99 (1951~1999)</summary>
|
||||
public String ProdString;
|
||||
public Date ProdDate;
|
||||
|
||||
///<summary>Data di scadenza pagamento fattura</summary>
|
||||
public String DueString;
|
||||
public Date DueDate;
|
||||
|
||||
///<summary>Data di confezionamento</summary>
|
||||
public String PackString;
|
||||
public Date PackDate;
|
||||
|
||||
///<summary>Data minima di validità</summary>
|
||||
public String BestBefore;
|
||||
@ -37,7 +40,7 @@ public class Ean128Model {
|
||||
public String Serial;
|
||||
|
||||
///<summary>Dati supplementari per prodotti farmaceutici</summary>
|
||||
public String QtyStringBatch;
|
||||
public String QtyDateBatch;
|
||||
|
||||
///<summary>Numedi di identificazione supplementare del prodotto</summary>
|
||||
public String AdditionalID;
|
||||
@ -216,9 +219,15 @@ public class Ean128Model {
|
||||
///<summary>Importo da pagare singola area monetaria</summary>
|
||||
public Float Amount;
|
||||
|
||||
///<summary>Importo da pagare con codice valuta ISO</summary>
|
||||
public Ean128ISOValueModel<Double> AmountISO;
|
||||
|
||||
///<summary>Importo da pagare singola unità monetaria (prodotti a peso variabile)</summary>
|
||||
public Float Price;
|
||||
|
||||
///<summary>Importo da pagare con codice valuta ISO (prodotti a peso variabile)</summary>
|
||||
public Ean128ISOValueModel<Double> PriceISO;
|
||||
|
||||
///<summary>Numero d'ordine d'acquisto cliente</summary>
|
||||
public String OrderNumber;
|
||||
|
||||
@ -252,9 +261,15 @@ public class Ean128Model {
|
||||
///<summary>Codice postale "Spedire a, Consegnare a" (nazionale)</summary>
|
||||
public String ShipToPost;
|
||||
|
||||
///<summary>Codice postale "Spedire a, Consegnare a" con codice nazione ISO</summary>
|
||||
public Ean128ISOValueModel<String> ShipToPostISO;
|
||||
|
||||
///<summary>Paese di origine del prodotto</summary>
|
||||
public String Origin;
|
||||
|
||||
///<summary>Paese di lavorazione iniziale del prodotto con codice nazionale ISO</summary>
|
||||
public Ean128ISOValueModel<String> CountryInitialProcess;
|
||||
|
||||
///<summary>Paese di lavorazione con codice nazionale ISO</summary>
|
||||
public String CountryProcess;
|
||||
|
||||
@ -292,7 +307,7 @@ public class Ean128Model {
|
||||
public String Iban;
|
||||
|
||||
///<summary>Data e ora di produzione</summary>
|
||||
public String ProdTime;
|
||||
public Date ProdTime;
|
||||
|
||||
///<summary>Numedo Globale di Relazione di Servizio</summary>
|
||||
public String Gsrn;
|
||||
@ -313,7 +328,7 @@ public class Ean128Model {
|
||||
public String InternalPart;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal1; //USED FOR COD_MART
|
||||
public String Internal1;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal2;
|
||||
@ -338,5 +353,4 @@ public class Ean128Model {
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal9;
|
||||
|
||||
}
|
||||
}
|
||||
@ -9,7 +9,7 @@ public class CreateUDCRequestDTO {
|
||||
private String serCollo;
|
||||
private String codAnag;
|
||||
private String codTcol;
|
||||
|
||||
private String barcodeUl;
|
||||
private String annotazioni;
|
||||
|
||||
private List<CreateUDCRequestOrderDTO> orders;
|
||||
@ -60,6 +60,15 @@ public class CreateUDCRequestDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarcodeUl() {
|
||||
return barcodeUl;
|
||||
}
|
||||
|
||||
public CreateUDCRequestDTO setBarcodeUl(String barcodeUl) {
|
||||
this.barcodeUl = barcodeUl;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAnnotazioni() {
|
||||
return annotazioni;
|
||||
}
|
||||
|
||||
@ -71,6 +71,9 @@ public class DBSettingsModel {
|
||||
private boolean flagDisableMandatoryTracciabilitaAccettazioneBolla = false;
|
||||
private boolean flagAllowULRecoverAccettazioneBolla = true;
|
||||
private boolean flagOverflowQuantityWarning = false;
|
||||
private String viewPosizioni;
|
||||
private boolean flagDeleteRowOnClose = false;
|
||||
private boolean flagAllowBarcodeFornitore = false;
|
||||
|
||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||
return flagSpedizioneEnableFakeGiacenza;
|
||||
@ -576,4 +579,31 @@ 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 isFlagDeleteRowOnClose() {
|
||||
return flagDeleteRowOnClose;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagDeleteRowOnClose(boolean flagDeleteRowOnClose) {
|
||||
this.flagDeleteRowOnClose = flagDeleteRowOnClose;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagAllowBarcodeFornitore() {
|
||||
return flagAllowBarcodeFornitore;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagAllowBarcodeFornitore(boolean flagAllowBarcodeFornitore) {
|
||||
this.flagAllowBarcodeFornitore = flagAllowBarcodeFornitore;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,6 +242,11 @@ public class SettingsManager {
|
||||
.setSection("ACCETTAZIONE")
|
||||
.setKeySection("FLAG_AUTO_OPEN_NEW_UL")
|
||||
.setSetter(dbSettingsModelIstance::setFlagCanAutoOpenNewULAccettazione));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE")
|
||||
.setKeySection("FLAG_DELETE_ROW_ON_CLOSE")
|
||||
.setSetter(dbSettingsModelIstance::setFlagDeleteRowOnClose));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
@ -278,6 +283,11 @@ public class SettingsManager {
|
||||
.setKeySection("FLAG_GROUP_BY_GRP_MERC")
|
||||
.setSetter(dbSettingsModelIstance::setGroupPoductionByCommodityGroup)
|
||||
.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")
|
||||
@ -483,6 +493,12 @@ public class SettingsManager {
|
||||
.setKeySection("FLAG_OVERFLOW_QUANTITY_WARNING")
|
||||
.setSetter(dbSettingsModelIstance::setFlagOverflowQuantityWarning)
|
||||
.setDefaultValue(false));
|
||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||
.setGestName("PICKING")
|
||||
.setSection("ACCETTAZIONE")
|
||||
.setKeySection("FLAG_ALLOW_BARCODE_FORNITORE")
|
||||
.setSetter(dbSettingsModelIstance::setFlagAllowBarcodeFornitore)
|
||||
.setDefaultValue(false));
|
||||
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
package it.integry.integrywmsnative.core.sound;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.MediaPlayer;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
@Singleton
|
||||
public class SoundAlertService {
|
||||
|
||||
private final Context mApplicationContext;
|
||||
|
||||
private MediaPlayer successPlayer;
|
||||
private MediaPlayer warningPlayer;
|
||||
|
||||
public SoundAlertService(Context context) {
|
||||
this.mApplicationContext = context;
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void init() {
|
||||
successPlayer = MediaPlayer.create(this.mApplicationContext, R.raw.success_sound);
|
||||
warningPlayer = MediaPlayer.create(this.mApplicationContext, R.raw.warning_sound);
|
||||
}
|
||||
|
||||
public void success() {
|
||||
if (successPlayer != null) {
|
||||
successPlayer.start();
|
||||
}
|
||||
}
|
||||
|
||||
public void warning() {
|
||||
if (warningPlayer != null) {
|
||||
warningPlayer.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -25,7 +25,7 @@ public class UtilityBarcode {
|
||||
int currentYear = calendar.get(Calendar.YEAR);
|
||||
|
||||
String fullYear = "20" + UtilityBarcode.getAnnoColloFromULAnonima(barcode);
|
||||
return fullYear.equalsIgnoreCase("" + currentYear);
|
||||
return fullYear.equalsIgnoreCase(String.valueOf(currentYear));
|
||||
}
|
||||
|
||||
public static boolean isEtichetta128(BarcodeScanDTO barcodeScanDTO) {
|
||||
|
||||
@ -1,7 +1,12 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class UtilityDB {
|
||||
|
||||
@ -32,4 +37,9 @@ public class UtilityDB {
|
||||
return valueString;
|
||||
}
|
||||
|
||||
public static String listValueToString(List<String> lista) {
|
||||
lista = Stream.of(lista).map(UtilityDB::valueToString).toList();
|
||||
return StringUtils.join(lista,",");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -184,6 +184,16 @@ public class UtilityDate {
|
||||
} else return null;
|
||||
}
|
||||
|
||||
public static String formatDate(String dateToFormat, String format) {
|
||||
if (dateToFormat != null) {
|
||||
LocalDateTime data = recognizeLocalDateTimeWithExceptionHandler(dateToFormat);
|
||||
if (data != null) {
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(format);
|
||||
return data.format(dateTimeFormatter);
|
||||
}else return null;
|
||||
} else return null;
|
||||
}
|
||||
|
||||
public static boolean isBeforeToday(LocalDateTime inputDate) {
|
||||
return inputDate != null && inputDate.toLocalDate().isBefore(getNow());
|
||||
}
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
|
||||
public class UtilitySHA1 {
|
||||
|
||||
|
||||
public static String getSha1Hex(String clearString)
|
||||
{
|
||||
try
|
||||
{
|
||||
MessageDigest messageDigest = MessageDigest.getInstance("SHA-1");
|
||||
messageDigest.update(clearString.getBytes(StandardCharsets.UTF_8));
|
||||
byte[] bytes = messageDigest.digest();
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
for (byte b : bytes)
|
||||
{
|
||||
buffer.append(Integer.toString((b & 0xff) + 0x100, 16).substring(1));
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
catch (Exception ignored)
|
||||
{
|
||||
ignored.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -713,7 +713,7 @@ 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();
|
||||
});
|
||||
}
|
||||
@ -929,6 +929,9 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
||||
noLUPresent.set(true);
|
||||
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
|
||||
|
||||
|
||||
this.refreshList();
|
||||
|
||||
if (this.mShouldCloseActivity) super.onBackPressed();
|
||||
});
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package it.integry.integrywmsnative.gest.accettazione_ordini_picking;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.ean128.Ean128Service;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliAccettazioneRESTConsumer;
|
||||
@ -33,14 +34,15 @@ public class AccettazioneOrdiniPickingModule {
|
||||
PrinterRESTConsumer printerRESTConsumer,
|
||||
AccettazioneOrdiniPickingRESTConsumer accettazioneOrdiniPickingRESTConsumer,
|
||||
ColliAccettazioneRESTConsumer colliAccettazioneRESTConsumer,
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer) {
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
|
||||
Ean128Service ean128Service) {
|
||||
return new AccettazioneOrdiniPickingViewModel(articoloRESTConsumer,
|
||||
barcodeRESTConsumer,
|
||||
colliMagazzinoRESTConsumer,
|
||||
printerRESTConsumer,
|
||||
accettazioneOrdiniPickingRESTConsumer,
|
||||
colliAccettazioneRESTConsumer,
|
||||
colliLavorazioneRESTConsumer);
|
||||
colliLavorazioneRESTConsumer, ean128Service);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@ import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.ean128.Ean128Service;
|
||||
import it.integry.integrywmsnative.core.exception.AlreadyUsedAnonymousLabelException;
|
||||
import it.integry.integrywmsnative.core.exception.InvalidLUMultiGestioneException;
|
||||
import it.integry.integrywmsnative.core.exception.LUScanNotGrantedException;
|
||||
@ -31,6 +32,7 @@ import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUDCDTO;
|
||||
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
@ -40,6 +42,7 @@ import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsu
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliCaricoRESTConsumerInterface;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
|
||||
@ -55,7 +58,6 @@ import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUDCDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.dto.OrdineAccettazioneInevasoDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.dto.SitArtOrdDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_picking.dto.HistoryMtbAartDTO;
|
||||
@ -74,6 +76,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
private final AccettazioneOrdiniPickingRESTConsumer mAccettazioneOrdiniPickingRESTConsumer;
|
||||
private final ColliAccettazioneRESTConsumer mColliAccettazioneRESTConsumer;
|
||||
private final ColliLavorazioneRESTConsumer mColliLavorazioneRESTConsumer;
|
||||
private final Ean128Service mEan128Service;
|
||||
|
||||
private ColliCaricoRESTConsumerInterface mColliCaricoRESTConsumer;
|
||||
|
||||
@ -95,7 +98,8 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
PrinterRESTConsumer printerRESTConsumer,
|
||||
AccettazioneOrdiniPickingRESTConsumer accettazioneOrdiniPickingRESTConsumer,
|
||||
ColliAccettazioneRESTConsumer colliAccettazioneRESTConsumer,
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer) {
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
|
||||
Ean128Service ean128Service) {
|
||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||
@ -103,6 +107,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
this.mAccettazioneOrdiniPickingRESTConsumer = accettazioneOrdiniPickingRESTConsumer;
|
||||
this.mColliAccettazioneRESTConsumer = colliAccettazioneRESTConsumer;
|
||||
this.mColliLavorazioneRESTConsumer = colliLavorazioneRESTConsumer;
|
||||
this.mEan128Service = ean128Service;
|
||||
}
|
||||
|
||||
|
||||
@ -209,7 +214,11 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
//dell'etichetta anonima
|
||||
this.executeEtichettaAnonimaNotOpenedLU(barcodeScanDTO, onComplete);
|
||||
} else {
|
||||
this.processBarcodeNotOpenedLU(barcodeScanDTO, onComplete);
|
||||
if (SettingsManager.iDB().isFlagAllowBarcodeFornitore() && UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||
this.executeSSCCFornitore(barcodeScanDTO, onComplete);
|
||||
} else {
|
||||
this.processBarcodeNotOpenedLU(barcodeScanDTO, null, onComplete);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
@ -221,6 +230,18 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
private void executeSSCCFornitore(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||
try {
|
||||
Ean128Model ean128Model = mEan128Service.decode(barcodeScanDTO);
|
||||
|
||||
//Nel caso trovo un SSCC lo aggiungo
|
||||
this.processBarcodeNotOpenedLU(barcodeScanDTO, ean128Model.Sscc, onComplete);
|
||||
|
||||
} catch (Exception e) {
|
||||
this.sendError(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void executeEtichettaAnonimaNotOpenedLU(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||
mColliMagazzinoRESTConsumer.getBySSCC(barcodeScanDTO.getStringValue(), true, false, mtbColt -> {
|
||||
|
||||
@ -233,6 +254,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
try {
|
||||
numCollo = UtilityBarcode.getNumColloFromULAnonima(barcodeScanDTO.getStringValue());
|
||||
this.createNewLU(
|
||||
null,
|
||||
numCollo,
|
||||
CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE, true, onComplete);
|
||||
} catch (Exception ex) {
|
||||
@ -246,12 +268,17 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private void processBarcodeNotOpenedLU(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||
private void processBarcodeNotOpenedLU(BarcodeScanDTO barcodeScanDTO, String customSSCC, Runnable onComplete) {
|
||||
this.createNewLU(
|
||||
customSSCC,
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
() -> processBarcodeAlreadyOpenedLU(barcodeScanDTO, onComplete));
|
||||
() -> {
|
||||
if(UtilityString.isNullOrEmpty(customSSCC))
|
||||
processBarcodeAlreadyOpenedLU(barcodeScanDTO, onComplete);
|
||||
else onComplete.run();
|
||||
});
|
||||
}
|
||||
|
||||
private void processBarcodeAlreadyOpenedLU(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||
@ -260,7 +287,6 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
//Cerco tramite etichetta ean 128 (che può indicarmi un articolo o una UL)
|
||||
this.executeEtichettaEanPeso(barcodeScanDTO, onComplete);
|
||||
|
||||
|
||||
} else if (UtilityBarcode.isEtichettaPosizione(barcodeScanDTO)) {
|
||||
//Applico filtro per posizione
|
||||
this.executeEtichettaPosizione(barcodeScanDTO, onComplete);
|
||||
@ -269,7 +295,6 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
//Cerco tramite etichetta ean 128 (che può indicarmi un articolo o una UL)
|
||||
this.executeEtichettaEan128(barcodeScanDTO, onComplete);
|
||||
|
||||
|
||||
} else {
|
||||
this.loadArticolo(barcodeScanDTO.getStringValue(), null, onComplete);
|
||||
}
|
||||
@ -367,7 +392,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
public void createNewLU(Integer customNumCollo, String customSerCollo, boolean disablePrint, Runnable onComplete) {
|
||||
public void createNewLU(String customSSCC, Integer customNumCollo, String customSerCollo, boolean disablePrint, Runnable onComplete) {
|
||||
this.sendOnInfoAggiuntiveRequest((additionalNotes, tCol) -> {
|
||||
|
||||
final List<CreateUDCRequestOrderDTO> orders = Stream.of(this.mOrders)
|
||||
@ -377,8 +402,8 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
.setDataOrd(UtilityDate.toLocalDate(x.getDataD()))
|
||||
.setNumOrd(x.getNumero());
|
||||
|
||||
if(x.getGestioneEnum() == GestioneEnum.PRODUZIONE) {
|
||||
if(x.isOrdTrasf())
|
||||
if (x.getGestioneEnum() == GestioneEnum.PRODUZIONE) {
|
||||
if (x.isOrdTrasf())
|
||||
createUDCRequestOrderDTO.setGestione(GestioneEnum.ACQUISTO.getText());
|
||||
else
|
||||
createUDCRequestOrderDTO.setGestione(GestioneEnum.LAVORAZIONE.getText());
|
||||
@ -396,6 +421,7 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
.setCodTcol(tCol != null ? tCol.getCodTcol() : null)
|
||||
.setNumCollo(customNumCollo)
|
||||
.setSerCollo(customSerCollo)
|
||||
.setBarcodeUl(customSSCC)
|
||||
.setOrders(orders);
|
||||
|
||||
this.mColliCaricoRESTConsumer.createUDC(createUDCRequestDTO, createdUDS -> {
|
||||
@ -782,11 +808,40 @@ public class AccettazioneOrdiniPickingViewModel {
|
||||
}
|
||||
|
||||
private void postCloseOperations() {
|
||||
this.calculateQtaDaEvadere();
|
||||
this.mCurrentMtbColt = null;
|
||||
this.sendLUClosed();
|
||||
this.sendOnLoadingEnded();
|
||||
}
|
||||
|
||||
private void calculateQtaDaEvadere() {
|
||||
if (SettingsManager.iDB().isFlagDeleteRowOnClose()) {
|
||||
for (PickingObjectDTO pickingObjectDTO : this.mPickingList.getValue()) {
|
||||
List<MtbColr> withdrawMtbColrs = pickingObjectDTO.getWithdrawMtbColrs();
|
||||
BigDecimal qtaEvasa = BigDecimal.ZERO;
|
||||
BigDecimal numCnf = BigDecimal.ZERO;
|
||||
|
||||
if (withdrawMtbColrs.size() > 0) {
|
||||
qtaEvasa = Stream.of(withdrawMtbColrs)
|
||||
.map(MtbColr::getQtaCol)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
numCnf = Stream.of(withdrawMtbColrs)
|
||||
.map(MtbColr::getNumCnf)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
|
||||
BigDecimal qtaDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getQtaDaEvadere();
|
||||
pickingObjectDTO.getSitArtOrdDTO().setQtaDaEvadere(qtaDaEvadere.subtract(qtaEvasa));
|
||||
|
||||
BigDecimal numCnfDaEvadere = pickingObjectDTO.getSitArtOrdDTO().getNumCnfDaEvadere();
|
||||
pickingObjectDTO.getSitArtOrdDTO().setNumCnfDaEvadere(numCnfDaEvadere.subtract(numCnf));
|
||||
|
||||
pickingObjectDTO.setWithdrawMtbColrs(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteLU(Runnable onComplete) {
|
||||
DeleteULRequestDTO deleteULRequestDTO = new DeleteULRequestDTO()
|
||||
.setMtbColt(this.mCurrentMtbColt);
|
||||
|
||||
@ -3,10 +3,9 @@ package it.integry.integrywmsnative.gest.contab_doc_interni.dialog;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.exception.DocumentRequiredException;
|
||||
@ -34,24 +33,11 @@ public class DialogSelectDocInfoViewModel extends ViewModel {
|
||||
private final MutableLiveData<Boolean> noteRequired = new MutableLiveData<>(false);
|
||||
|
||||
public DialogSelectDocInfoViewModel() {
|
||||
tipoDoc.observeForever(val ->
|
||||
fornitoreRequired.postValue(
|
||||
val != null &&
|
||||
(val.getGestioneDoc().equals("T") ||
|
||||
val.getGestioneDoc().equals("A") ||
|
||||
(val.getGestioneDoc().equals("P") &&
|
||||
!val.getGestione().equals("L")))));
|
||||
tipoDoc.observeForever(val -> fornitoreRequired.postValue(val != null && (val.getGestioneDoc().equals("T") || val.getGestioneDoc().equals("A") || (val.getGestioneDoc().equals("P") && !val.getGestione().equals("L")))));
|
||||
|
||||
tipoDoc.observeForever(val ->
|
||||
documentRequired.postValue(
|
||||
val != null &&
|
||||
val.getGestioneDoc().equalsIgnoreCase("P") && !val.getGestione().equalsIgnoreCase("L")));
|
||||
tipoDoc.observeForever(val -> documentRequired.postValue(val != null && val.getGestioneDoc().equalsIgnoreCase("P") && !val.getGestione().equalsIgnoreCase("L")));
|
||||
|
||||
tipoDoc.observeForever(val ->
|
||||
noteRequired.postValue(
|
||||
val != null &&
|
||||
val.getGestioneDoc().equals("P") &&
|
||||
val.getGestione().equals("L")));
|
||||
tipoDoc.observeForever(val -> noteRequired.postValue(val != null && val.getGestioneDoc().equals("P") && val.getGestione().equals("L")));
|
||||
}
|
||||
|
||||
public MutableLiveData<List<FornitoreDTO>> getAvailableFornitori() {
|
||||
@ -60,18 +46,15 @@ public class DialogSelectDocInfoViewModel extends ViewModel {
|
||||
|
||||
public void setFornitori(List<FornitoreDTO> fornitori) {
|
||||
tipoDoc.observeForever(val -> {
|
||||
availableFornitori.postValue(Stream.of(fornitori)
|
||||
.filter(forn -> {
|
||||
if (val.getGestioneDoc().equalsIgnoreCase("T")) {
|
||||
return forn.getTipoAnag().equalsIgnoreCase("D") &&
|
||||
forn.getGestioneAnag().equalsIgnoreCase(
|
||||
val.getGestione().equalsIgnoreCase("V") ? "V" : "L"
|
||||
);
|
||||
} else {
|
||||
return forn.getTipoAnag().equalsIgnoreCase("F");
|
||||
}
|
||||
})
|
||||
.toList());
|
||||
List<FornitoreDTO> availableFornitoriList = fornitori.stream().filter(forn -> {
|
||||
if (val.getGestioneDoc().equalsIgnoreCase("T")) {
|
||||
return forn.getTipoAnag().equalsIgnoreCase("D") && forn.getGestioneAnag().equalsIgnoreCase(val.getGestione().equalsIgnoreCase("V") ? "V" : "L");
|
||||
} else {
|
||||
return forn.getTipoAnag().equalsIgnoreCase("F");
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
availableFornitori.postValue(availableFornitoriList);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -22,8 +22,10 @@ import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingL
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||
import it.integry.integrywmsnative.core.rest.model.documento.DocumentoArtDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilitySHA1;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.ArtDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.CheckFornitoreDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.ColloDTO;
|
||||
@ -201,8 +203,12 @@ public class DocInterniEditFormViewModel {
|
||||
|
||||
private SaveDTO getSaveDto() {
|
||||
SqlMtbColt document = this.getDocument();
|
||||
|
||||
String UUID = SettingsManager.i().getUserSession().getDeviceId() + "-" + document.getId();
|
||||
UUID = UtilitySHA1.getSha1Hex(UUID);
|
||||
|
||||
SaveDTO saveDTO = new SaveDTO();
|
||||
saveDTO.setUUID(String.valueOf(document.getId()));
|
||||
saveDTO.setUUID(UUID);
|
||||
saveDTO.setIdDisp("1");
|
||||
saveDTO.setGestione(document.getGestione());
|
||||
saveDTO.setCodMdep(document.getCodMdep());
|
||||
|
||||
@ -25,6 +25,7 @@ import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsume
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.databinding.ActivityContenutoBancaleBinding;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ui.ContenutoBancaleListAdapter;
|
||||
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||
@ -124,9 +125,10 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
||||
}
|
||||
|
||||
private void initColloInfo() {
|
||||
mDepositoRESTConsumer.getDepoByCodMdep(mtbColt.get().getCodMdep(), depo -> {
|
||||
descrizioneDepo.set("(" + depo.getDescrizione() + ")");
|
||||
}, this::onError);
|
||||
SettingsManager.iDB().getAvailableCodMdep().stream()
|
||||
.filter(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.get().getCodMdep()))
|
||||
.findFirst()
|
||||
.ifPresent(x -> descrizioneDepo.set("(" + x.getDescrizione() + ")"));
|
||||
}
|
||||
|
||||
private void initFab() {
|
||||
@ -138,7 +140,7 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
||||
fabPopupMenu.setForceShowIcon(true);
|
||||
fabPopupMenu.getMenuInflater().inflate(R.menu.contenuto_bancale_fab_menu, fabPopupMenu.getMenu());
|
||||
|
||||
if(mtbColt.get().isDocumentPresent()){
|
||||
if (mtbColt.get().isDocumentPresent()) {
|
||||
fabPopupMenu.getMenu().removeItem(R.id.delete_ul);
|
||||
}
|
||||
|
||||
|
||||
@ -26,18 +26,16 @@ public class ListaBancaliViewModel {
|
||||
public void dispatchMtbColt(MtbColt mtbColtToDispatch, boolean onlyResiduo, RunnableArgs<MtbColt> onComplete) {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
new Thread(() -> {
|
||||
mColliMagazzinoRESTConsumer.getByTestata(mtbColtToDispatch, onlyResiduo, false, mtbColt -> {
|
||||
this.sendOnLoadingEnded();
|
||||
mColliMagazzinoRESTConsumer.getByTestata(mtbColtToDispatch, onlyResiduo, false, mtbColt -> {
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
ObservableArrayList<MtbColr> mtbColrObservableArrayList = new ObservableArrayList<>();
|
||||
if(mtbColt != null && mtbColt.getMtbColr() != null) mtbColrObservableArrayList.addAll(mtbColt.getMtbColr());
|
||||
mtbColtToDispatch.setMtbColr(mtbColrObservableArrayList);
|
||||
ObservableArrayList<MtbColr> mtbColrObservableArrayList = new ObservableArrayList<>();
|
||||
if (mtbColt != null && mtbColt.getMtbColr() != null)
|
||||
mtbColrObservableArrayList.addAll(mtbColt.getMtbColr());
|
||||
mtbColtToDispatch.setMtbColr(mtbColrObservableArrayList);
|
||||
|
||||
onComplete.run(mtbColtToDispatch);
|
||||
}, this::sendError);
|
||||
|
||||
}).start();
|
||||
onComplete.run(mtbColtToDispatch);
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -213,10 +213,16 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
||||
(recoveredMtbColt.getGestioneEnum() == GestioneEnum.VENDITA ||
|
||||
recoveredMtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE)) {
|
||||
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
if(recoveredMtbColtDto.getTestateOrdini() != null &&
|
||||
!recoveredMtbColtDto.getTestateOrdini().isEmpty()){
|
||||
codMdep = recoveredMtbColtDto.getTestateOrdini().get(0).getCodMdep();
|
||||
}
|
||||
|
||||
var closeUDSRequestDto = new CloseUDSRequestDTO()
|
||||
.setMtbColt(recoveredMtbColt)
|
||||
//.setPrintSSCC(shouldPrint)
|
||||
.setOrderCodMdep(recoveredMtbColtDto.getTestateOrdini().get(0).getCodMdep());
|
||||
.setOrderCodMdep(codMdep);
|
||||
|
||||
RunnableArgs<CloseUDSResponseDTO> onRequestComplete = closeUDSResponseDto -> {
|
||||
colliDataRecoverService.closeSession(recoveredMtbColtID);
|
||||
|
||||
@ -7,7 +7,7 @@ import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAutom
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterClienteLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterDepositoLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterGruppoMercLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterPaeseLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterTermConsLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterVettoreLayoutView;
|
||||
|
||||
@ -60,7 +60,7 @@ import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAutom
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterClienteLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterDepositoLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterGruppoMercLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterPaeseLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterTermConsLayoutView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterVettoreLayoutView;
|
||||
|
||||
@ -8,6 +8,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
@ -93,10 +94,11 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
public static PickingLiberoFragment newInstance(GestioneEnum gestioneEnum, boolean askCliente, boolean askLineaProd) {
|
||||
public static PickingLiberoFragment newInstance(@StringRes int title, GestioneEnum gestioneEnum, boolean askCliente, boolean askLineaProd) {
|
||||
PickingLiberoFragment fragment = new PickingLiberoFragment();
|
||||
Bundle args = new Bundle();
|
||||
|
||||
args.putInt("title", title);
|
||||
args.putString("gestione", gestioneEnum.getText());
|
||||
args.putBoolean("askCliente", askCliente);
|
||||
args.putBoolean("askLineaProd", askLineaProd);
|
||||
@ -108,7 +110,6 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
@Override
|
||||
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||
mToolbarTitleText = titleText;
|
||||
mToolbarTitleText.setText(context.getText(R.string.free_picking_title_fragment).toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -119,6 +120,9 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
mCurrentGestione = GestioneEnum.fromString(getArguments().getString("gestione"));
|
||||
mAskCliente = getArguments().getBoolean("askCliente");
|
||||
mAskLineaProd = getArguments().getBoolean("askLineaProd");
|
||||
|
||||
|
||||
mToolbarTitleText.setText(getText(getArguments().getInt("title")).toString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -13,6 +13,7 @@ import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.exception.InvalidCodMdepException;
|
||||
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||
import it.integry.integrywmsnative.core.exception.ScannedPositionNotExistException;
|
||||
@ -211,7 +212,14 @@ public class PickingLiberoViewModel {
|
||||
}
|
||||
} else if (mtbColtList.size() == 1) {
|
||||
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||
pickMerceULtoUL(mtbColt, articolo, onComplete);
|
||||
|
||||
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||
|
||||
if (codMdepIsValid) {
|
||||
pickMerceULtoUL(mtbColt, articolo, onComplete);
|
||||
} else this.sendError(new InvalidCodMdepException());
|
||||
|
||||
}, this::sendError);
|
||||
} else {
|
||||
this.sendError(new TooManyLUFoundInMonoLUPositionException());
|
||||
@ -235,7 +243,14 @@ public class PickingLiberoViewModel {
|
||||
if (mtbColtScanned == null) {
|
||||
this.sendError(new NoLUFoundException());
|
||||
} else if ((mtbColtScanned.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColtScanned.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && mtbColtScanned.getSegno() > 0) {
|
||||
pickMerceULtoUL(mtbColtScanned, onComplete);
|
||||
|
||||
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColtScanned.getCodMdep()));
|
||||
|
||||
if (codMdepIsValid) {
|
||||
pickMerceULtoUL(mtbColtScanned, onComplete);
|
||||
} else this.sendError(new InvalidCodMdepException());
|
||||
|
||||
} else {
|
||||
this.sendError(new NoLUFoundException());
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ package it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.filters.FilterCommessaLayoutView;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@ import com.annimon.stream.Stream;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@ -41,7 +42,7 @@ import it.integry.integrywmsnative.databinding.FragmentProdOrdineProduzioneElenc
|
||||
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.AccettazioneOrdiniPickingActivity;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.filters.FilterCommessaLayoutView;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.filters.OrdineProduzioneFilterViewModel;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ui.MainListProdOrdineProduzioneElencoClienteListModel;
|
||||
@ -302,7 +303,7 @@ public class ProdOrdineProduzioneElencoFragment extends BaseFragment implements
|
||||
private List<MainListProdOrdineProduzioneElencoListModel> convertDataModelToListModel(List<OrdineAccettazioneInevasoDTO> dataList) {
|
||||
|
||||
return Stream.of(dataList)
|
||||
.distinctBy(OrdineAccettazioneInevasoDTO::getBarcode)
|
||||
//.distinctBy(OrdineAccettazioneInevasoDTO::getBarcode)
|
||||
.sortBy(x -> x.getRagSocOrd() + (x.getDataConsD() != null ? UtilityDate.formatDate(x.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH) : ""))
|
||||
.map(x -> {
|
||||
MainListProdOrdineProduzioneElencoListModel listModel = new MainListProdOrdineProduzioneElencoListModel();
|
||||
@ -313,15 +314,20 @@ public class ProdOrdineProduzioneElencoFragment extends BaseFragment implements
|
||||
|
||||
listModel.setDescription(String.format(getString(R.string.ord_acq_testata), x.getNumero(), UtilityDate.formatDate(x.getDataD(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN)));
|
||||
|
||||
List<MainListProdOrdineProduzioneElencoClienteListModel> clienti = Stream.of(dataList)
|
||||
.filter(y -> y.getBarcode().equals(x.getBarcode()))
|
||||
.map(y -> new MainListProdOrdineProduzioneElencoClienteListModel()
|
||||
.setPrimaryText(y.getRifOrd())
|
||||
.setRightText(y.getCodJcom())
|
||||
.setOriginalModel(y))
|
||||
.toList();
|
||||
// List<MainListProdOrdineProduzioneElencoClienteListModel> clienti = Stream.of(dataList)
|
||||
// .filter(y -> y.getBarcode().equals(x.getBarcode()))
|
||||
// .map(y -> new MainListProdOrdineProduzioneElencoClienteListModel()
|
||||
// .setPrimaryText(y.getRifOrd())
|
||||
// .setRightText(y.getCodJcom())
|
||||
// .setOriginalModel(y))
|
||||
// .toList();
|
||||
|
||||
listModel.setClientiListModel(clienti);
|
||||
MainListProdOrdineProduzioneElencoClienteListModel cliente = new MainListProdOrdineProduzioneElencoClienteListModel()
|
||||
.setPrimaryText(x.getRifOrd())
|
||||
.setRightText(x.getCodJcom())
|
||||
.setOriginalModel(x);
|
||||
|
||||
listModel.setClientiListModel(Collections.singletonList(cliente));
|
||||
|
||||
return listModel;
|
||||
})
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
package it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
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 HashMap<Integer, FilterChipDTO> AVAILABLE_FILTERS = new HashMap<>() {{
|
||||
|
||||
put(NUM_ORD_FILTER_ID, new FilterChipDTO()
|
||||
.setID(NUM_ORD_FILTER_ID)
|
||||
.setFilterChipText("Numero ordine")
|
||||
.setFilterLayoutView(new FilterNumeroOrdineLayoutView()));
|
||||
|
||||
}};
|
||||
}
|
||||
@ -8,29 +8,54 @@ import android.view.ViewGroup;
|
||||
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
import com.ravikoradiya.liveadapter.Type;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
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.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.databinding.FragmentProdFabbisognoLineeListSingleItemBinding;
|
||||
import it.integry.integrywmsnative.databinding.FragmentProdFabbisognoLineeProdBinding;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaView;
|
||||
import it.integry.integrywmsnative.databinding.FragmentProdFabbisognoLineeTitleItemBinding;
|
||||
import it.integry.integrywmsnative.gest.accettazione_ordini_elenco.dto.OrdineAccettazioneInevasoDTO;
|
||||
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;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.ProdFabbisognoLineeItemModelDto;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.ProdFabbisognoLineeProdDTO;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.filters.ProdFabbisognoLineeProdFilterViewModel;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||
import it.integry.integrywmsnative.gest.spedizione.SpedizioneActivity;
|
||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.prod_fabbisogno_linee_prod.DialogRowInfoProdFabbisognoLineeProdView;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterChipView;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.filters.FilterNumeroOrdineLayoutView;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
@ -39,12 +64,15 @@ import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.prod_fabbiso
|
||||
*/
|
||||
public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITitledFragment, ProdFabbisognoLineeProdViewModel.Listener {
|
||||
|
||||
public BindableBoolean fabVisible = new BindableBoolean(false);
|
||||
|
||||
@Inject
|
||||
ProdFabbisognoLineeProdViewModel mViewModel;
|
||||
|
||||
private final ArrayList<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||
|
||||
private final ObservableArrayList<Object> mProdFabbisognoItemModel = new ObservableArrayList<>();
|
||||
private FragmentProdFabbisognoLineeProdBinding mBindings;
|
||||
private ProdFabbisognoLineeProdFilterViewModel mFilterViewModel = new ProdFabbisognoLineeProdFilterViewModel();
|
||||
|
||||
public ProdFabbisognoLineeProdFragment() {
|
||||
// Required empty public constructor
|
||||
@ -66,13 +94,18 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
||||
Bundle savedInstanceState) {
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.fragment_prod_fabbisogno_linee_prod, container, false);
|
||||
|
||||
mBindings.setLifecycleOwner(this);
|
||||
|
||||
MainApplication.appComponent
|
||||
.prodFabbisognoLineeProdComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
mViewModel.setListener(this);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
mBindings.setView(this);
|
||||
mBindings.setViewmodel(mViewModel);
|
||||
|
||||
this.initRecyclerView();
|
||||
this.initFilters();
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
@ -80,25 +113,162 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
|
||||
this.mViewModel.setListener(this);
|
||||
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
|
||||
DialogAskMagazzinoProssimitaView
|
||||
.newInstance((jtbFase, startDate, endDate) -> {
|
||||
// if (jtbFase == null) {
|
||||
// ((IPoppableActivity) getActivity()).pop();
|
||||
// } else {
|
||||
//Load fabbisogno
|
||||
this.mViewModel.loadFabbisogno(startDate, endDate, codMdep, this::startPickingActivity);
|
||||
// }
|
||||
}, () -> {
|
||||
popMe();
|
||||
})
|
||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
||||
mViewModel.init();
|
||||
}
|
||||
|
||||
private void initRecyclerView() {
|
||||
mViewModel.getOrdiniList().observe(getViewLifecycleOwner(), data -> {
|
||||
mBindings.emptyView.setVisibility(data == null || data.isEmpty() ? View.VISIBLE : View.GONE);
|
||||
|
||||
mFilterViewModel.init(mViewModel.getOrdiniList().getValue());
|
||||
this.refreshList(null);
|
||||
});
|
||||
|
||||
var itemTypeHeader = new Type<GroupTitleModel, FragmentProdFabbisognoLineeTitleItemBinding>(R.layout.fragment_prod_fabbisogno_linee_title_item, BR.item);
|
||||
var itemType = new Type<ProdFabbisognoLineeItemModelDto, FragmentProdFabbisognoLineeListSingleItemBinding>(R.layout.fragment_prod_fabbisogno_linee_list_single_item, BR.item);
|
||||
|
||||
itemTypeHeader.onClick(x -> {
|
||||
var item = x.getBinding().getItem();
|
||||
item.getSelected().set(!item.getSelected().get());
|
||||
|
||||
Stream.of(mProdFabbisognoItemModel)
|
||||
.filter(y -> y instanceof ProdFabbisognoLineeItemModelDto && ((ProdFabbisognoLineeItemModelDto) y).getOrdineLavorazioneDTO().getCodJfas().equals(item.getTitle()))
|
||||
.forEach(y -> {
|
||||
((ProdFabbisognoLineeItemModelDto) y).getSelected().set(item.selected.get());
|
||||
});
|
||||
|
||||
fabVisible.set(Stream.of(mProdFabbisognoItemModel)
|
||||
.filter(y -> y instanceof ProdFabbisognoLineeItemModelDto)
|
||||
.anyMatch(y -> ((ProdFabbisognoLineeItemModelDto) y).getSelected().get()));
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
itemType.onClick(x -> {
|
||||
var item = x.getBinding().getItem();
|
||||
item.getSelected().set(!item.getSelected().get());
|
||||
|
||||
fabVisible.set(Stream.of(mProdFabbisognoItemModel)
|
||||
.filter(y -> y instanceof ProdFabbisognoLineeItemModelDto)
|
||||
.anyMatch(y -> ((ProdFabbisognoLineeItemModelDto) y).getSelected().get()));
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
new LiveAdapter(mProdFabbisognoItemModel)
|
||||
.map(GroupTitleModel.class, itemTypeHeader)
|
||||
.map(ProdFabbisognoLineeItemModelDto.class, itemType)
|
||||
.into(this.mBindings.inventarioList);
|
||||
}
|
||||
|
||||
private void refreshList(List<ProdFabbisognoLineeItemModelDto> filteredList) {
|
||||
List<ProdFabbisognoLineeItemModelDto> tmpList;
|
||||
|
||||
if (filteredList != null) {
|
||||
tmpList = filteredList;
|
||||
} else if (mFilterViewModel != null) {
|
||||
mFilterViewModel.applyAllTests();
|
||||
tmpList = mFilterViewModel.getCurrentList().getValue();
|
||||
} else {
|
||||
tmpList = mViewModel.getOrdiniList().getValue();
|
||||
}
|
||||
this.mProdFabbisognoItemModel.clear();
|
||||
if (tmpList != null) {
|
||||
this.mProdFabbisognoItemModel.addAll(convertDataModelToListModel(tmpList));
|
||||
}
|
||||
}
|
||||
|
||||
private List<Object> convertDataModelToListModel(List<ProdFabbisognoLineeItemModelDto> itemModel) {
|
||||
|
||||
Stream.of(itemModel)
|
||||
.sorted(Comparator.comparing(x -> x.getOrdineLavorazioneDTO().getCodJfas()))
|
||||
.toList();
|
||||
|
||||
List<Object> listaFinale = new ArrayList<>();
|
||||
String currentGroup = null;
|
||||
|
||||
for (ProdFabbisognoLineeItemModelDto item : itemModel) {
|
||||
OrdineLavorazioneDTO ordineLavorazione = item.getOrdineLavorazioneDTO();
|
||||
String codJfas = ordineLavorazione.getCodJfas();
|
||||
|
||||
if (!codJfas.equals(currentGroup)) {
|
||||
listaFinale.add(new GroupTitleModel().setTitle(codJfas));
|
||||
currentGroup = codJfas;
|
||||
}
|
||||
|
||||
listaFinale.add(item);
|
||||
}
|
||||
|
||||
return listaFinale;
|
||||
}
|
||||
|
||||
private void initFilters() {
|
||||
var onPredicateChanged = new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
refreshList(null);
|
||||
}
|
||||
};
|
||||
|
||||
mFilterViewModel.getCurrentNumOrdsPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
|
||||
for (var filterChipDTO : ProdFabbisognoLineeProdBindings.AVAILABLE_FILTERS.entrySet()) {
|
||||
|
||||
FilterChipView filterChipView = new FilterChipView(
|
||||
requireActivity(),
|
||||
filterChipDTO.getValue().getFilterChipText(),
|
||||
v -> initBottomSheetDialogFilter(filterChipDTO.getValue()));
|
||||
|
||||
if (filterChipDTO.getKey() == 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, 0);
|
||||
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
filterChipView.setOnResetClicked(() -> mFilterViewModel.getCurrentNumOrdsPredicate().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() == 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());
|
||||
}
|
||||
|
||||
if (!filterLayoutView.isAdded())
|
||||
filterLayoutView.show(requireActivity().getSupportFragmentManager(), "TAG");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
@ -106,6 +276,7 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
||||
onPreDestroy.run();
|
||||
}
|
||||
|
||||
mViewModel.setListener(null);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@ -114,6 +285,30 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
||||
titleText.setText(context.getText(R.string.prod_fabbisogno_linee_prod_title).toString());
|
||||
}
|
||||
|
||||
public void dispatchOrders() {
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
|
||||
String ordini = UtilityDB.listValueToString(Stream.of(mProdFabbisognoItemModel)
|
||||
.filter(x -> x instanceof ProdFabbisognoLineeItemModelDto && ((ProdFabbisognoLineeItemModelDto) x).selected.get())
|
||||
.map(x -> ((ProdFabbisognoLineeItemModelDto) x).getOrdineLavorazioneDTO().getNumOrd().toString())
|
||||
.toList());
|
||||
|
||||
Date dataInizio = Stream.of(mProdFabbisognoItemModel)
|
||||
.filter(x -> x instanceof ProdFabbisognoLineeItemModelDto && ((ProdFabbisognoLineeItemModelDto) x).selected.get())
|
||||
.map(x -> ((ProdFabbisognoLineeItemModelDto) x).getOrdineLavorazioneDTO().getDataOrdD())
|
||||
.min(Date::compareTo)
|
||||
.orElse(null);
|
||||
|
||||
Date dataFine = Stream.of(mProdFabbisognoItemModel)
|
||||
.filter(x -> x instanceof ProdFabbisognoLineeItemModelDto && ((ProdFabbisognoLineeItemModelDto) x).selected.get())
|
||||
.map(x -> ((ProdFabbisognoLineeItemModelDto) x).getOrdineLavorazioneDTO().getDataOrdD())
|
||||
.max(Date::compareTo)
|
||||
.orElse(null);
|
||||
|
||||
this.mViewModel.loadFabbisogno(ordini, codMdep, dataInizio, dataFine, this::startPickingActivity);
|
||||
|
||||
}
|
||||
|
||||
private void startPickingActivity(List<ProdFabbisognoLineeProdDTO> fabbisognoList) {
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
|
||||
@ -142,7 +337,7 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
||||
|
||||
SpedizioneActivity.startActivity(getActivity(),
|
||||
sitArtOrdDTOS,
|
||||
null,
|
||||
new ArrayList<>(),
|
||||
new ArrayList<>(),
|
||||
GestioneEnum.LAVORAZIONE,
|
||||
+1,
|
||||
@ -150,8 +345,6 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
||||
DialogRowInfoProdFabbisognoLineeProdView.class,
|
||||
divideByGrpMerc);
|
||||
|
||||
popMe();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -2,14 +2,17 @@ package it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
||||
|
||||
@Module(subcomponents = ProdFabbisognoLineeProdComponent.class)
|
||||
public class ProdFabbisognoLineeProdModule {
|
||||
|
||||
@Provides
|
||||
ProdFabbisognoLineeProdViewModel providesProdFabbisognoLineeProdViewModel(ProdFabbisognoLineeProdRESTConsumer prodFabbisognoLineeProdRESTConsumer) {
|
||||
return new ProdFabbisognoLineeProdViewModel(prodFabbisognoLineeProdRESTConsumer);
|
||||
ProdFabbisognoLineeProdViewModel providesProdFabbisognoLineeProdViewModel(
|
||||
ProdFabbisognoLineeProdRESTConsumer prodFabbisognoLineeProdRESTConsumer,
|
||||
MesRESTConsumer mesRESTConsumer) {
|
||||
return new ProdFabbisognoLineeProdViewModel(prodFabbisognoLineeProdRESTConsumer, mesRESTConsumer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,46 +1,85 @@
|
||||
package it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRoomDTO;
|
||||
import it.integry.integrywmsnative.core.exception.NoOrdersScheduledException;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.GroupTitleModel;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.ProdFabbisognoLineeItemModelDto;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.ProdFabbisognoLineeProdDTO;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.rest.ProdFabbisognoLineeProdRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||
|
||||
public class ProdFabbisognoLineeProdViewModel {
|
||||
|
||||
private final ProdFabbisognoLineeProdRESTConsumer mProdFabbisognoLineeProdRESTConsumer;
|
||||
|
||||
private final MesRESTConsumer mMesRESTConsumer;
|
||||
|
||||
private Listener mListener;
|
||||
|
||||
public ProdFabbisognoLineeProdViewModel(ProdFabbisognoLineeProdRESTConsumer prodFabbisognoLineeProdRESTConsumer) {
|
||||
private final MutableLiveData<List<ProdFabbisognoLineeItemModelDto>> ordiniList = new MutableLiveData<>();
|
||||
|
||||
public ProdFabbisognoLineeProdViewModel(
|
||||
ProdFabbisognoLineeProdRESTConsumer prodFabbisognoLineeProdRESTConsumer,
|
||||
MesRESTConsumer mesRESTConsumer) {
|
||||
this.mProdFabbisognoLineeProdRESTConsumer = prodFabbisognoLineeProdRESTConsumer;
|
||||
this.mMesRESTConsumer = mesRESTConsumer;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
|
||||
loadData();
|
||||
}
|
||||
|
||||
|
||||
public void loadFabbisogno(Date startDate, Date endDate, String codMdep, RunnableArgs<List<ProdFabbisognoLineeProdDTO>> onComplete) {
|
||||
public void loadData() {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
this.mProdFabbisognoLineeProdRESTConsumer.loadFabbisogno(startDate, endDate, codMdep, jtbFasi -> {
|
||||
if (jtbFasi != null){
|
||||
Stream.of(jtbFasi)
|
||||
.forEach(x -> x
|
||||
.setDataInizio(startDate)
|
||||
.setDataFine(endDate));
|
||||
this.mMesRESTConsumer.getOrdiniLavorazione("I", ordini -> {
|
||||
|
||||
this.sendOnLoadingEnded();
|
||||
onComplete.run(jtbFasi);
|
||||
}else{
|
||||
this.mListener.onError(new NoOrdersScheduledException());
|
||||
}
|
||||
List<ProdFabbisognoLineeItemModelDto> itemModel = Stream.of(ordini)
|
||||
.filter(x -> x.getCodMdep().equals(SettingsManager.i().getUserSession().getDepo().getCodMdep()))
|
||||
.map(ord -> new ProdFabbisognoLineeItemModelDto()
|
||||
.setOrdineLavorazioneDTO(ord)
|
||||
)
|
||||
.sorted(Comparator.comparing(x -> x.getOrdineLavorazioneDTO().getCodJfas()))
|
||||
.toList();
|
||||
|
||||
ordiniList.postValue(itemModel);
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
public LiveData<List<ProdFabbisognoLineeItemModelDto>> getOrdiniList() {
|
||||
return ordiniList;
|
||||
}
|
||||
|
||||
public void loadFabbisogno(String ordini, String codMdep, Date dataInizio, Date dataFine, RunnableArgs<List<ProdFabbisognoLineeProdDTO>> onComplete) {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
this.mProdFabbisognoLineeProdRESTConsumer.loadFabbisogno(ordini, codMdep, jtbFasi -> {
|
||||
if (jtbFasi == null) jtbFasi = new ArrayList<>();
|
||||
|
||||
Stream.of(jtbFasi)
|
||||
.forEach(x -> {
|
||||
x.setDataInizio(dataInizio);
|
||||
x.setDataFine(dataFine);
|
||||
});
|
||||
|
||||
this.sendOnLoadingEnded();
|
||||
onComplete.run(jtbFasi);
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
package it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto;
|
||||
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
|
||||
public class GroupTitleModel {
|
||||
|
||||
public BindableBoolean selected = new BindableBoolean();
|
||||
public String title;
|
||||
|
||||
public BindableBoolean getSelected() {
|
||||
return selected;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public GroupTitleModel setTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto;
|
||||
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||
|
||||
public class ProdFabbisognoLineeItemModelDto {
|
||||
|
||||
public BindableBoolean selected = new BindableBoolean();
|
||||
public OrdineLavorazioneDTO ordineLavorazioneDTO;
|
||||
|
||||
public BindableBoolean getSelected() {
|
||||
return selected;
|
||||
}
|
||||
|
||||
public OrdineLavorazioneDTO getOrdineLavorazioneDTO() {
|
||||
return ordineLavorazioneDTO;
|
||||
}
|
||||
|
||||
public ProdFabbisognoLineeItemModelDto setOrdineLavorazioneDTO(OrdineLavorazioneDTO ordineLavorazioneDTO) {
|
||||
this.ordineLavorazioneDTO = ordineLavorazioneDTO;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
package it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.filters;
|
||||
|
||||
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_fabbisogno_linee_prod.dto.ProdFabbisognoLineeItemModelDto;
|
||||
|
||||
public class ProdFabbisognoLineeProdFilterViewModel {
|
||||
private final ObservableField<Predicate<ProdFabbisognoLineeItemModelDto>> currentNumOrdsPredicate = new ObservableField<>();
|
||||
|
||||
private List<ProdFabbisognoLineeItemModelDto> initialList;
|
||||
private final MutableLiveData<List<ProdFabbisognoLineeItemModelDto>> currentList = new MutableLiveData<>();
|
||||
|
||||
public void init(List<ProdFabbisognoLineeItemModelDto> initialList){
|
||||
this.initialList = initialList;
|
||||
this.currentList.setValue(this.initialList);
|
||||
}
|
||||
|
||||
public MutableLiveData<List<ProdFabbisognoLineeItemModelDto>> getCurrentList() {
|
||||
return this.currentList;
|
||||
}
|
||||
|
||||
public void setNumOrdFilter(List<Integer> numOrds){
|
||||
if (numOrds == null || numOrds.isEmpty()) currentNumOrdsPredicate.set(null);
|
||||
else{
|
||||
currentNumOrdsPredicate.set(x -> numOrds.contains(x.getOrdineLavorazioneDTO().getNumOrd()));
|
||||
}
|
||||
}
|
||||
|
||||
public void applyAllTests(){
|
||||
List<ProdFabbisognoLineeItemModelDto> returnList = null;
|
||||
|
||||
if (currentNumOrdsPredicate.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();
|
||||
}
|
||||
|
||||
this.currentList.setValue(returnList);
|
||||
}
|
||||
|
||||
public ObservableField<Predicate<ProdFabbisognoLineeItemModelDto>> getCurrentNumOrdsPredicate() {
|
||||
return currentNumOrdsPredicate;
|
||||
}
|
||||
|
||||
public List<Integer> getAllNumOrds(){
|
||||
return Stream
|
||||
.of(Objects.requireNonNull(initialList))
|
||||
.filter(x -> x.getOrdineLavorazioneDTO().getNumOrd() != null)
|
||||
.sortBy(x -> -x.getOrdineLavorazioneDTO().getNumOrd())
|
||||
.map(x -> x.getOrdineLavorazioneDTO().getNumOrd() != null ? x.getOrdineLavorazioneDTO().getNumOrd() : null)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<Integer> getAvailableNumOrds(){
|
||||
if (currentNumOrdsPredicate.get() == null) return getAllNumOrds();
|
||||
else {
|
||||
return Stream.of(this.initialList)
|
||||
.map(x -> x.getOrdineLavorazioneDTO().getNumOrd())
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -32,9 +32,9 @@ public class ProdFabbisognoLineeProdRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
|
||||
public void loadFabbisogno(Date startDate, Date endDate, String codMdep, RunnableArgs<List<ProdFabbisognoLineeProdDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public void loadFabbisogno(String numOrd, String codMdep, RunnableArgs<List<ProdFabbisognoLineeProdDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ProdFabbisognoLineeProdRESTConsumerService prodFabbisognoLineeProdRESTConsumerService = RESTBuilder.getService(ProdFabbisognoLineeProdRESTConsumerService.class);
|
||||
prodFabbisognoLineeProdRESTConsumerService.loadFabbisogno(UtilityDate.formatDate(startDate, "yyyy-MM-dd"), UtilityDate.formatDate(endDate, "yyyy-MM-dd"), codMdep)
|
||||
prodFabbisognoLineeProdRESTConsumerService.loadFabbisogno(numOrd, codMdep)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<ProdFabbisognoLineeProdDTO>>> call,
|
||||
|
||||
@ -13,7 +13,5 @@ import retrofit2.http.Query;
|
||||
public interface ProdFabbisognoLineeProdRESTConsumerService
|
||||
{
|
||||
@GET("wms/approvvigionamento/retrieveFabbisogno")
|
||||
Call<ServiceRESTResponse<List<ProdFabbisognoLineeProdDTO>>> loadFabbisogno(@Query("startDate") String startDate,
|
||||
@Query("endDate") String endDate,
|
||||
@Query("codMdep") String codMdep);
|
||||
Call<ServiceRESTResponse<List<ProdFabbisognoLineeProdDTO>>> loadFabbisogno(@Query("numOrd") String numOrd, @Query("codMdep") String codMdep);
|
||||
}
|
||||
|
||||
@ -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,305 @@
|
||||
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.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.ITitledFragment;
|
||||
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.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.ui.filter_chips.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_position_of_lu.DialogAskPositionOfLUView;
|
||||
|
||||
public class ProdRiposizionamentoDaProdFragment extends BaseFragment implements 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;
|
||||
|
||||
|
||||
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(mViewModel.getItemsInventario().getValue());
|
||||
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;
|
||||
});
|
||||
|
||||
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(List<MvwSitArtUdcDetInventario> item) {
|
||||
try {
|
||||
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 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) {
|
||||
titleText.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,260 @@
|
||||
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.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.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;
|
||||
|
||||
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 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);
|
||||
|
||||
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);
|
||||
|
||||
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())
|
||||
.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,94 @@
|
||||
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 androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
|
||||
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.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
||||
import it.integry.integrywmsnative.databinding.DialogInfoGiacenzaBinding;
|
||||
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 Context mContext;
|
||||
private List<MvwSitArtUdcDetInventario> item;
|
||||
|
||||
public static DialogInfoGiacenzaView newInstance(List<MvwSitArtUdcDetInventario> item) {
|
||||
return new DialogInfoGiacenzaView(item);
|
||||
}
|
||||
|
||||
public DialogInfoGiacenzaView(List<MvwSitArtUdcDetInventario> item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
this.mContext = requireContext();
|
||||
|
||||
mBindings = DialogInfoGiacenzaBinding.inflate(LayoutInflater.from(this.mContext), null, false);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
|
||||
MainApplication.appComponent
|
||||
.dialogInfoGiacenzaComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
setCancelable(true);
|
||||
|
||||
var alertDialog = new MaterialAlertDialogBuilder(this.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(List<MvwSitArtUdcDetInventario> availableItems) {
|
||||
if(availableItems == null || availableItems.isEmpty())
|
||||
return;
|
||||
|
||||
var itemList = Stream.of(availableItems)
|
||||
.map(DialogInfoSituazioneArticoloAvailableListItem::fromMvwSitArtUdcDetInventario)
|
||||
.toList();
|
||||
|
||||
new LiveAdapter(itemList, BR.item)
|
||||
.map(DialogInfoSituazioneArticoloAvailableListItem.class, R.layout.dialog_info_giacenza_list_item)
|
||||
.into(this.mBindings.availableList);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
package it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dialogs.info_giacenza;
|
||||
|
||||
public class DialogInfoGiacenzaViewModel {
|
||||
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
package it.integry.integrywmsnative.gest.prod_riposizionamento_da_prod.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
||||
|
||||
public class ArtsInGiacenzaDTO {
|
||||
|
||||
private String codMart;
|
||||
private String partitaMag;
|
||||
private String descrizione;
|
||||
private String posizione;
|
||||
private BigDecimal numCnf;
|
||||
private Integer numOrd;
|
||||
private Integer count;
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -14,6 +14,7 @@ import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.exception.InvalidCodMdepException;
|
||||
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||
import it.integry.integrywmsnative.core.exception.TooManyLUFoundInMonoLUPositionException;
|
||||
@ -109,7 +110,14 @@ public class ProdVersamentoMaterialeViewModel {
|
||||
this.sendError(new NoLUFoundException());
|
||||
} else if (mtbColtList.size() == 1) {
|
||||
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||
this.onLUOpened(mtbColt);
|
||||
|
||||
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||
|
||||
if (codMdepIsValid) {
|
||||
this.onLUOpened(mtbColt);
|
||||
} else this.sendError(new InvalidCodMdepException());
|
||||
|
||||
}, this::sendError);
|
||||
} else {
|
||||
this.sendError(new TooManyLUFoundInMonoLUPositionException());
|
||||
@ -122,7 +130,12 @@ public class ProdVersamentoMaterialeViewModel {
|
||||
private void executeEtichettaLU(String sscc) {
|
||||
this.mColliMagazzinoRESTConsumer.getBySSCC(sscc, true, false, mtbColt -> {
|
||||
|
||||
this.onLUOpened(mtbColt);
|
||||
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||
|
||||
if (codMdepIsValid) {
|
||||
this.onLUOpened(mtbColt);
|
||||
} else this.sendError(new InvalidCodMdepException());
|
||||
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
@ -94,6 +94,8 @@ public class OrdineLavorazioneDTO {
|
||||
|
||||
private String dataConsCommessa;
|
||||
|
||||
private String descrizioneAttivita;
|
||||
|
||||
private BigDecimal prodStd;
|
||||
|
||||
private Object mtbColtToEdit;
|
||||
@ -523,4 +525,12 @@ public class OrdineLavorazioneDTO {
|
||||
return progress;
|
||||
}
|
||||
|
||||
public String getDescrizioneAttivita() {
|
||||
return descrizioneAttivita;
|
||||
}
|
||||
|
||||
public OrdineLavorazioneDTO setDescrizioneAttivita(String descrizioneAttivita) {
|
||||
this.descrizioneAttivita = descrizioneAttivita;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@ -168,7 +168,7 @@ public class RettificaGiacenzeViewModel {
|
||||
if (onComplete != null) onComplete.run();
|
||||
|
||||
if (mtbAartList != null && mtbAartList.size() > 0) {
|
||||
this.dispatchArt(mtbAartList.get(0), pickData);
|
||||
this.dispatchArts(mtbAartList);
|
||||
} else {
|
||||
this.sendError(new NoResultFromBarcodeException(barcodeProd));
|
||||
}
|
||||
|
||||
@ -81,6 +81,8 @@ public class RettificaGiacenzeRESTConsumer extends _BaseRESTConsumer {
|
||||
Response<ServiceRESTResponse<List<SearchArticoloByBarcodeOrCodMartResponseDTO>>> response) {
|
||||
analyzeAnswer(response, "searchByCodMartOrBarcode", data -> {
|
||||
|
||||
if(data == null) data = new ArrayList<>();
|
||||
|
||||
var listToReturn = Stream.of(data)
|
||||
.map(x -> x.getMtbAart()
|
||||
.setQtaEsistente(x.getQtaEsistente())
|
||||
|
||||
@ -20,6 +20,7 @@ import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||
import it.integry.integrywmsnative.core.exception.EmptyLUException;
|
||||
import it.integry.integrywmsnative.core.exception.InvalidCodMdepException;
|
||||
import it.integry.integrywmsnative.core.exception.InvalidLUException;
|
||||
import it.integry.integrywmsnative.core.exception.NoArtsFoundException;
|
||||
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||
@ -158,7 +159,7 @@ public class SpedizioneViewModel {
|
||||
this.mEnableQuantityReset = enableQuantityReset;
|
||||
this.mUseQtaOrd = useQtaOrd;
|
||||
|
||||
if (testateOrdini != null) {
|
||||
if (testateOrdini != null && testateOrdini.size() > 0) {
|
||||
this.mIsOrdTrasf = Stream.of(testateOrdini).map(OrdineUscitaInevasoDTO::isOrdTrasf).withoutNulls().distinctBy(x -> x).findFirst().get();
|
||||
}
|
||||
|
||||
@ -238,19 +239,18 @@ public class SpedizioneViewModel {
|
||||
mDefaultFiltroOrdine.add(filtro);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if (mDefaultGestioneOfUL == GestioneEnum.VENDITA) {
|
||||
mColliScaricoRESTConsumer = mColliSpedizioneRESTConsumer;
|
||||
if (mDefaultGestioneOfUL == GestioneEnum.VENDITA) {
|
||||
mColliScaricoRESTConsumer = mColliSpedizioneRESTConsumer;
|
||||
|
||||
} else if (mDefaultGestioneOfUL == GestioneEnum.LAVORAZIONE && mDefaultSegnoCol == -1) {
|
||||
mColliScaricoRESTConsumer = mColliLavorazioneRESTConsumer;
|
||||
|
||||
} else if (mDefaultGestioneOfUL == GestioneEnum.LAVORAZIONE && mDefaultSegnoCol == +1) {
|
||||
mColliScaricoRESTConsumer = mColliLavorazioneRESTConsumer;
|
||||
} else {
|
||||
this.sendError(new NotImplementedException(String.format("Gestione %s e segno %d non gestito", mDefaultGestioneOfUL.getText(), mDefaultSegnoCol)));
|
||||
}
|
||||
} else if (mDefaultGestioneOfUL == GestioneEnum.LAVORAZIONE && mDefaultSegnoCol == -1) {
|
||||
mColliScaricoRESTConsumer = mColliLavorazioneRESTConsumer;
|
||||
|
||||
} else if (mDefaultGestioneOfUL == GestioneEnum.LAVORAZIONE && mDefaultSegnoCol == +1) {
|
||||
mColliScaricoRESTConsumer = mColliLavorazioneRESTConsumer;
|
||||
} else {
|
||||
this.sendError(new NotImplementedException(String.format("Gestione %s e segno %d non gestito", mDefaultGestioneOfUL.getText(), mDefaultSegnoCol)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -492,7 +492,13 @@ public class SpedizioneViewModel {
|
||||
}
|
||||
} else {
|
||||
|
||||
this.createNewLU(null, null, () -> searchArtFromUL(mtbColt, onComplete));
|
||||
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||
|
||||
if (codMdepIsValid) {
|
||||
this.createNewLU(null, null, () -> searchArtFromUL(mtbColt, onComplete));
|
||||
} else this.sendError(new InvalidCodMdepException());
|
||||
|
||||
}
|
||||
|
||||
}, this::sendError);
|
||||
@ -530,7 +536,14 @@ public class SpedizioneViewModel {
|
||||
|
||||
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||
this.searchArtFromUL(mtbColt, onComplete);
|
||||
|
||||
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||
|
||||
if (codMdepIsValid) {
|
||||
this.searchArtFromUL(mtbColt, onComplete);
|
||||
} else this.sendError(new InvalidCodMdepException());
|
||||
|
||||
} else {
|
||||
this.sendError(new EmptyLUException());
|
||||
}
|
||||
@ -546,8 +559,17 @@ public class SpedizioneViewModel {
|
||||
|
||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||
if (mtbColt.getSegno() != -1) {
|
||||
searchArtFromUL(mtbColt, onComplete);
|
||||
} else this.sendError(new InvalidLUException());
|
||||
|
||||
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||
|
||||
if (codMdepIsValid) {
|
||||
searchArtFromUL(mtbColt, onComplete);
|
||||
} else this.sendError(new InvalidCodMdepException());
|
||||
|
||||
} else {
|
||||
this.sendError(new InvalidLUException());
|
||||
}
|
||||
} else {
|
||||
this.sendError(new EmptyLUException());
|
||||
}
|
||||
@ -773,7 +795,7 @@ public class SpedizioneViewModel {
|
||||
MtbColt refMtbColt = matchedItem.getRefMtbColt();
|
||||
if (matchedItem.getMtbColts() != null && matchedItem.getMtbColts().size() == 1) {
|
||||
refMtbColt = matchedItem.getMtbColts().get(0);
|
||||
} else if(matchedItem.getTempPickData().getSourceMtbColt() != null){
|
||||
} else if (matchedItem.getTempPickData() != null && matchedItem.getTempPickData().getSourceMtbColt() != null) {
|
||||
refMtbColt = matchedItem.getTempPickData().getSourceMtbColt();
|
||||
}
|
||||
MtbColr refMtbColr = refMtbColt != null ? refMtbColt.getMtbColr().get(0) : null;
|
||||
@ -816,16 +838,16 @@ public class SpedizioneViewModel {
|
||||
.toList();
|
||||
|
||||
//Controllo se una delle partite combacia con quella che voglio evadere
|
||||
if (refMtbColr != null && refMtbColr.getMtbPartitaMag() != null) {
|
||||
MtbPartitaMag refMtbPartitaMag = refMtbColr.getMtbPartitaMag();
|
||||
|
||||
Optional<MtbPartitaMag> matchPartitaMag = Stream.of(availableBatchLots).filter(availableBatchLot -> refMtbPartitaMag.getPartitaMag().equalsIgnoreCase(availableBatchLot.getPartitaMag())).findFirst();
|
||||
|
||||
if (matchPartitaMag.isPresent()) {
|
||||
availableBatchLots.clear();
|
||||
availableBatchLots.add(refMtbPartitaMag);
|
||||
}
|
||||
}
|
||||
// if (refMtbColr != null && refMtbColr.getMtbPartitaMag() != null) {
|
||||
// MtbPartitaMag refMtbPartitaMag = refMtbColr.getMtbPartitaMag();
|
||||
//
|
||||
// Optional<MtbPartitaMag> matchPartitaMag = Stream.of(availableBatchLots).filter(availableBatchLot -> refMtbPartitaMag.getPartitaMag().equalsIgnoreCase(availableBatchLot.getPartitaMag())).findFirst();
|
||||
//
|
||||
// if (matchPartitaMag.isPresent()) {
|
||||
// availableBatchLots.clear();
|
||||
// availableBatchLots.add(refMtbPartitaMag);
|
||||
// }
|
||||
// }
|
||||
|
||||
if (availableBatchLots.size() > 1) {
|
||||
this.sendOnLoadingStarted();
|
||||
@ -862,8 +884,6 @@ public class SpedizioneViewModel {
|
||||
} else {
|
||||
dispatchOrdineRowOnPostBatchLotSelection(pickingObjectDTO, refMtbColt, refMtbColr, null, canPartitaMagBeChanged);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void dispatchOrdineRowOnPostBatchLotSelection(final PickingObjectDTO pickingObjectDTO, MtbColt refMtbColt, MtbColr refMtbColr, MtbColr scannedMtbColr, boolean canPartitaMagBeChanged) {
|
||||
@ -1249,6 +1269,9 @@ public class SpedizioneViewModel {
|
||||
}
|
||||
|
||||
public void createNewLU(Integer customNumCollo, String customSerCollo, Runnable onComplete) {
|
||||
int causaleCollo = 0;
|
||||
if (mDefaultGestioneOfUL == GestioneEnum.LAVORAZIONE && mDefaultSegnoCol == +1) causaleCollo = 1;
|
||||
|
||||
final List<CreateUDSRequestOrderDTO> orders = Stream.of(this.mTestateOrdini)
|
||||
.map(x -> new CreateUDSRequestOrderDTO()
|
||||
.setDataCons(x.getDataConsD() != null ? UtilityDate.toLocalDate(x.getDataConsD()) : null)
|
||||
@ -1262,6 +1285,7 @@ public class SpedizioneViewModel {
|
||||
.setSegno(mDefaultSegnoCol)
|
||||
.setNumCollo(customNumCollo)
|
||||
.setSerCollo(customSerCollo)
|
||||
.setCausaleCollo(causaleCollo)
|
||||
.setOrders(orders);
|
||||
|
||||
this.mColliScaricoRESTConsumer.createUDS(createUDSRequestDTO, createdUDS -> {
|
||||
@ -1489,13 +1513,15 @@ public class SpedizioneViewModel {
|
||||
var clonedLuToClose = (MtbColt) this.mCurrentMtbColt.clone();
|
||||
clonedLuToClose.setMtbColr(null);
|
||||
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
if(mTestateOrdini != null && !mTestateOrdini.isEmpty()) codMdep = mTestateOrdini.get(0).getCodMdep();
|
||||
|
||||
var closeUDSRequestDto = new CloseUDSRequestDTO()
|
||||
.setMtbColt(clonedLuToClose)
|
||||
//.setPrintSSCC(shouldPrint)
|
||||
.setOrderCodMdep(mTestateOrdini.get(0).getCodMdep());
|
||||
.setOrderCodMdep(codMdep);
|
||||
|
||||
|
||||
this.mColliSpedizioneRESTConsumer.closeUDS(closeUDSRequestDto, closeResponse -> {
|
||||
this.mColliScaricoRESTConsumer.closeUDS(closeUDSRequestDto, closeResponse -> {
|
||||
onComplete.run(closeResponse.getGeneratedMtbColts());
|
||||
}, this::sendError);
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.core.exception.InvalidCodMdepException;
|
||||
import it.integry.integrywmsnative.core.exception.InvalidLUGestioneException;
|
||||
import it.integry.integrywmsnative.core.exception.NoArtsInLUException;
|
||||
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||
@ -135,7 +136,12 @@ public class VersamentoMerceViewModel {
|
||||
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||
|
||||
//TAKE HERE
|
||||
pickMerceULtoUL(mtbColt, onComplete);
|
||||
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||
|
||||
if (codMdepIsValid) {
|
||||
pickMerceULtoUL(mtbColt, onComplete);
|
||||
} else this.sendError(new InvalidCodMdepException());
|
||||
|
||||
}, this::sendError);
|
||||
} else {
|
||||
@ -184,11 +190,23 @@ public class VersamentoMerceViewModel {
|
||||
if (mtbColt == null) {
|
||||
this.mColliMagazzinoRESTConsumer.createColloFromEtichettaAnonima(sscc, GestioneEnum.LAVORAZIONE, mtbColtAnonimo -> {
|
||||
onComplete.run();
|
||||
pickMerceULtoUL(mtbColtAnonimo, onComplete);
|
||||
|
||||
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||
|
||||
if (codMdepIsValid) {
|
||||
pickMerceULtoUL(mtbColtAnonimo, onComplete);
|
||||
} else this.sendError(new InvalidCodMdepException());
|
||||
|
||||
}, this::sendError);
|
||||
|
||||
} else {
|
||||
pickMerceULtoUL(mtbColt, onComplete);
|
||||
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||
|
||||
if (codMdepIsValid) {
|
||||
pickMerceULtoUL(mtbColt, onComplete);
|
||||
} else this.sendError(new InvalidCodMdepException());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters;
|
||||
package it.integry.integrywmsnative.ui.filter_chips.filters;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
@ -75,6 +75,7 @@ public class DialogAskLineaProdView extends BaseDialogFragment implements Dialog
|
||||
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
alertDialog.setOnShowListener(this);
|
||||
alertDialog.setOnDismissListener(this);
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
@ -102,6 +103,13 @@ public class DialogAskLineaProdView extends BaseDialogFragment implements Dialog
|
||||
@Override
|
||||
public void onProductionLineSelected(String codJfas) {
|
||||
this.onComplete.run(codJfas);
|
||||
dismiss();
|
||||
|
||||
requireActivity().runOnUiThread(this::dismiss);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
BarcodeManager.removeCallback(mBarcodeScannerIstanceID);
|
||||
super.onDismiss(dialog);
|
||||
}
|
||||
}
|
||||
@ -17,7 +17,7 @@ public class DialogAskLineaProdViewModel {
|
||||
|
||||
MtbDepoPosizione foundPosizione = UtilityPosizione.getFromCache(data.getStringValue());
|
||||
|
||||
if (!foundPosizione.isFlagLineaProduzione()) {
|
||||
if (foundPosizione == null || !foundPosizione.isFlagLineaProduzione()) {
|
||||
this.sendError(new InvalidLineaProdBarcodeException(data.getStringValue()));
|
||||
onComplete.run();
|
||||
return;
|
||||
|
||||
@ -172,11 +172,12 @@ public class DialogAskPositionOfLUView extends BaseDialogFragment implements Dia
|
||||
BarcodeManager.enable();
|
||||
} else {
|
||||
completedFlow = true;
|
||||
|
||||
BarcodeManager.enable();
|
||||
if (onComplete != null)
|
||||
onComplete.run(DialogConsts.Results.YES, foundPosizione);
|
||||
|
||||
dismiss();
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@ -1,20 +1,18 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.choose_batch_lot;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@ -52,30 +50,37 @@ public class DialogChooseBatchLotView extends BaseDialogFragment {
|
||||
this.mOnItemSelected = onItemSelected;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@NonNull
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
this.mContext = getActivity();
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
this.mContext = requireContext();
|
||||
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.dialog_choose_batch_lot, container, false);
|
||||
mBindings = DialogChooseBatchLotBinding.inflate(LayoutInflater.from(this.mContext), null, false);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
|
||||
MainApplication.appComponent
|
||||
.dialogChooseBatchLotComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
mBindings.setView(this);
|
||||
mBindings.setViewmodel(this.mViewModel);
|
||||
|
||||
getDialog().setCanceledOnTouchOutside(false);
|
||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
setCancelable(false);
|
||||
|
||||
return mBindings.getRoot();
|
||||
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
|
||||
.setView(mBindings.getRoot())
|
||||
.setCancelable(isCancelable())
|
||||
.create();
|
||||
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
alertDialog.setOnShowListener(this);
|
||||
alertDialog.setOnDismissListener(this);
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
public void onShow(DialogInterface dialogInterface) {
|
||||
super.onShow(dialogInterface);
|
||||
|
||||
this.initRecyclerView();
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||
|
||||
@ -11,8 +12,16 @@ import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||
public class DialogScanOrCreateLUModule {
|
||||
|
||||
@Provides
|
||||
DialogScanOrCreateLUViewModel providesDialogScanOrCreateLUViewModel(PosizioniRESTConsumer posizioniRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
return new DialogScanOrCreateLUViewModel(posizioniRESTConsumer, barcodeRESTConsumer, colliMagazzinoRESTConsumer, articoloRESTConsumer);
|
||||
DialogScanOrCreateLUViewModel providesDialogScanOrCreateLUViewModel(
|
||||
PosizioniRESTConsumer posizioniRESTConsumer,
|
||||
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
|
||||
ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
|
||||
return new DialogScanOrCreateLUViewModel(posizioniRESTConsumer,
|
||||
barcodeRESTConsumer, colliMagazzinoRESTConsumer,
|
||||
colliLavorazioneRESTConsumer, articoloRESTConsumer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -14,8 +14,10 @@ import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CreateUDCRequestDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityPosizione;
|
||||
@ -27,6 +29,7 @@ public class DialogScanOrCreateLUViewModel {
|
||||
private final PosizioniRESTConsumer mPosizioniRESTConsumer;
|
||||
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
|
||||
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||
private final ColliLavorazioneRESTConsumer mColliLavorazioneRESTConsumer;
|
||||
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||
|
||||
private boolean mShouldCheckResiduo = false;
|
||||
@ -36,10 +39,11 @@ public class DialogScanOrCreateLUViewModel {
|
||||
|
||||
private Listener mListener;
|
||||
|
||||
public DialogScanOrCreateLUViewModel(PosizioniRESTConsumer mPosizioniRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
public DialogScanOrCreateLUViewModel(PosizioniRESTConsumer mPosizioniRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, ColliLavorazioneRESTConsumer mColliLavorazioneRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||
this.mPosizioniRESTConsumer = mPosizioniRESTConsumer;
|
||||
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||
this.mColliLavorazioneRESTConsumer = mColliLavorazioneRESTConsumer;
|
||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||
}
|
||||
|
||||
@ -53,7 +57,11 @@ public class DialogScanOrCreateLUViewModel {
|
||||
|
||||
public void createNewLU() {
|
||||
this.sendOnLoadingStarted();
|
||||
this.mColliMagazzinoRESTConsumer.createColloLavorazione(+1, createdMtbColt -> {
|
||||
|
||||
var createUdcRequest = new CreateUDCRequestDTO()
|
||||
.setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep());
|
||||
|
||||
this.mColliLavorazioneRESTConsumer.createUDC(createUdcRequest, createdMtbColt -> {
|
||||
this.sendOnLoadingEnded();
|
||||
this.sendOnLUOpened(createdMtbColt, true);
|
||||
}, this::sendError);
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="512dp"
|
||||
android:height="512dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:pathData="M440,52.86h-77.9l-20.3,405.3h117.3L440,52.86z"
|
||||
android:fillColor="#BF360C"/>
|
||||
<path
|
||||
android:pathData="M352.5,244.86h-42.7v-64l-128,64v-64l-128,64v213.3h298.7V244.86z"
|
||||
android:fillColor="#E64A19"/>
|
||||
<path
|
||||
android:pathData="M96.5,287.56h42.7v42.7H96.5V287.56z"
|
||||
android:fillColor="#FFC107"/>
|
||||
<path
|
||||
android:pathData="M181.8,287.56h42.7v42.7h-42.7V287.56z"
|
||||
android:fillColor="#FFC107"/>
|
||||
<path
|
||||
android:pathData="M267.2,287.56h42.7v42.7h-42.7V287.56z"
|
||||
android:fillColor="#FFC107"/>
|
||||
<path
|
||||
android:pathData="M96.5,372.86h42.7v42.7H96.5V372.86z"
|
||||
android:fillColor="#FFC107"/>
|
||||
<path
|
||||
android:pathData="M181.8,372.86h42.7v42.7h-42.7V372.86z"
|
||||
android:fillColor="#FFC107"/>
|
||||
<path
|
||||
android:pathData="M267.2,372.86h42.7v42.7h-42.7V372.86z"
|
||||
android:fillColor="#FFC107"/>
|
||||
<path
|
||||
android:pathData="M194.35,50.39l-51.17,7.68c0.85,5.66 -3.07,10.91 -8.68,11.75c-5.61,0.84 -10.91,-3.07 -11.75,-8.68l-51.17,7.68c-11.27,1.69 -19.1,12.28 -17.41,23.55l24.56,163.69c1.69,11.27 12.28,19.1 23.55,17.41l122.78,-18.43c11.27,-1.69 19.1,-12.28 17.41,-23.55L217.9,67.74C216.22,56.52 205.63,48.69 194.35,50.39z"
|
||||
android:fillColor="#455A64"/>
|
||||
<path
|
||||
android:pathData="M222.76,239.64L99.98,258.06c-3.07,0.46 -5.44,-1.29 -5.9,-4.36L69.51,90.01c-0.46,-3.07 1.29,-5.44 4.36,-5.9l122.78,-18.43c3.07,-0.46 5.44,1.29 5.9,4.36l24.56,163.69C227.59,236.85 225.83,239.18 222.76,239.64z"
|
||||
android:fillColor="#FFFFFF"/>
|
||||
<path
|
||||
android:pathData="M143.18,58.06c0.85,5.66 -3.07,10.91 -8.68,11.75c-5.61,0.84 -10.91,-3.07 -11.75,-8.68l-35.83,5.38L90,86.99c0.85,5.66 6.14,9.52 11.75,8.68l71.6,-10.75c5.66,-0.85 9.52,-6.14 8.68,-11.75l-3.07,-20.48L143.18,58.06z"
|
||||
android:fillColor="#90A4AE"/>
|
||||
<path
|
||||
android:pathData="M129.89,39.12c-11.27,1.69 -19.1,12.28 -17.41,23.55c1.69,11.27 12.28,19.1 23.55,17.41s19.1,-12.28 17.41,-23.55C151.75,45.25 141.16,37.43 129.89,39.12zM134.5,69.81c-5.66,0.85 -10.91,-3.07 -11.75,-8.68c-0.84,-5.61 3.07,-10.91 8.68,-11.75s10.91,3.07 11.75,8.68C144.02,63.68 140.16,68.96 134.5,69.81z"
|
||||
android:fillColor="#90A4AE"/>
|
||||
<path
|
||||
android:pathData="M177.94,129.2l-39.13,52.95l-24.79,-18.79l-10.88,14.73l39.92,29.07l49.57,-67.07L177.94,129.2z"
|
||||
android:fillColor="#2958B7"/>
|
||||
<path
|
||||
android:pathData="M244.48,302.31l34.54,7.54"
|
||||
android:fillColor="#00BCD4"/>
|
||||
<path
|
||||
android:pathData="M279.08,309.86"
|
||||
android:fillColor="#00BCD4"/>
|
||||
<path
|
||||
android:pathData="M244.48,302.31c8.49,-38.92 -17.51,-77.83 -58.05,-86.67l7.25,-33.22c59.55,12.99 97.84,70.16 85.35,127.43l30.23,6.59L249,364.24l-34.87,-68.55L244.48,302.31L244.48,302.31"
|
||||
android:strokeWidth="10"
|
||||
android:fillColor="#6DBE45"
|
||||
android:strokeColor="#FFFFFF"/>
|
||||
</vector>
|
||||
21
app/src/main/res/drawable/ic_production_line_produzione.xml
Normal file
21
app/src/main/res/drawable/ic_production_line_produzione.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportWidth="48"
|
||||
android:viewportHeight="48">
|
||||
<path
|
||||
android:pathData="M37,42H5V32h32c2.8,0 5,2.2 5,5l0,0C42,39.8 39.8,42 37,42z"
|
||||
android:fillColor="#B0BEC5"/>
|
||||
<path
|
||||
android:pathData="M10,34c-1.7,0 -3,1.3 -3,3s1.3,3 3,3 3,-1.3 3,-3S11.7,34 10,34zM10,38c-0.6,0 -1,-0.4 -1,-1s0.4,-1 1,-1 1,0.4 1,1S10.6,38 10,38zM19,34c-1.7,0 -3,1.3 -3,3s1.3,3 3,3 3,-1.3 3,-3S20.7,34 19,34zM19,38c-0.6,0 -1,-0.4 -1,-1s0.4,-1 1,-1 1,0.4 1,1S19.6,38 19,38zM37,34c-1.7,0 -3,1.3 -3,3s1.3,3 3,3 3,-1.3 3,-3S38.7,34 37,34zM37,38c-0.6,0 -1,-0.4 -1,-1s0.4,-1 1,-1 1,0.4 1,1S37.6,38 37,38zM28,34c-1.7,0 -3,1.3 -3,3s1.3,3 3,3 3,-1.3 3,-3S29.7,34 28,34zM28,38c-0.6,0 -1,-0.4 -1,-1s0.4,-1 1,-1 1,0.4 1,1S28.6,38 28,38z"
|
||||
android:fillColor="#37474F"/>
|
||||
<path
|
||||
android:pathData="M35,31H11c-1.1,0 -2,-0.9 -2,-2V7c0,-1.1 0.9,-2 2,-2h24c1.1,0 2,0.9 2,2v22C37,30.1 36.1,31 35,31z"
|
||||
android:fillColor="#2958b7"/>
|
||||
<path
|
||||
android:pathData="M26.5,13h-7c-0.8,0 -1.5,-0.7 -1.5,-1.5l0,0c0,-0.8 0.7,-1.5 1.5,-1.5h7c0.8,0 1.5,0.7 1.5,1.5l0,0C28,12.3 27.3,13 26.5,13z"
|
||||
android:fillColor="#0000a5"/>
|
||||
<path
|
||||
android:pathData="M37,31H5v2h32c2.2,0 4,1.8 4,4s-1.8,4 -4,4H5v2h32c3.3,0 6,-2.7 6,-6S40.3,31 37,31z"
|
||||
android:fillColor="#607D8B"/>
|
||||
</vector>
|
||||
@ -21,6 +21,8 @@
|
||||
android:id="@+id/accettazione_main_list_group_item_container_checkBox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
android:enabled="false"
|
||||
tools:layout_editor_absoluteX="0dp"
|
||||
tools:layout_editor_absoluteY="1dp"
|
||||
app:checked="@{selected}" />
|
||||
|
||||
@ -5,21 +5,10 @@
|
||||
|
||||
<data>
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityBigDecimal" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="viewmodel"
|
||||
type="it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotViewModel" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotView" />
|
||||
</data>
|
||||
|
||||
|
||||
@ -28,55 +17,37 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="16dp">
|
||||
|
||||
<RelativeLayout
|
||||
<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:background="@color/light_blue_300"
|
||||
android:gravity="center_horizontal">
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/select_batch_lot" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="24dp"
|
||||
android:src="@drawable/ic_error_white_24dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/main_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="24dp"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingRight="24dp"
|
||||
android:paddingBottom="24dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text"
|
||||
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/select_batch_lot" />
|
||||
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/main_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"/>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
60
app/src/main/res/layout/dialog_info_giacenza.xml
Normal file
60
app/src/main/res/layout/dialog_info_giacenza.xml
Normal file
@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
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.AppCompatTextView
|
||||
android:id="@+id/title_text"
|
||||
style="@style/MaterialAlertDialog.Material3.Title.Text.CenterStacked"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="Situazione articolo" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/available_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:nestedScrollingEnabled="false"
|
||||
tools:listitem="@layout/dialog_info_situazione_articolo_available_list_item"
|
||||
tools:itemCount="3"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</layout>
|
||||
213
app/src/main/res/layout/dialog_info_giacenza_list_item.xml
Normal file
213
app/src/main/res/layout/dialog_info_giacenza_list_item.xml
Normal file
@ -0,0 +1,213 @@
|
||||
<?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>
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityDate" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||
<import type="androidx.core.content.ContextCompat" />
|
||||
<import type="it.integry.integrywmsnative.R" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UntMisUtils" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.info_situazione_articolo.ui.DialogInfoSituazioneArticoloAvailableListItem" />
|
||||
|
||||
</data>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingVertical="8dp">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toStartOf="@id/qta_box"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{"UL " + item.numCollo.toString() + " del " + UtilityDate.formatDate(item.dataCollo, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN)}"
|
||||
android:textStyle="bold"
|
||||
tools:text="UL 109467 del 17 mar 2023" />
|
||||
|
||||
<!-- <androidx.appcompat.widget.AppCompatTextView-->
|
||||
<!-- style="@style/TextAppearance.AppCompat.Small"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:ellipsize="end"-->
|
||||
<!-- android:maxLines="2"-->
|
||||
<!-- android:text="@{UtilityString.isNull(item.descrizioneEstesa, "Nessuna descrizione")}"-->
|
||||
<!-- tools:text="Descrizione lunga articolo" />-->
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:background="@drawable/badge_round_corner_without_padding"
|
||||
android:backgroundTint="@color/light_blue_500"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="@{item.posizione != null ? View.VISIBLE : View.GONE}">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@color/light_blue_500"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/position_label_icon"
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="12dp"
|
||||
android:src="@drawable/ic_location_24"
|
||||
android:tint="@android:color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@{item.posizione}"
|
||||
app:layout_constraintStart_toEndOf="@id/position_label_icon"
|
||||
tools:text="POSIZIONE" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:background="@drawable/badge_round_corner_without_padding"
|
||||
android:backgroundTint="@color/red_300"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="@{item.codJcom != null ? View.VISIBLE : View.GONE}">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@{ContextCompat.getColor(context, item.commessaMatch ? R.color.red_300 : R.color.white)}"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="12dp"
|
||||
android:src="@drawable/ic_tag"
|
||||
android:tint="@android:color/black" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@{item.codJcom}"
|
||||
tools:text="COMMESSA" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/qta_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:padding="6dp"
|
||||
android:visibility="@{item.qtaCol != null ? View.VISIBLE : View.GONE}">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
android:gravity="center"
|
||||
android:text="@{UtilityNumber.decimalToString(item.numCnf, 0)}"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
app:visibility="@{UntMisUtils.shouldBeShowInColli(item.mtbAart)}"
|
||||
tools:text="280"
|
||||
tools:visibility="gone"/>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/unt_mis_col"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
app:visibility="@{UntMisUtils.shouldBeShowInColli(item.mtbAart)}"
|
||||
tools:text="CONF"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
android:gravity="center"
|
||||
android:text="@{UtilityNumber.decimalToString(item.qtaCol, item.mtbAart.firstUntMis.cifreDec.intValue())}"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
app:reverse_visibility="@{UntMisUtils.shouldBeShowInColli(item.mtbAart)}"
|
||||
tools:text="280.45" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@{item.untMis}"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
app:reverse_visibility="@{UntMisUtils.shouldBeShowInColli(item.mtbAart)}"
|
||||
tools:text="CONF" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</layout>
|
||||
@ -15,6 +15,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:focusable="false"
|
||||
android:clickable="false"
|
||||
android:enabled="false"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user