Compare commits
176 Commits
v1.32.15(3
...
v1.34.06(3
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d9e33464a | |||
| ab74a9cbad | |||
| d56dcc0ed2 | |||
| 7e73aceeb7 | |||
| d63c80d6b7 | |||
| bc9016cf93 | |||
| ff128a1de2 | |||
| fa6ad5a150 | |||
| a8aaf69c57 | |||
| 9c86598f03 | |||
| 031cbc8d0a | |||
| df63fbe4af | |||
| 1372e831f7 | |||
| c31700d9cb | |||
| e6ecebd49a | |||
| dfec2f2bd3 | |||
| 3d425b6b02 | |||
| 318a8f645e | |||
| 8ec314044f | |||
| 2965b18a5f | |||
| 24f6341ff6 | |||
| 589a179a1b | |||
| afc2aef691 | |||
| 19e4a14c95 | |||
| 8237466adf | |||
| 3c1471ee8d | |||
| 099d5fa54d | |||
| 8b04f3e696 | |||
| 04ef20c69a | |||
| d08ec43d29 | |||
| 64e5200912 | |||
| 9e79653769 | |||
| 1fee2c901a | |||
| 3713bb5e49 | |||
| fdeb98b82a | |||
| 3e68dd2d36 | |||
| 1a964d7a97 | |||
| 43df6fc9f5 | |||
| 10f7ecd79b | |||
| 9a60b1ff86 | |||
| 386d51ffd7 | |||
| d3804a4601 | |||
| 04720c1d97 | |||
| 0826aa0445 | |||
| 7ceb51a54b | |||
| e8351ca75b | |||
| f8ceb1fb2d | |||
| 4ef49f3523 | |||
| 21ed15a2ea | |||
| aacec1dfde | |||
| ac7e0443a6 | |||
| 4bbb0d5cbb | |||
| 05c28d62d8 | |||
| bf2ac81ab8 | |||
| 17a78ef044 | |||
| 3c78c2787a | |||
| c7358b536e | |||
| 4f9fe14f7e | |||
| 0934765176 | |||
| b7d3cb18b9 | |||
| 227c67dc23 | |||
| da3c9eae6e | |||
| bf37a1acaf | |||
| 2a8974e9c6 | |||
| c34d7dc777 | |||
| 461a2f705e | |||
| 705dd96a0e | |||
| 10128a1bae | |||
| 54d40ca06e | |||
| e4aa2d19d9 | |||
| 6251c0f1ac | |||
| 3caed63b7f | |||
| 75bc046cf5 | |||
| 97d27b047d | |||
| 44e00f4f98 | |||
| 81b053ee06 | |||
| f1b5a7ec1b | |||
| 2d4211d329 | |||
| c5ba78eeda | |||
| 1faaef7062 | |||
| 762c5fd5b5 | |||
| 9af5970ec7 | |||
| 3a5836ba4b | |||
| 72b0e29ae6 | |||
| e0cc802b62 | |||
| 2d4d9cef4e | |||
| 4a8a21b970 | |||
| 5103a53c11 | |||
| 11c4cba70c | |||
| b1dba20973 | |||
| 920c22083b | |||
| f9230ac341 | |||
| 6344c4b77d | |||
| d4c111dedc | |||
| 65dda1d5c0 | |||
| 4a7406fda1 | |||
| ef17e7a0c7 | |||
| c45850555e | |||
| 303690eed2 | |||
| ae62b26edf | |||
| 2e39754c20 | |||
| 0ae6bbcd96 | |||
| 529455931d | |||
| 46d0510ed8 | |||
| b02e12d76e | |||
| c6bbde2b67 | |||
| cfbb27a67b | |||
| 35283fc11b | |||
| c3d62f88b4 | |||
| fc8469bf07 | |||
| 400f1440db | |||
| ad12e7e65b | |||
| a63e3817b5 | |||
| cbd772bf7e | |||
| e90bd46a42 | |||
| 96bd5d516c | |||
| d9306e13c2 | |||
| fc80baeaee | |||
| c0b49b68f7 | |||
| 73242bc208 | |||
| d4b60a51bd | |||
| 1bc687c79a | |||
| 3a6b0949d4 | |||
| bfc03a4ef9 | |||
| 4dfa796790 | |||
| f0db805c84 | |||
| 0cc742e103 | |||
| d01319c417 | |||
| c0b9496041 | |||
| d4e7832f80 | |||
| cb4f9e68f5 | |||
| ac4a5b1d34 | |||
| 39ebc9d367 | |||
| 7ef0299282 | |||
| 6a998d6605 | |||
| 9eb4b0a621 | |||
| f55080f7ca | |||
| 7fb6109e18 | |||
| f419944699 | |||
| 8de54a504b | |||
| 6f2be2b459 | |||
| fa413aba25 | |||
| ab6eeb91a6 | |||
| 16cbe01157 | |||
| 16cb685bb3 | |||
| 28501c5509 | |||
| 79c4bdad48 | |||
| 68007ebc8e | |||
| c5eec26f8d | |||
| 5c3f8d8717 | |||
| 43aa0f0324 | |||
| 4ab7bf27d7 | |||
| 28f4ac4414 | |||
| 60414c949e | |||
| ff09147968 | |||
| 17e66af99a | |||
| 762ab2719d | |||
| 95f282cd4d | |||
| 029979c463 | |||
| e748161dda | |||
| c2c2a1f984 | |||
| fd13f2f1b4 | |||
| ac6cca1eda | |||
| dc46b36624 | |||
| 42aa655021 | |||
| b89085a9c3 | |||
| 557644f024 | |||
| 258ed9d7ca | |||
| be7d3775cc | |||
| 93ffb191b5 | |||
| 8eb58a4d64 | |||
| 4bc8374ea3 | |||
| f76295c3f6 | |||
| b8486b677f | |||
| 1ad2d9ca9b | |||
| 1c34b120db |
17
.idea/deploymentTargetDropDown.xml
generated
Normal file
17
.idea/deploymentTargetDropDown.xml
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<runningDeviceTargetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="SERIAL_NUMBER" />
|
||||
<value value="20119B1E55" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</runningDeviceTargetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2023-07-21T16:48:48.955374400Z" />
|
||||
</component>
|
||||
</project>
|
||||
10
.idea/migrations.xml
generated
Normal file
10
.idea/migrations.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectMigrations">
|
||||
<option name="MigrateToGradleLocalJavaHome">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 355
|
||||
def appVersionName = '1.32.15'
|
||||
def appVersionCode = 390
|
||||
def appVersionName = '1.34.06'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -31,8 +31,6 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
compileSdkVersion 33
|
||||
|
||||
defaultConfig {
|
||||
applicationId "it.integry.integrywmsnative"
|
||||
minSdkVersion 21
|
||||
@@ -65,8 +63,8 @@ android {
|
||||
android.buildFeatures.buildConfig true
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
coreLibraryDesugaringEnabled true
|
||||
}
|
||||
|
||||
@@ -90,8 +88,7 @@ android {
|
||||
abortOnError false
|
||||
}
|
||||
namespace 'it.integry.integrywmsnative'
|
||||
|
||||
|
||||
compileSdk 33
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -67,8 +67,10 @@ import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamento
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.ProdVersamentoMaterialeModule;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditComponent;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.PVOrdineAcquistoEditModule;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.DialogEditArticoloComponent;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.DialogEditArticoloModule;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.edit_articolo.DialogEditArticoloComponent;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.edit_articolo.DialogEditArticoloModule;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.selectArtFromList.DialogSelectArtToOrderComponent;
|
||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.selectArtFromList.DialogSelectArtToOrderModule;
|
||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaComponent;
|
||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.PVOrdiniAcquistoGrigliaModule;
|
||||
import it.integry.integrywmsnative.gest.pv_ordini_acquisto.dialogs.DialogScanGrigliaAcquistoComponent;
|
||||
@@ -174,7 +176,8 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
BottomSheetMtbColrEditModalModule.class,
|
||||
DialogChooseArtsFromMtbAartListModule.class,
|
||||
MainSettingsModule.class,
|
||||
DialogInfoSituazioneArticoloModule.class
|
||||
DialogInfoSituazioneArticoloModule.class,
|
||||
DialogSelectArtToOrderModule.class
|
||||
})
|
||||
public interface MainApplicationComponent {
|
||||
|
||||
@@ -258,8 +261,6 @@ public interface MainApplicationComponent {
|
||||
|
||||
DialogSelectDocInfoComponent.Factory dialogSelectDocInfoNewViewComponent();
|
||||
|
||||
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsComponent();
|
||||
|
||||
DocInterniEditFormComponent.Factory docInterniEditFormComponent();
|
||||
|
||||
InfoAggiuntiveLUDialogComponent.Factory infoAggiuntiveLUDialogComponent();
|
||||
@@ -294,6 +295,10 @@ public interface MainApplicationComponent {
|
||||
|
||||
DialogInfoSituazioneArticoloComponent.Factory dialogInfoSituazioneArticoloComponent();
|
||||
|
||||
DialogSelectDocRowsComponent.Factory dialogSelectDocRowsNewComponent();
|
||||
|
||||
DialogSelectArtToOrderComponent.Factory dialogSelectArtToOrderNewComponent();
|
||||
|
||||
void inject(MainApplication mainApplication);
|
||||
|
||||
void inject(AppContext mainApplication);
|
||||
|
||||
@@ -2,7 +2,6 @@ package it.integry.integrywmsnative;
|
||||
|
||||
import android.app.Application;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import androidx.core.os.HandlerCompat;
|
||||
|
||||
@@ -22,6 +21,7 @@ import it.integry.integrywmsnative.core.menu.MenuService;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.AziendaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliAccettazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliSpedizioneRESTConsumer;
|
||||
@@ -72,7 +72,7 @@ public class MainApplicationModule {
|
||||
@Provides
|
||||
@Singleton
|
||||
public Handler providesMainThreadHandler() {
|
||||
return HandlerCompat.createAsync(Looper.getMainLooper());
|
||||
return HandlerCompat.createAsync(mApplication.getApplicationContext().getMainLooper());
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -89,8 +89,8 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
MainContext providesMainContextNew(MenuService menuService, AppDatabase appDatabase) {
|
||||
return new MainContext(mApplication.getApplicationContext(), menuService, appDatabase);
|
||||
MainContext providesMainContextNew(MenuService menuService, AppDatabase appDatabase, SystemRESTConsumer systemRESTConsumer) {
|
||||
return new MainContext(mApplication.getApplicationContext(), menuService, appDatabase, systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@@ -257,6 +257,12 @@ public class MainApplicationModule {
|
||||
return new DocumentRESTConsumer();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ColliAccettazioneRESTConsumer provideColliAccettazioneRESTConsumer() {
|
||||
return new ColliAccettazioneRESTConsumer();
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ColliSpedizioneRESTConsumer provideColliSpedizioneRESTConsumer() {
|
||||
|
||||
@@ -201,7 +201,7 @@ public class MenuConfiguration extends BaseMenuConfiguration {
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_pv_doc_interni)
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.doc_interni)
|
||||
.setTitleIcon(R.drawable.ic_dashboard_contab_doc_interni)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_contab_doc_interni)
|
||||
.setDrawerIcon(R.drawable.ic_documents_outline)
|
||||
.setFragmentFactory(DocInterniFragment::newInstance))
|
||||
|
||||
// .addItem(new MenuItem()
|
||||
|
||||
@@ -6,6 +6,8 @@ import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.SpannedString;
|
||||
|
||||
import com.google.firebase.installations.FirebaseInstallations;
|
||||
|
||||
import java.net.ConnectException;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
@@ -13,6 +15,7 @@ import javax.inject.Singleton;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.data_store.db.AppDatabase;
|
||||
import it.integry.integrywmsnative.core.menu.MenuService;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.watcher.ServerStatusChecker;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityThread;
|
||||
@@ -23,13 +26,15 @@ public class MainContext {
|
||||
private final Context applicationContext;
|
||||
private final MenuService menuService;
|
||||
private final AppDatabase appDatabase;
|
||||
private final SystemRESTConsumer systemRESTConsumer;
|
||||
|
||||
private Listener mListener;
|
||||
|
||||
public MainContext(Context applicationContext, MenuService menuService, AppDatabase appDatabase) {
|
||||
public MainContext(Context applicationContext, MenuService menuService, AppDatabase appDatabase, SystemRESTConsumer systemRESTConsumer) {
|
||||
this.applicationContext = applicationContext;
|
||||
this.menuService = menuService;
|
||||
this.appDatabase = appDatabase;
|
||||
this.systemRESTConsumer = systemRESTConsumer;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
@@ -40,10 +45,13 @@ public class MainContext {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
|
||||
this.initDBData(() -> {
|
||||
this.initMenu(() -> {
|
||||
|
||||
if (mListener != null) mListener.onContextInitialized();
|
||||
|
||||
this.initDeviceId(() -> {
|
||||
this.initDBData(() -> {
|
||||
this.initMenu(() -> {
|
||||
|
||||
if (mListener != null) mListener.onContextInitialized();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -52,6 +60,25 @@ public class MainContext {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void initDeviceId(Runnable onComplete) {
|
||||
if (SettingsManager.i().getUserSession().getDeviceId() != null) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
FirebaseInstallations.getInstance().getId().addOnCompleteListener(fid -> {
|
||||
SettingsManager.i().getUserSession().setDeviceId(fid.getResult());
|
||||
SettingsManager.update();
|
||||
|
||||
systemRESTConsumer.registerDevice(onComplete, ex -> {
|
||||
if (mListener != null) mListener.onError(new SpannedString(ex.getMessage()));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void logout(Runnable onLoggedOut) {
|
||||
menuService.invalidateCache();
|
||||
UtilityThread.executeParallel(() -> {
|
||||
|
||||
@@ -21,6 +21,7 @@ import it.integry.integrywmsnative.core.data_store.db.dao.InventarioRowDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.OrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.RawDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||
@@ -40,7 +41,7 @@ import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
InventarioRoomDTO.class,
|
||||
InventarioRowRoomDTO.class
|
||||
},
|
||||
version = 15)
|
||||
version = 17)
|
||||
@TypeConverters({
|
||||
DateConverter.class,
|
||||
BigDecimalConverter.class,
|
||||
@@ -66,13 +67,18 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
.addMigrations(MIGRATION_10_11)
|
||||
.addMigrations(MIGRATION_11_12)
|
||||
.addMigrations(MIGRATION_12_13)
|
||||
.addMigrations(MIGRATION_13_14);
|
||||
.addMigrations(MIGRATION_13_14)
|
||||
.addMigrations(MIGRATION_14_15)
|
||||
.addMigrations(MIGRATION_15_16)
|
||||
.addMigrations(MIGRATION_16_17);
|
||||
|
||||
sInstance = builder.build();
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public abstract RawDao rawDao();
|
||||
|
||||
public abstract ArticoloGrigliaDao articoloGrigliaDao();
|
||||
|
||||
public abstract GrigliaDao grigliaDao();
|
||||
@@ -90,6 +96,7 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
public abstract InventarioRowDao inventarioRowDao();
|
||||
|
||||
|
||||
|
||||
static final Migration MIGRATION_10_11 = new Migration(10, 11) {
|
||||
@Override
|
||||
public void migrate(SupportSQLiteDatabase database) {
|
||||
@@ -154,4 +161,25 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
database.execSQL("CREATE UNIQUE INDEX IF NOT EXISTS index_articoli_ordine_id_ordine_cod_mart ON articoli_ordine (id_ordine, cod_mart);");
|
||||
}
|
||||
};
|
||||
static final Migration MIGRATION_15_16 = new Migration(15, 16) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
}
|
||||
};
|
||||
static final Migration MIGRATION_16_17 = new Migration(16, 17) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("ALTER TABLE inventario_rows RENAME TO _inventario_rows_old;");
|
||||
database.execSQL("DROP INDEX index_inventario_rows__id;");
|
||||
database.execSQL("DROP INDEX index_inventario_rows_parent_id;");
|
||||
|
||||
database.execSQL("CREATE TABLE inventario_rows (_id INTEGER PRIMARY KEY AUTOINCREMENT, parent_id INTEGER, cod_mart TEXT, partita_mag TEXT, descrizione TEXT, qta REAL NOT NULL DEFAULT 0, num_cnf REAL NOT NULL DEFAULT 0, qta_cnf REAL NOT NULL DEFAULT 0, unt_mis TEXT NOT NULL DEFAULT '0', data_ora_inv INTEGER, scan_cod_barre TEXT, zona TEXT, remote_sync_date INTEGER, FOREIGN KEY(parent_id) REFERENCES inventari(_id) ON UPDATE NO ACTION ON DELETE CASCADE);");
|
||||
|
||||
database.execSQL("INSERT INTO inventario_rows SELECT * FROM _inventario_rows_old;");
|
||||
|
||||
database.execSQL("CREATE INDEX index_inventario_rows__id ON inventario_rows (_id);");
|
||||
database.execSQL("CREATE INDEX index_inventario_rows_parent_id ON inventario_rows (parent_id)");
|
||||
database.execSQL("DROP TABLE _inventario_rows_old;");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import it.integry.integrywmsnative.core.data_store.db.dao.InventarioRowDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.OrdineDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.dao.RawDao;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoliOrdineRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoloGrigliaRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.GrigliaRepository;
|
||||
@@ -53,7 +54,11 @@ public class RoomModule {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
RawDao providesRawDao(AppDatabase appDatabase) {
|
||||
return appDatabase.rawDao();
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
@@ -104,12 +109,6 @@ public class RoomModule {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
InventarioRowMapper providesInventarioRowMapper() {
|
||||
@@ -123,62 +122,50 @@ public class RoomModule {
|
||||
}
|
||||
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
InventarioLocalDataSource providesInventarioLocalDataSource(ExecutorService executorService, InventarioDao inventarioDao) {
|
||||
return new InventarioLocalDataSource(executorService, inventarioDao);
|
||||
}
|
||||
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
InventarioRowLocalDataSource providesInventarioRowLocalDataSource(ExecutorService executorService, InventarioRowDao inventarioRowDao) {
|
||||
return new InventarioRowLocalDataSource(executorService, inventarioRowDao);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
ArticoloGrigliaRepository providesArticoloGrigliaRepository(ExecutorService executorService, Handler handler, ArticoloGrigliaDao articoloGrigliaDao) {
|
||||
return new ArticoliGrigliaDataSource(executorService, handler, articoloGrigliaDao);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
|
||||
@Provides
|
||||
ArticoliOrdineRepository providesArticoliOrdineRepository(ExecutorService executorService, Handler handler, ArticoloOrdineDao articoloOrdineDao) {
|
||||
return new ArticoliOrdineDataSource(executorService, handler, articoloOrdineDao);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
|
||||
@Provides
|
||||
GrigliaRepository providesGrigliaRepository(ExecutorService executorService, Handler handler, GrigliaDao grigliaDao) {
|
||||
return new GrigliaDataSource(executorService, handler, grigliaDao);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
|
||||
@Provides
|
||||
OrdineRepository providesOrdineRepository(ExecutorService executorService, Handler handler, OrdineDao ordineDao) {
|
||||
return new OrdineDataSource(executorService, handler, ordineDao);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
MtbColtRepository providesMtbColtRepository(ExecutorService executorService, Handler handler, MtbColtDao mtbColtDao) {
|
||||
return new SqlMtbColtDataSource(executorService, handler, mtbColtDao);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
MtbColrDataSource providesMtbColrRepository(ExecutorService executorService, Handler handler, MtbColrDao mtbColrDao) {
|
||||
return new SqlMtbColrDataSource(executorService, handler, mtbColrDao);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
InventarioRepository providesInventarioRepository(ExecutorService executorService, Handler handler,
|
||||
InventarioLocalDataSource inventarioLocalDataSource,
|
||||
@@ -187,7 +174,6 @@ public class RoomModule {
|
||||
return new InventarioRepository(inventarioLocalDataSource, inventarioRESTConsumer, inventarioMapper, handler, executorService);
|
||||
}
|
||||
|
||||
@Singleton
|
||||
@Provides
|
||||
InventarioRowRepository providesInventarioRowRepository(ExecutorService executorService, Handler handler,
|
||||
InventarioRowLocalDataSource inventarioRowLocalDataSource,
|
||||
|
||||
@@ -24,6 +24,6 @@ public interface MtbColrDao {
|
||||
@Delete
|
||||
void delete(SqlMtbColr mtbColr);
|
||||
|
||||
@Query("SELECT * from mtb_colr where id_collo = :idDocument")
|
||||
@Query("SELECT * FROM mtb_colr WHERE id_collo = :idDocument ORDER BY id DESC")
|
||||
List<SqlMtbColr> getDocumentRows(long idDocument);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.dao;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
@@ -33,7 +34,7 @@ public interface MtbColtDao {
|
||||
" AND ( mtb_colt.data_doc = :dataDoc OR (mtb_colt.data_doc is null and :dataDoc is null)) " +
|
||||
" AND ( mtb_colt.num_doc = :numDoc OR (mtb_colt.num_doc is null and :numDoc is null)) " +
|
||||
" and cod_dtip is null group by mtb_colt.id")
|
||||
List<DocInternoWrapper> getLocalDocumentsByCodDtip(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc);
|
||||
LiveData<List<DocInternoWrapper>> getLocalDocumentsByCodDtip(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc);
|
||||
|
||||
@Query("SELECT ifnull(MAX(num_collo),0) +1 as num_collo from mtb_colt")
|
||||
Integer getNextNumCollo();
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.dao;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.RawQuery;
|
||||
import androidx.sqlite.db.SupportSQLiteQuery;
|
||||
|
||||
@Dao
|
||||
public interface RawDao {
|
||||
|
||||
@RawQuery
|
||||
int vacuumDb(SupportSQLiteQuery supportSQLiteQuery);
|
||||
|
||||
}
|
||||
@@ -94,6 +94,9 @@ public class ArticoloOrdine {
|
||||
@Ignore
|
||||
private int bgTint;
|
||||
|
||||
@Ignore
|
||||
private boolean invalid = false;
|
||||
|
||||
|
||||
public Integer getArticoloOrdineId() {
|
||||
return articoloOrdineId;
|
||||
@@ -236,15 +239,15 @@ public class ArticoloOrdine {
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnfPrevistaVendita() {
|
||||
return qtaPrevistaVendita.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaPrevistaVendita.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
return qtaPrevistaVendita == null || qtaPrevistaVendita.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaPrevistaVendita.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnfProposta() {
|
||||
return qtaProposta.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaProposta.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
return qtaProposta == null || qtaProposta.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : qtaProposta.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnfGiacenza() {
|
||||
return giacenza.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : giacenza.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
return giacenza == null || giacenza.equals(BigDecimal.ZERO) ? BigDecimal.ZERO : giacenza.divide(BigDecimal.valueOf(qtaCnf), 0, RoundingMode.CEILING);
|
||||
}
|
||||
|
||||
public boolean isNewNoPromo() {
|
||||
@@ -256,7 +259,7 @@ public class ArticoloOrdine {
|
||||
}
|
||||
|
||||
public float getCnfDaRic() {
|
||||
return qtaCnf > 0.f ? merceDaRic * qtaCnf : 0;
|
||||
return qtaCnf > 0.f ? merceDaRic / qtaCnf : 0;
|
||||
}
|
||||
|
||||
public int checkQtaProposta() {
|
||||
@@ -300,4 +303,13 @@ public class ArticoloOrdine {
|
||||
this.ctMaxOrd = ctMaxOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isInvalid() {
|
||||
return invalid;
|
||||
}
|
||||
|
||||
public ArticoloOrdine setInvalid(boolean invalid) {
|
||||
this.invalid = invalid;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,8 @@ import it.integry.integrywmsnative.core.data_store.db.interfaces.EntityModelInte
|
||||
@ForeignKey(
|
||||
entity = InventarioRoomDTO.class,
|
||||
parentColumns = {BaseSyncDTO.Columns.ID},
|
||||
childColumns = {InventarioRowRoomDTO.Columns.PARENT_ID}
|
||||
childColumns = {InventarioRowRoomDTO.Columns.PARENT_ID},
|
||||
onDelete = ForeignKey.CASCADE
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -51,7 +51,8 @@ public class Ordine {
|
||||
private boolean orderNewProducts = false;
|
||||
|
||||
@ColumnInfo(name = "id_griglia")
|
||||
private int idGriglia;
|
||||
@Nullable
|
||||
private Integer idGriglia;
|
||||
|
||||
@ColumnInfo(name = "cod_alis")
|
||||
private String codAlis;
|
||||
@@ -80,11 +81,11 @@ public class Ordine {
|
||||
this.annotazioni = annotazioni;
|
||||
}
|
||||
|
||||
public int getIdGriglia() {
|
||||
public Integer getIdGriglia() {
|
||||
return idGriglia;
|
||||
}
|
||||
|
||||
public void setIdGriglia(int idGriglia) {
|
||||
public void setIdGriglia(Integer idGriglia) {
|
||||
this.idGriglia = idGriglia;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.data_store.db.repository;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -17,7 +19,7 @@ public interface MtbColtRepository {
|
||||
|
||||
void delete(SqlMtbColt mtbColt, Runnable onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
void getLocalDocumentsByCodDtip(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc, RunnableArgs<List<DocInternoWrapper>> onSuccess, RunnableArgs<Exception> onError);
|
||||
LiveData<List<DocInternoWrapper>> getDocuments(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc);
|
||||
|
||||
void getNextNumCollo(RunnableArgs<Integer> onSuccess, RunnableArgs<Exception> onError);
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ package it.integry.integrywmsnative.core.data_store.db.repository.datasource;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
@@ -50,10 +52,8 @@ public class SqlMtbColtDataSource extends BaseDataSource implements MtbColtRepos
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getLocalDocumentsByCodDtip(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc, RunnableArgs<List<DocInternoWrapper>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
execute(() -> mMtbColtDao.getLocalDocumentsByCodDtip(codDtip, codAnag, codVdes, dataDoc, numDoc),
|
||||
onSuccess,
|
||||
onError);
|
||||
public LiveData<List<DocInternoWrapper>> getDocuments(String codDtip, String codAnag, String codVdes, Date dataDoc, String numDoc) {
|
||||
return mMtbColtDao.getLocalDocumentsByCodDtip(codDtip, codAnag, codVdes, dataDoc, numDoc);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,6 +21,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.mapper.InventarioMapper;
|
||||
import it.integry.integrywmsnative.core.model.MtbInvent;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.InventarioRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLiveData;
|
||||
|
||||
public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioRoomDTO, InventarioMapper, InventarioLocalDataSource, InventarioRESTConsumer> {
|
||||
@@ -62,16 +63,20 @@ public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioR
|
||||
try {
|
||||
var startRetrieve = new Date();
|
||||
var remoteData = remoteDataSource.makeSynchronousRetrieveRequest();
|
||||
Log.d("Timing [INVENTORIES RETRIEVE]", ((new Date().getTime() - startRetrieve.getTime()) / 1000) + " secs");
|
||||
Log.d("Time INVENTORY RETRIEVE", ((new Date().getTime() - startRetrieve.getTime()) / 1000) + " secs");
|
||||
|
||||
if (remoteData == null) remoteData = new ArrayList<>();
|
||||
|
||||
resolveFetch(remoteData, internalLiveData.getValue(),
|
||||
List<MtbInvent> finalRemoteData = remoteData;
|
||||
|
||||
resolveFetch(finalRemoteData, internalLiveData.getValue(),
|
||||
(remoteItem, localItem) -> Objects.equals(remoteItem.getIdInventario(), localItem.getIdInventario()),
|
||||
(remoteItem, localItem) -> {
|
||||
remoteItem.setRemoteSyncDate(localItem.getRemoteSyncDate());
|
||||
remoteItem.setNew(false);
|
||||
}, onComplete, onError);
|
||||
}, () -> handler.post(onComplete), ex -> handler.post(() -> onError.run(ex)),
|
||||
SettingsManager.iDB().isFlagIsInventarioCacheEnabled());
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
onError.run(e);
|
||||
|
||||
@@ -35,7 +35,8 @@ public abstract class _BaseRepository<
|
||||
RunnableArgssWithReturn<B, B, Boolean> keyComparator,
|
||||
RunnableArgss<B, B> dataCopy,
|
||||
Runnable onComplete,
|
||||
RunnableArgs<Exception> onError) {
|
||||
RunnableArgs<Exception> onError,
|
||||
boolean isCacheEnabled) {
|
||||
List<B> finalRemoteData = dataMapper.mapRestsToRooms(remoteData);
|
||||
|
||||
if (localData == null) localData = new ArrayList<>();
|
||||
@@ -53,12 +54,14 @@ public abstract class _BaseRepository<
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var dataToUpdate = finalRemoteData.stream()
|
||||
.filter(x -> x.getId() != null && finalLocalData.stream().noneMatch(x::equals))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
var dataToDelete = finalLocalData.stream()
|
||||
.filter(x -> x.isSyncronized() && finalRemoteData.stream().noneMatch(y -> keyComparator.run(y, x)))
|
||||
.filter(x -> (!isCacheEnabled || x.isSyncronized()) && finalRemoteData.stream().noneMatch(y -> keyComparator.run(y, x)))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
var dataToInsert = finalRemoteData.stream()
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package it.integry.integrywmsnative.core.di;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
import androidx.databinding.BaseObservable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||
|
||||
@@ -20,7 +19,7 @@ public class BindableFloat extends BaseObservable {
|
||||
|
||||
if(numberOfDigits > CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS) numberOfDigits = CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS;
|
||||
|
||||
return new BigDecimal(get());
|
||||
return BigDecimal.valueOf(get());
|
||||
}
|
||||
|
||||
public Float get(boolean defaultIfNull) {
|
||||
|
||||
@@ -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 ExpiredProductListException extends Exception {
|
||||
public ExpiredProductListException() {
|
||||
super(UtilityResources.getString(R.string.expired_list_session));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public class GridNotSelectedException extends Exception {
|
||||
|
||||
public GridNotSelectedException() {
|
||||
super(UtilityResources.getString(R.string.grid_not_selected));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public final class InvalidProductOrderedException extends Exception {
|
||||
|
||||
public InvalidProductOrderedException() {
|
||||
super(UtilityResources.getString(R.string.invalid_product_ordered));
|
||||
}
|
||||
|
||||
public InvalidProductOrderedException(String product) {
|
||||
super(UtilityResources.getString(R.string.invalid_product_ordered) + " (" + product + ")");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public final class MultipleResultFromBarcodeException extends Exception {
|
||||
|
||||
public MultipleResultFromBarcodeException() {
|
||||
super(UtilityResources.getString(R.string.multiple_results_from_barcode));
|
||||
}
|
||||
|
||||
public MultipleResultFromBarcodeException(String barcode) {
|
||||
super(UtilityResources.getString(R.string.multiple_results_from_barcode) + " (" + barcode + ")");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public final class NoResultFromCodMartException extends Exception {
|
||||
|
||||
public NoResultFromCodMartException() {
|
||||
super(UtilityResources.getString(R.string.no_result_from_cod_mart));
|
||||
}
|
||||
|
||||
public NoResultFromCodMartException(String codMart) {
|
||||
super(UtilityResources.getString(R.string.no_result_from_cod_mart) + " (" + codMart + ")");
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class BaseActivity extends AppCompatActivity {
|
||||
|
||||
private void openProgress() {
|
||||
BarcodeManager.disable();
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
||||
|
||||
@@ -27,6 +27,20 @@ public class BaseDialogFragment extends DialogFragment implements DialogInterfac
|
||||
|
||||
private boolean mBarcodeListener = false;
|
||||
|
||||
private boolean cancelable = true;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isCancelable() {
|
||||
return cancelable;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setCancelable(boolean cancelable) {
|
||||
super.setCancelable(cancelable);
|
||||
this.cancelable = cancelable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show(FragmentManager manager, String tag) {
|
||||
@@ -56,7 +70,7 @@ public class BaseDialogFragment extends DialogFragment implements DialogInterfac
|
||||
}
|
||||
|
||||
private void openProgress() {
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
|
||||
@@ -67,7 +67,7 @@ public abstract class BaseFragment extends Fragment {
|
||||
|
||||
private void openProgress() {
|
||||
BarcodeManager.disable();
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
|
||||
@@ -865,4 +865,262 @@ public class MtbAart extends EntityBase {
|
||||
public MtbUntMis getFirstUntMis() {
|
||||
return getMtbUntMis() != null && !getMtbUntMis().isEmpty() ? getMtbUntMis().get(0) : null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
MtbAart mtbAart = (MtbAart) o;
|
||||
|
||||
if (!getCodMart().equals(mtbAart.getCodMart())) return false;
|
||||
if (getDescrizione() != null ? !getDescrizione().equals(mtbAart.getDescrizione()) : mtbAart.getDescrizione() != null)
|
||||
return false;
|
||||
if (getUntMis() != null ? !getUntMis().equals(mtbAart.getUntMis()) : mtbAart.getUntMis() != null)
|
||||
return false;
|
||||
if (getBarCode() != null ? !getBarCode().equals(mtbAart.getBarCode()) : mtbAart.getBarCode() != null)
|
||||
return false;
|
||||
if (getPesoKg() != null ? !getPesoKg().equals(mtbAart.getPesoKg()) : mtbAart.getPesoKg() != null)
|
||||
return false;
|
||||
if (getQtaCnf() != null ? !getQtaCnf().equals(mtbAart.getQtaCnf()) : mtbAart.getQtaCnf() != null)
|
||||
return false;
|
||||
if (getCodAliq() != null ? !getCodAliq().equals(mtbAart.getCodAliq()) : mtbAart.getCodAliq() != null)
|
||||
return false;
|
||||
if (getCodScoArt() != null ? !getCodScoArt().equals(mtbAart.getCodScoArt()) : mtbAart.getCodScoArt() != null)
|
||||
return false;
|
||||
if (getCodTcolUi() != null ? !getCodTcolUi().equals(mtbAart.getCodTcolUi()) : mtbAart.getCodTcolUi() != null)
|
||||
return false;
|
||||
if (getCodTcolUl() != null ? !getCodTcolUl().equals(mtbAart.getCodTcolUl()) : mtbAart.getCodTcolUl() != null)
|
||||
return false;
|
||||
if (getArticoloComposto() != null ? !getArticoloComposto().equals(mtbAart.getArticoloComposto()) : mtbAart.getArticoloComposto() != null)
|
||||
return false;
|
||||
if (getEsposizioneComp() != null ? !getEsposizioneComp().equals(mtbAart.getEsposizioneComp()) : mtbAart.getEsposizioneComp() != null)
|
||||
return false;
|
||||
if (getDescrizioneEstesa() != null ? !getDescrizioneEstesa().equals(mtbAart.getDescrizioneEstesa()) : mtbAart.getDescrizioneEstesa() != null)
|
||||
return false;
|
||||
if (getCodUltForn() != null ? !getCodUltForn().equals(mtbAart.getCodUltForn()) : mtbAart.getCodUltForn() != null)
|
||||
return false;
|
||||
if (getDataUltCar() != null ? !getDataUltCar().equals(mtbAart.getDataUltCar()) : mtbAart.getDataUltCar() != null)
|
||||
return false;
|
||||
if (getValUltCar() != null ? !getValUltCar().equals(mtbAart.getValUltCar()) : mtbAart.getValUltCar() != null)
|
||||
return false;
|
||||
if (getCodUltClie() != null ? !getCodUltClie().equals(mtbAart.getCodUltClie()) : mtbAart.getCodUltClie() != null)
|
||||
return false;
|
||||
if (getDataUltScar() != null ? !getDataUltScar().equals(mtbAart.getDataUltScar()) : mtbAart.getDataUltScar() != null)
|
||||
return false;
|
||||
if (getValUltScar() != null ? !getValUltScar().equals(mtbAart.getValUltScar()) : mtbAart.getValUltScar() != null)
|
||||
return false;
|
||||
if (getTipoCodice() != null ? !getTipoCodice().equals(mtbAart.getTipoCodice()) : mtbAart.getTipoCodice() != null)
|
||||
return false;
|
||||
if (getNote() != null ? !getNote().equals(mtbAart.getNote()) : mtbAart.getNote() != null)
|
||||
return false;
|
||||
if (getPosizione() != null ? !getPosizione().equals(mtbAart.getPosizione()) : mtbAart.getPosizione() != null)
|
||||
return false;
|
||||
if (getColliPedana() != null ? !getColliPedana().equals(mtbAart.getColliPedana()) : mtbAart.getColliPedana() != null)
|
||||
return false;
|
||||
if (getUntMis2() != null ? !getUntMis2().equals(mtbAart.getUntMis2()) : mtbAart.getUntMis2() != null)
|
||||
return false;
|
||||
if (getRapConv2() != null ? !getRapConv2().equals(mtbAart.getRapConv2()) : mtbAart.getRapConv2() != null)
|
||||
return false;
|
||||
if (getFlagInclListino() != null ? !getFlagInclListino().equals(mtbAart.getFlagInclListino()) : mtbAart.getFlagInclListino() != null)
|
||||
return false;
|
||||
if (getUntMis3() != null ? !getUntMis3().equals(mtbAart.getUntMis3()) : mtbAart.getUntMis3() != null)
|
||||
return false;
|
||||
if (getRapConv3() != null ? !getRapConv3().equals(mtbAart.getRapConv3()) : mtbAart.getRapConv3() != null)
|
||||
return false;
|
||||
if (getCodMartStat() != null ? !getCodMartStat().equals(mtbAart.getCodMartStat()) : mtbAart.getCodMartStat() != null)
|
||||
return false;
|
||||
if (getCodMcon() != null ? !getCodMcon().equals(mtbAart.getCodMcon()) : mtbAart.getCodMcon() != null)
|
||||
return false;
|
||||
if (getCodMgrp() != null ? !getCodMgrp().equals(mtbAart.getCodMgrp()) : mtbAart.getCodMgrp() != null)
|
||||
return false;
|
||||
if (getCodMsfa() != null ? !getCodMsfa().equals(mtbAart.getCodMsfa()) : mtbAart.getCodMsfa() != null)
|
||||
return false;
|
||||
if (getCodMsgr() != null ? !getCodMsgr().equals(mtbAart.getCodMsgr()) : mtbAart.getCodMsgr() != null)
|
||||
return false;
|
||||
if (getCodMstp() != null ? !getCodMstp().equals(mtbAart.getCodMstp()) : mtbAart.getCodMstp() != null)
|
||||
return false;
|
||||
if (getCodMtip() != null ? !getCodMtip().equals(mtbAart.getCodMtip()) : mtbAart.getCodMtip() != null)
|
||||
return false;
|
||||
if (getDescrizioneStat() != null ? !getDescrizioneStat().equals(mtbAart.getDescrizioneStat()) : mtbAart.getDescrizioneStat() != null)
|
||||
return false;
|
||||
if (getFlagStato() != null ? !getFlagStato().equals(mtbAart.getFlagStato()) : mtbAart.getFlagStato() != null)
|
||||
return false;
|
||||
if (getCambioDiviCar() != null ? !getCambioDiviCar().equals(mtbAart.getCambioDiviCar()) : mtbAart.getCambioDiviCar() != null)
|
||||
return false;
|
||||
if (getCambioDiviScar() != null ? !getCambioDiviScar().equals(mtbAart.getCambioDiviScar()) : mtbAart.getCambioDiviScar() != null)
|
||||
return false;
|
||||
if (getGgScadPartita() != null ? !getGgScadPartita().equals(mtbAart.getGgScadPartita()) : mtbAart.getGgScadPartita() != null)
|
||||
return false;
|
||||
if (getVolumeMc() != null ? !getVolumeMc().equals(mtbAart.getVolumeMc()) : mtbAart.getVolumeMc() != null)
|
||||
return false;
|
||||
if (getFlagEsponiPrz() != null ? !getFlagEsponiPrz().equals(mtbAart.getFlagEsponiPrz()) : mtbAart.getFlagEsponiPrz() != null)
|
||||
return false;
|
||||
if (getDataUltVar() != null ? !getDataUltVar().equals(mtbAart.getDataUltVar()) : mtbAart.getDataUltVar() != null)
|
||||
return false;
|
||||
if (getPercSfrido() != null ? !getPercSfrido().equals(mtbAart.getPercSfrido()) : mtbAart.getPercSfrido() != null)
|
||||
return false;
|
||||
if (getCodBarreImb() != null ? !getCodBarreImb().equals(mtbAart.getCodBarreImb()) : mtbAart.getCodBarreImb() != null)
|
||||
return false;
|
||||
if (getFlagCalcPrz() != null ? !getFlagCalcPrz().equals(mtbAart.getFlagCalcPrz()) : mtbAart.getFlagCalcPrz() != null)
|
||||
return false;
|
||||
if (getEsposizioneCompAcq() != null ? !getEsposizioneCompAcq().equals(mtbAart.getEsposizioneCompAcq()) : mtbAart.getEsposizioneCompAcq() != null)
|
||||
return false;
|
||||
if (getFlagCalcPrzAcq() != null ? !getFlagCalcPrzAcq().equals(mtbAart.getFlagCalcPrzAcq()) : mtbAart.getFlagCalcPrzAcq() != null)
|
||||
return false;
|
||||
if (getDiacod() != null ? !getDiacod().equals(mtbAart.getDiacod()) : mtbAart.getDiacod() != null)
|
||||
return false;
|
||||
if (getPlu() != null ? !getPlu().equals(mtbAart.getPlu()) : mtbAart.getPlu() != null)
|
||||
return false;
|
||||
if (getPartIvaProd() != null ? !getPartIvaProd().equals(mtbAart.getPartIvaProd()) : mtbAart.getPartIvaProd() != null)
|
||||
return false;
|
||||
if (getRagSocProd() != null ? !getRagSocProd().equals(mtbAart.getRagSocProd()) : mtbAart.getRagSocProd() != null)
|
||||
return false;
|
||||
if (getFlagRapConvVariabile() != null ? !getFlagRapConvVariabile().equals(mtbAart.getFlagRapConvVariabile()) : mtbAart.getFlagRapConvVariabile() != null)
|
||||
return false;
|
||||
if (getFlagMovArtMag() != null ? !getFlagMovArtMag().equals(mtbAart.getFlagMovArtMag()) : mtbAart.getFlagMovArtMag() != null)
|
||||
return false;
|
||||
if (getFlagTracciabilita() != null ? !getFlagTracciabilita().equals(mtbAart.getFlagTracciabilita()) : mtbAart.getFlagTracciabilita() != null)
|
||||
return false;
|
||||
if (getTaraKg() != null ? !getTaraKg().equals(mtbAart.getTaraKg()) : mtbAart.getTaraKg() != null)
|
||||
return false;
|
||||
if (getColliStrato() != null ? !getColliStrato().equals(mtbAart.getColliStrato()) : mtbAart.getColliStrato() != null)
|
||||
return false;
|
||||
if (getFlagQtaCnfFissa() != null ? !getFlagQtaCnfFissa().equals(mtbAart.getFlagQtaCnfFissa()) : mtbAart.getFlagQtaCnfFissa() != null)
|
||||
return false;
|
||||
if (getFlagColliPedanaFisso() != null ? !getFlagColliPedanaFisso().equals(mtbAart.getFlagColliPedanaFisso()) : mtbAart.getFlagColliPedanaFisso() != null)
|
||||
return false;
|
||||
if (getCodCconCosti() != null ? !getCodCconCosti().equals(mtbAart.getCodCconCosti()) : mtbAart.getCodCconCosti() != null)
|
||||
return false;
|
||||
if (getCodCconRicavi() != null ? !getCodCconRicavi().equals(mtbAart.getCodCconRicavi()) : mtbAart.getCodCconRicavi() != null)
|
||||
return false;
|
||||
if (getCodDgrpArt() != null ? !getCodDgrpArt().equals(mtbAart.getCodDgrpArt()) : mtbAart.getCodDgrpArt() != null)
|
||||
return false;
|
||||
if (getCodDiviCar() != null ? !getCodDiviCar().equals(mtbAart.getCodDiviCar()) : mtbAart.getCodDiviCar() != null)
|
||||
return false;
|
||||
if (getCodDiviScar() != null ? !getCodDiviScar().equals(mtbAart.getCodDiviScar()) : mtbAart.getCodDiviScar() != null)
|
||||
return false;
|
||||
if (getCodEcrCat() != null ? !getCodEcrCat().equals(mtbAart.getCodEcrCat()) : mtbAart.getCodEcrCat() != null)
|
||||
return false;
|
||||
if (getCodEcrMcat() != null ? !getCodEcrMcat().equals(mtbAart.getCodEcrMcat()) : mtbAart.getCodEcrMcat() != null)
|
||||
return false;
|
||||
if (getCodEcrRep() != null ? !getCodEcrRep().equals(mtbAart.getCodEcrRep()) : mtbAart.getCodEcrRep() != null)
|
||||
return false;
|
||||
if (getCodEcrStipo() != null ? !getCodEcrStipo().equals(mtbAart.getCodEcrStipo()) : mtbAart.getCodEcrStipo() != null)
|
||||
return false;
|
||||
if (getCodEcrTipo() != null ? !getCodEcrTipo().equals(mtbAart.getCodEcrTipo()) : mtbAart.getCodEcrTipo() != null)
|
||||
return false;
|
||||
if (getCodGrpBolla() != null ? !getCodGrpBolla().equals(mtbAart.getCodGrpBolla()) : mtbAart.getCodGrpBolla() != null)
|
||||
return false;
|
||||
if (getIngredienti() != null ? !getIngredienti().equals(mtbAart.getIngredienti()) : mtbAart.getIngredienti() != null)
|
||||
return false;
|
||||
if (getIdArtEqui() != null ? !getIdArtEqui().equals(mtbAart.getIdArtEqui()) : mtbAart.getIdArtEqui() != null)
|
||||
return false;
|
||||
if (getDescrCassa() != null ? !getDescrCassa().equals(mtbAart.getDescrCassa()) : mtbAart.getDescrCassa() != null)
|
||||
return false;
|
||||
if (getCodNcIntracee() != null ? !getCodNcIntracee().equals(mtbAart.getCodNcIntracee()) : mtbAart.getCodNcIntracee() != null)
|
||||
return false;
|
||||
if (getMarchio() != null ? !getMarchio().equals(mtbAart.getMarchio()) : mtbAart.getMarchio() != null)
|
||||
return false;
|
||||
if (getSezione() != null ? !getSezione().equals(mtbAart.getSezione()) : mtbAart.getSezione() != null)
|
||||
return false;
|
||||
if (getUntMisRifPeso() != mtbAart.getUntMisRifPeso()) return false;
|
||||
if (getQtaEsistente() != null ? !getQtaEsistente().equals(mtbAart.getQtaEsistente()) : mtbAart.getQtaEsistente() != null)
|
||||
return false;
|
||||
if (getQtaImpegnata() != null ? !getQtaImpegnata().equals(mtbAart.getQtaImpegnata()) : mtbAart.getQtaImpegnata() != null)
|
||||
return false;
|
||||
if (getNumCnfEsistente() != null ? !getNumCnfEsistente().equals(mtbAart.getNumCnfEsistente()) : mtbAart.getNumCnfEsistente() != null)
|
||||
return false;
|
||||
if (getNumCnfImpegnata() != null ? !getNumCnfImpegnata().equals(mtbAart.getNumCnfImpegnata()) : mtbAart.getNumCnfImpegnata() != null)
|
||||
return false;
|
||||
return getMtbUntMis() != null ? getMtbUntMis().equals(mtbAart.getMtbUntMis()) : mtbAart.getMtbUntMis() == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = getCodMart().hashCode();
|
||||
result = 31 * result + (getDescrizione() != null ? getDescrizione().hashCode() : 0);
|
||||
result = 31 * result + (getUntMis() != null ? getUntMis().hashCode() : 0);
|
||||
result = 31 * result + (getBarCode() != null ? getBarCode().hashCode() : 0);
|
||||
result = 31 * result + (getPesoKg() != null ? getPesoKg().hashCode() : 0);
|
||||
result = 31 * result + (getQtaCnf() != null ? getQtaCnf().hashCode() : 0);
|
||||
result = 31 * result + (getCodAliq() != null ? getCodAliq().hashCode() : 0);
|
||||
result = 31 * result + (getCodScoArt() != null ? getCodScoArt().hashCode() : 0);
|
||||
result = 31 * result + (getCodTcolUi() != null ? getCodTcolUi().hashCode() : 0);
|
||||
result = 31 * result + (getCodTcolUl() != null ? getCodTcolUl().hashCode() : 0);
|
||||
result = 31 * result + (getArticoloComposto() != null ? getArticoloComposto().hashCode() : 0);
|
||||
result = 31 * result + (getEsposizioneComp() != null ? getEsposizioneComp().hashCode() : 0);
|
||||
result = 31 * result + (getDescrizioneEstesa() != null ? getDescrizioneEstesa().hashCode() : 0);
|
||||
result = 31 * result + (getCodUltForn() != null ? getCodUltForn().hashCode() : 0);
|
||||
result = 31 * result + (getDataUltCar() != null ? getDataUltCar().hashCode() : 0);
|
||||
result = 31 * result + (getValUltCar() != null ? getValUltCar().hashCode() : 0);
|
||||
result = 31 * result + (getCodUltClie() != null ? getCodUltClie().hashCode() : 0);
|
||||
result = 31 * result + (getDataUltScar() != null ? getDataUltScar().hashCode() : 0);
|
||||
result = 31 * result + (getValUltScar() != null ? getValUltScar().hashCode() : 0);
|
||||
result = 31 * result + (getTipoCodice() != null ? getTipoCodice().hashCode() : 0);
|
||||
result = 31 * result + (getNote() != null ? getNote().hashCode() : 0);
|
||||
result = 31 * result + (getPosizione() != null ? getPosizione().hashCode() : 0);
|
||||
result = 31 * result + (getColliPedana() != null ? getColliPedana().hashCode() : 0);
|
||||
result = 31 * result + (getUntMis2() != null ? getUntMis2().hashCode() : 0);
|
||||
result = 31 * result + (getRapConv2() != null ? getRapConv2().hashCode() : 0);
|
||||
result = 31 * result + (getFlagInclListino() != null ? getFlagInclListino().hashCode() : 0);
|
||||
result = 31 * result + (getUntMis3() != null ? getUntMis3().hashCode() : 0);
|
||||
result = 31 * result + (getRapConv3() != null ? getRapConv3().hashCode() : 0);
|
||||
result = 31 * result + (getCodMartStat() != null ? getCodMartStat().hashCode() : 0);
|
||||
result = 31 * result + (getCodMcon() != null ? getCodMcon().hashCode() : 0);
|
||||
result = 31 * result + (getCodMgrp() != null ? getCodMgrp().hashCode() : 0);
|
||||
result = 31 * result + (getCodMsfa() != null ? getCodMsfa().hashCode() : 0);
|
||||
result = 31 * result + (getCodMsgr() != null ? getCodMsgr().hashCode() : 0);
|
||||
result = 31 * result + (getCodMstp() != null ? getCodMstp().hashCode() : 0);
|
||||
result = 31 * result + (getCodMtip() != null ? getCodMtip().hashCode() : 0);
|
||||
result = 31 * result + (getDescrizioneStat() != null ? getDescrizioneStat().hashCode() : 0);
|
||||
result = 31 * result + (getFlagStato() != null ? getFlagStato().hashCode() : 0);
|
||||
result = 31 * result + (getCambioDiviCar() != null ? getCambioDiviCar().hashCode() : 0);
|
||||
result = 31 * result + (getCambioDiviScar() != null ? getCambioDiviScar().hashCode() : 0);
|
||||
result = 31 * result + (getGgScadPartita() != null ? getGgScadPartita().hashCode() : 0);
|
||||
result = 31 * result + (getVolumeMc() != null ? getVolumeMc().hashCode() : 0);
|
||||
result = 31 * result + (getFlagEsponiPrz() != null ? getFlagEsponiPrz().hashCode() : 0);
|
||||
result = 31 * result + (getDataUltVar() != null ? getDataUltVar().hashCode() : 0);
|
||||
result = 31 * result + (getPercSfrido() != null ? getPercSfrido().hashCode() : 0);
|
||||
result = 31 * result + (getCodBarreImb() != null ? getCodBarreImb().hashCode() : 0);
|
||||
result = 31 * result + (getFlagCalcPrz() != null ? getFlagCalcPrz().hashCode() : 0);
|
||||
result = 31 * result + (getEsposizioneCompAcq() != null ? getEsposizioneCompAcq().hashCode() : 0);
|
||||
result = 31 * result + (getFlagCalcPrzAcq() != null ? getFlagCalcPrzAcq().hashCode() : 0);
|
||||
result = 31 * result + (getDiacod() != null ? getDiacod().hashCode() : 0);
|
||||
result = 31 * result + (getPlu() != null ? getPlu().hashCode() : 0);
|
||||
result = 31 * result + (getPartIvaProd() != null ? getPartIvaProd().hashCode() : 0);
|
||||
result = 31 * result + (getRagSocProd() != null ? getRagSocProd().hashCode() : 0);
|
||||
result = 31 * result + (getFlagRapConvVariabile() != null ? getFlagRapConvVariabile().hashCode() : 0);
|
||||
result = 31 * result + (getFlagMovArtMag() != null ? getFlagMovArtMag().hashCode() : 0);
|
||||
result = 31 * result + (getFlagTracciabilita() != null ? getFlagTracciabilita().hashCode() : 0);
|
||||
result = 31 * result + (getTaraKg() != null ? getTaraKg().hashCode() : 0);
|
||||
result = 31 * result + (getColliStrato() != null ? getColliStrato().hashCode() : 0);
|
||||
result = 31 * result + (getFlagQtaCnfFissa() != null ? getFlagQtaCnfFissa().hashCode() : 0);
|
||||
result = 31 * result + (getFlagColliPedanaFisso() != null ? getFlagColliPedanaFisso().hashCode() : 0);
|
||||
result = 31 * result + (getCodCconCosti() != null ? getCodCconCosti().hashCode() : 0);
|
||||
result = 31 * result + (getCodCconRicavi() != null ? getCodCconRicavi().hashCode() : 0);
|
||||
result = 31 * result + (getCodDgrpArt() != null ? getCodDgrpArt().hashCode() : 0);
|
||||
result = 31 * result + (getCodDiviCar() != null ? getCodDiviCar().hashCode() : 0);
|
||||
result = 31 * result + (getCodDiviScar() != null ? getCodDiviScar().hashCode() : 0);
|
||||
result = 31 * result + (getCodEcrCat() != null ? getCodEcrCat().hashCode() : 0);
|
||||
result = 31 * result + (getCodEcrMcat() != null ? getCodEcrMcat().hashCode() : 0);
|
||||
result = 31 * result + (getCodEcrRep() != null ? getCodEcrRep().hashCode() : 0);
|
||||
result = 31 * result + (getCodEcrStipo() != null ? getCodEcrStipo().hashCode() : 0);
|
||||
result = 31 * result + (getCodEcrTipo() != null ? getCodEcrTipo().hashCode() : 0);
|
||||
result = 31 * result + (getCodGrpBolla() != null ? getCodGrpBolla().hashCode() : 0);
|
||||
result = 31 * result + (getIngredienti() != null ? getIngredienti().hashCode() : 0);
|
||||
result = 31 * result + (getIdArtEqui() != null ? getIdArtEqui().hashCode() : 0);
|
||||
result = 31 * result + (getDescrCassa() != null ? getDescrCassa().hashCode() : 0);
|
||||
result = 31 * result + (getCodNcIntracee() != null ? getCodNcIntracee().hashCode() : 0);
|
||||
result = 31 * result + (getMarchio() != null ? getMarchio().hashCode() : 0);
|
||||
result = 31 * result + (getSezione() != null ? getSezione().hashCode() : 0);
|
||||
result = 31 * result + (getUntMisRifPeso() != null ? getUntMisRifPeso().hashCode() : 0);
|
||||
result = 31 * result + (getQtaEsistente() != null ? getQtaEsistente().hashCode() : 0);
|
||||
result = 31 * result + (getQtaImpegnata() != null ? getQtaImpegnata().hashCode() : 0);
|
||||
result = 31 * result + (getNumCnfEsistente() != null ? getNumCnfEsistente().hashCode() : 0);
|
||||
result = 31 * result + (getNumCnfImpegnata() != null ? getNumCnfImpegnata().hashCode() : 0);
|
||||
result = 31 * result + (getMtbUntMis() != null ? getMtbUntMis().hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
public class MtbAartWithFornitore extends MtbAart {
|
||||
|
||||
private String codArtFor;
|
||||
|
||||
public String getCodArtFor() {
|
||||
return codArtFor;
|
||||
}
|
||||
|
||||
public MtbAartWithFornitore setCodArtFor(String codArtFor) {
|
||||
this.codArtFor = codArtFor;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -68,28 +68,6 @@ public class MtbColt extends EntityBase {
|
||||
private Boolean disablePrint;
|
||||
private String ragSocCliente;
|
||||
|
||||
public void generaFiltroOrdine() throws Exception {
|
||||
|
||||
if (this.gestione == null) {
|
||||
throw new Exception("Impossibile creare il filtro dell'ordine se la gestione non è valorizzata");
|
||||
}
|
||||
|
||||
if (this.dataOrd == null) {
|
||||
throw new Exception("Impossibile creare il filtro dell'ordine se la data dell'ordine non è valorizzata");
|
||||
}
|
||||
|
||||
if (this.numOrd == null) {
|
||||
throw new Exception("Impossibile creare il filtro dell'ordine se il numero dell'ordine non è valorizzato");
|
||||
}
|
||||
|
||||
|
||||
Date dateOrd = UtilityDate.recognizeDate(this.dataOrd);
|
||||
String dateYMD = UtilityDate.formatDate(dateOrd, UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH);
|
||||
|
||||
this.filtroOrdini = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ROOT><FILTER><DTB_ORDT><GESTIONE type=\"V\">" + this.gestione + "</GESTIONE><DATA_ORD type=\"D\">" + dateYMD + "</DATA_ORD><NUM_ORD type=\"N\">" + this.numOrd + "</NUM_ORD></DTB_ORDT></FILTER></ROOT>";
|
||||
}
|
||||
|
||||
|
||||
private ObservableArrayList<MtbColr> mtbColr = new ObservableArrayList<>();
|
||||
|
||||
public ObservableArrayList<MtbColr> getMtbColr() {
|
||||
@@ -119,30 +97,22 @@ public class MtbColt extends EntityBase {
|
||||
|
||||
String codAnagToUse = null;
|
||||
switch (gestioneEnum) {
|
||||
case ACQUISTO:
|
||||
case LAVORAZIONE:
|
||||
case PRODUZIONE:
|
||||
case ACQUISTO, LAVORAZIONE, PRODUZIONE -> {
|
||||
if (SettingsManager.iDB().getInternalCodAnags() == null) break;
|
||||
|
||||
Optional<InternalCodAnagsDTO> optCodAnagForn = Stream.of(SettingsManager.iDB().getInternalCodAnags())
|
||||
.filter(InternalCodAnagsDTO::isFornitore)
|
||||
.findFirst();
|
||||
|
||||
if (optCodAnagForn.isEmpty()) break;
|
||||
|
||||
codAnagToUse = optCodAnagForn.get().getCodAnag();
|
||||
break;
|
||||
case VENDITA:
|
||||
}
|
||||
case VENDITA -> {
|
||||
if (SettingsManager.iDB().getInternalCodAnags() == null) break;
|
||||
|
||||
Optional<InternalCodAnagsDTO> optCodAnagClie = Stream.of(SettingsManager.iDB().getInternalCodAnags())
|
||||
.filter(InternalCodAnagsDTO::isCliente)
|
||||
.findFirst();
|
||||
|
||||
if (optCodAnagClie.isEmpty()) break;
|
||||
|
||||
codAnagToUse = optCodAnagClie.get().getCodAnag();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
setCodAnag(codAnagToUse);
|
||||
|
||||
@@ -39,7 +39,6 @@ public class MvwSitArtUdcDetInventario {
|
||||
private String codJfas;
|
||||
private MtbAart mtbAart;
|
||||
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
@@ -283,7 +282,6 @@ public class MvwSitArtUdcDetInventario {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public MtbColr toMtbColr() {
|
||||
return new MtbColr()
|
||||
.setCodJcom(getCodJcom())
|
||||
|
||||
@@ -22,6 +22,7 @@ public class HttpInterceptor implements Interceptor {
|
||||
final String PROFILE_DB = SettingsManager.i().getUserSession() == null ? null : SettingsManager.i().getUserSession().getProfileDB();
|
||||
final String USERNAME = SettingsManager.i().getUser().getUsername();
|
||||
final String PASSWORD = SettingsManager.i().getUser().getPassword();
|
||||
final String DEVICE_ID = SettingsManager.i().getUserSession().getDeviceId();
|
||||
|
||||
final Request request = chain.request();
|
||||
final HttpUrl url = request.url().newBuilder()
|
||||
@@ -36,6 +37,7 @@ public class HttpInterceptor implements Interceptor {
|
||||
.addHeader("Accept", "*/*")
|
||||
.addHeader("username", USERNAME != null ? USERNAME : "")
|
||||
.addHeader("password", PASSWORD != null ? PASSWORD : "")
|
||||
.addHeader("device_id", DEVICE_ID != null ? DEVICE_ID : "")
|
||||
.url(url).build();
|
||||
|
||||
return chain.proceed(newRequest);
|
||||
|
||||
@@ -63,7 +63,7 @@ public class RESTBuilder {
|
||||
|
||||
OkHttpClient client = clientBuilder.build();
|
||||
|
||||
String endpoint = protocol + "://" + host + ":" + port + "/" + (addEmsApi ? "ems-api/" : "");
|
||||
String endpoint = protocol + "://" + host + (port > 0 ? ":" + port : "") + "/" + (addEmsApi ? "ems-api/" : "");
|
||||
|
||||
|
||||
Gson gson = new GsonBuilder()
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import com.annimon.stream.Collectors;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@@ -14,9 +14,11 @@ import javax.inject.Singleton;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||
import it.integry.integrywmsnative.core.model.MtbUntMis;
|
||||
import it.integry.integrywmsnative.core.model.dto.StatoArticoloDTO;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.RetrieveArticoloByCodMartRequestDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
@@ -57,24 +59,28 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public static void getByCodMartsStatic(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
String joinedCods = Stream.of(codMartToFind)
|
||||
.collect(Collectors.joining(","));
|
||||
var codMarts = Stream.of(codMartToFind)
|
||||
.withoutNulls()
|
||||
.distinct().toList();
|
||||
|
||||
|
||||
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
articoloRESTConsumer.getByCodMart(joinedCods).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||
analyzeAnswer(response, "getByCodMart", (m) -> {
|
||||
onComplete.run(response.body().getEntityList());
|
||||
}, onFailed);
|
||||
}
|
||||
articoloRESTConsumer
|
||||
.getByCodMart(new RetrieveArticoloByCodMartRequestDTO()
|
||||
.setCodMarts(codMarts))
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||
analyzeAnswer(response, "getByCodMart", (m) -> {
|
||||
onComplete.run(response.body().getEntityList());
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<MtbAart>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<MtbAart>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -99,22 +105,25 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
public void getByCodMart(String codMartToFind, RunnableArgs<MtbAart> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
articoloRESTConsumer.getByCodMart(codMartToFind).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||
analyzeAnswer(response, "getByCodMart", (m) -> {
|
||||
if (response.body().getEntityList() != null && !response.body().getEntityList().isEmpty()) {
|
||||
onComplete.run(response.body().getEntityList().get(0));
|
||||
} else onComplete.run(null);
|
||||
articoloRESTConsumer.getByCodMart(
|
||||
new RetrieveArticoloByCodMartRequestDTO()
|
||||
.setCodMarts(Collections.singletonList(codMartToFind)))
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||
analyzeAnswer(response, "getByCodMart", (m) -> {
|
||||
if (response.body().getEntityList() != null && !response.body().getEntityList().isEmpty()) {
|
||||
onComplete.run(response.body().getEntityList().get(0));
|
||||
} else onComplete.run(null);
|
||||
|
||||
}, onFailed);
|
||||
}
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<MtbAart>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<MtbAart>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -131,8 +140,55 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbGrup>>() {
|
||||
}.getType();
|
||||
this.systemRESTConsumer.processSql("SELECT * FROM mtb_grup " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
||||
|
||||
this.systemRESTConsumer.processSql("SELECT * FROM mtb_grup " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
||||
}
|
||||
|
||||
|
||||
public void getUntMisArts(List<String> inputUntMis, RunnableArgs<List<MtbUntMis>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
List<HashMap<String, Object>> whereCondList = Stream.of(inputUntMis)
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.map(x -> {
|
||||
HashMap<String, Object> data = new HashMap<>();
|
||||
data.put("unt_mis", x);
|
||||
return data;
|
||||
})
|
||||
.toList();
|
||||
|
||||
var whereCond = whereCondList.isEmpty() ? "" : " WHERE " + UtilityQuery.concatFieldListInWhereCond(whereCondList);
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbUntMis>>() {
|
||||
}.getType();
|
||||
this.systemRESTConsumer.processSql("SELECT * FROM mtb_unt_mis " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
||||
}
|
||||
|
||||
public void fillMtbAartsWithMtbUntMis(List<MtbAart> inputMtbAart, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
var inputUntMis = new ArrayList<String>();
|
||||
|
||||
if (inputMtbAart != null && !inputMtbAart.isEmpty()) {
|
||||
inputUntMis.addAll(Stream.of(inputMtbAart)
|
||||
.map(MtbAart::getUntMis)
|
||||
.withoutNulls()
|
||||
.distinct()
|
||||
.toList());
|
||||
}
|
||||
|
||||
if (inputUntMis.isEmpty()) {
|
||||
onComplete.run(inputMtbAart);
|
||||
return;
|
||||
}
|
||||
|
||||
getUntMisArts(inputUntMis, mtbUntMiss -> {
|
||||
for (var item : inputMtbAart) {
|
||||
var mtbUntMis = Stream.of(mtbUntMiss).filter(x -> x.getUntMis().equalsIgnoreCase(item.getUntMis()))
|
||||
.findFirstOrElse(null);
|
||||
|
||||
if (mtbUntMis != null)
|
||||
item.setMtbUntMis(Collections.singletonList(mtbUntMis));
|
||||
}
|
||||
|
||||
onComplete.run(inputMtbAart);
|
||||
}, onFailed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ import java.util.List;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.dto.StatoArticoloDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.articolo.RetrieveArticoloByCodMartRequestDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
@@ -16,8 +18,8 @@ public interface ArticoloRESTConsumerService {
|
||||
@POST("SM2getArticoloByBarcode")
|
||||
Call<ServiceRESTResponse<MtbAart>> getByBarcodeProd(@Query("barcode") String barcodeProd);
|
||||
|
||||
@GET("SM2getArticoloByCodMart")
|
||||
Call<ServiceRESTResponse<MtbAart>> getByCodMart(@Query("codMart") String barcodeProd);
|
||||
@POST("wms/articolo/retrieveByCodMart")
|
||||
Call<ServiceRESTResponse<MtbAart>> getByCodMart(@Body RetrieveArticoloByCodMartRequestDTO retrieveArticoloByCodMartRequest);
|
||||
|
||||
@GET("getProductLotStatus")
|
||||
Call<ServiceRESTResponse<List<StatoArticoloDTO>>> getStatoPartita(@Query("codMart") String codMart, @Query("partitaMag") String partitaMag);
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliCaricoRESTConsumerInterface;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CreateUDCRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CreateUDCResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.DeleteUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowResponseDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
@Singleton
|
||||
public class ColliAccettazioneRESTConsumer extends _BaseRESTConsumer implements ColliCaricoRESTConsumerInterface {
|
||||
|
||||
public void createUDC(CreateUDCRequestDTO createUDCRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
||||
|
||||
colliAccettazioneRESTConsumerService.createUDC(createUDCRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Response<ServiceRESTResponse<CreateUDCResponseDTO>> response) {
|
||||
analyzeAnswer(response, "accettazione/createUDC", data -> onComplete.run(data.getMtbColt()), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeUDC(CloseUDCRequestDTO closeUDCRequestDTO, RunnableArgs<CloseUDCResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
||||
|
||||
colliAccettazioneRESTConsumerService.closeUDC(closeUDCRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Response<ServiceRESTResponse<CloseUDCResponseDTO>> response) {
|
||||
analyzeAnswer(response, "accettazione/closeUDC", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertUDCRow(InsertUDCRowRequestDTO insertUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
||||
|
||||
colliAccettazioneRESTConsumerService.insertUDCRow(insertUDCRowRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDCRowResponseDTO>> response) {
|
||||
analyzeAnswer(response, "accettazione/insertUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editUDCRow(EditUDCRowRequestDTO editUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
||||
|
||||
colliAccettazioneRESTConsumerService.editUDCRow(editUDCRowRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDCRowResponseDTO>> response) {
|
||||
analyzeAnswer(response, "accettazione/editUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteUDCRow(DeleteUDCRowRequestDTO deleteUDCRowRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
||||
|
||||
colliAccettazioneRESTConsumerService.deleteUDCRow(deleteUDCRowRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswer(response, "accettazione/deleteUDCRow", data -> onComplete.run(), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CreateUDCRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CreateUDCResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.DeleteUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowResponseDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface ColliAccettazioneRESTConsumerService {
|
||||
|
||||
@POST("wms/accettazione/createUDC")
|
||||
Call<ServiceRESTResponse<CreateUDCResponseDTO>> createUDC(@Body CreateUDCRequestDTO createUDCRequestDTO);
|
||||
|
||||
@POST("wms/accettazione/closeUDC")
|
||||
Call<ServiceRESTResponse<CloseUDCResponseDTO>> closeUDC(@Body CloseUDCRequestDTO closeUDCRequestDTO);
|
||||
|
||||
@POST("wms/accettazione/insertUDCRow")
|
||||
Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> insertUDCRow(@Body InsertUDCRowRequestDTO insertUDCRowRequestDTO);
|
||||
|
||||
@POST("wms/accettazione/editUDCRow")
|
||||
Call<ServiceRESTResponse<EditUDCRowResponseDTO>> editUDCRow(@Body EditUDCRowRequestDTO editUDCRowRequestDTO);
|
||||
|
||||
@POST("wms/accettazione/deleteUDCRow")
|
||||
Call<ServiceRESTResponse<Void>> deleteUDCRow(@Body DeleteUDCRowRequestDTO deleteUDCRowRequestDTO);
|
||||
|
||||
}
|
||||
@@ -6,28 +6,107 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliCaricoRESTConsumerInterface;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliScaricoRESTConsumerInterface;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CanUDSBeDeletedRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CreateUDCRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CreateUDCResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.DeleteUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.PrintUDSRequestDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
@Singleton
|
||||
public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements ColliScaricoRESTConsumerInterface {
|
||||
public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements ColliCaricoRESTConsumerInterface, ColliScaricoRESTConsumerInterface {
|
||||
|
||||
|
||||
@Override
|
||||
public void createUDC(CreateUDCRequestDTO createUDCRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||
|
||||
colliLavorazioneRESTConsumerService.createUDC(createUDCRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Response<ServiceRESTResponse<CreateUDCResponseDTO>> response) {
|
||||
analyzeAnswer(response, "lavorazione/createUDC", data -> onComplete.run(data.getMtbColt()), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<CreateUDCResponseDTO>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeUDC(CloseUDCRequestDTO closeUDCRequestDTO, RunnableArgs<CloseUDCResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||
|
||||
colliLavorazioneRESTConsumerService.closeUDC(closeUDCRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Response<ServiceRESTResponse<CloseUDCResponseDTO>> response) {
|
||||
analyzeAnswer(response, "lavorazione/closeUDC", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<CloseUDCResponseDTO>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertUDCRow(InsertUDCRowRequestDTO insertUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||
|
||||
colliLavorazioneRESTConsumerService.insertUDCRow(insertUDCRowRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Response<ServiceRESTResponse<InsertUDCRowResponseDTO>> response) {
|
||||
analyzeAnswer(response, "lavorazione/insertUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editUDCRow(EditUDCRowRequestDTO editUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||
|
||||
colliLavorazioneRESTConsumerService.editUDCRow(editUDCRowRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Response<ServiceRESTResponse<EditUDCRowResponseDTO>> response) {
|
||||
analyzeAnswer(response, "lavorazione/editUDCRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<EditUDCRowResponseDTO>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void createUDS(CreateUDSRequestDTO createUDSRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||
|
||||
@@ -64,63 +143,6 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void canUDSBeDeleted(CanUDSBeDeletedRequestDTO canUDSBeDeletedRequestDTO, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||
|
||||
colliLavorazioneRESTConsumerService.canUDSBeDeleted(canUDSBeDeletedRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Boolean>> call, Response<ServiceRESTResponse<Boolean>> response) {
|
||||
analyzeAnswer(response, "lavorazione/canUDSBeDeleted", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteUDS(DeleteUDSRequestDTO deleteUDSRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||
|
||||
colliLavorazioneRESTConsumerService.deleteUDS(deleteUDSRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswer(response, "lavorazione/deleteUDS", Void -> onComplete.run(), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printUDS(PrintUDSRequestDTO printUDSRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||
|
||||
colliLavorazioneRESTConsumerService.printUDS(printUDSRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswer(response, "lavorazione/printUDS", Void -> onComplete.run(), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertUDSRow(InsertUDSRowRequestDTO insertUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||
@@ -174,4 +196,21 @@ public class ColliLavorazioneRESTConsumer extends _BaseRESTConsumer implements C
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteUDCRow(DeleteUDCRowRequestDTO deleteUDCRowRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class);
|
||||
|
||||
colliLavorazioneRESTConsumerService.deleteUDCRow(deleteUDCRowRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswer(response, "lavorazione/deleteUDCRow", data -> onComplete.run(), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,46 +1,58 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CanUDSBeDeletedRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CreateUDCRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CreateUDCResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.DeleteUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.PrintUDSRequestDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface ColliLavorazioneRESTConsumerService {
|
||||
|
||||
@POST("wms/lavorazione/createUDC")
|
||||
Call<ServiceRESTResponse<CreateUDCResponseDTO>> createUDC(@Body CreateUDCRequestDTO createUDCRequestDTO);
|
||||
|
||||
@POST("wms/lavorazione/createUDS")
|
||||
Call<ServiceRESTResponse<CreateUDSResponseDTO>> createUDS(@Body CreateUDSRequestDTO createUDSRequestDTO);
|
||||
|
||||
@POST("wms/lavorazione/closeUDC")
|
||||
Call<ServiceRESTResponse<CloseUDCResponseDTO>> closeUDC(@Body CloseUDCRequestDTO createUDCRequestDTO);
|
||||
|
||||
@POST("wms/lavorazione/closeUDS")
|
||||
Call<ServiceRESTResponse<CloseUDSResponseDTO>> closeUDS(@Body CloseUDSRequestDTO createUDSRequestDTO);
|
||||
|
||||
@POST("wms/lavorazione/canUDSBeDeleted")
|
||||
Call<ServiceRESTResponse<Boolean>> canUDSBeDeleted(@Body CanUDSBeDeletedRequestDTO canUDSBeDeletedRequestDTO);
|
||||
|
||||
@POST("wms/lavorazione/deleteUDS")
|
||||
Call<ServiceRESTResponse<Void>> deleteUDS(@Body DeleteUDSRequestDTO deleteUDSRequestDTO);
|
||||
|
||||
@POST("wms/lavorazione/printUDS")
|
||||
Call<ServiceRESTResponse<Void>> printUDS(@Body PrintUDSRequestDTO printUDSRequestDTO);
|
||||
@POST("wms/lavorazione/insertUDCRow")
|
||||
Call<ServiceRESTResponse<InsertUDCRowResponseDTO>> insertUDCRow(@Body InsertUDCRowRequestDTO insertUDCRowRequestDTO);
|
||||
|
||||
@POST("wms/lavorazione/insertUDSRow")
|
||||
Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> insertUDSRow(@Body InsertUDSRowRequestDTO insertUDSRowRequestDTO);
|
||||
|
||||
@POST("wms/lavorazione/editUDCRow")
|
||||
Call<ServiceRESTResponse<EditUDCRowResponseDTO>> editUDCRow(@Body EditUDCRowRequestDTO editUDCRowRequestDTO);
|
||||
|
||||
@POST("wms/lavorazione/editUDSRow")
|
||||
Call<ServiceRESTResponse<EditUDSRowResponseDTO>> editUDSRow(@Body EditUDSRowRequestDTO editUDSRowRequestDTO);
|
||||
|
||||
@POST("wms/lavorazione/deleteUDSRow")
|
||||
Call<ServiceRESTResponse<Void>> deleteUDSRow(@Body DeleteUDSRowRequestDTO deleteUDSRowRequestDTO);
|
||||
|
||||
@POST("wms/lavorazione/deleteUDCRow")
|
||||
Call<ServiceRESTResponse<Void>> deleteUDCRow(@Body DeleteUDCRowRequestDTO deleteUDCRowRequestDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CanULBeDeletedRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.PrintULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
@@ -58,7 +61,9 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public void saveCollo(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
MtbColt mtbColtToSaveClone = (MtbColt) mtbColtToSave.clone();
|
||||
mtbColtToSave.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
mtbColtToSaveClone.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
mtbColtToSaveClone.setOnlyPkMaster(false);
|
||||
|
||||
|
||||
mtbColtToSaveClone.setMtbColr(new ObservableArrayList<>());
|
||||
|
||||
@@ -269,14 +274,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
saveCollo(mtbColtToCreate, onComplete, onFailed);
|
||||
}
|
||||
|
||||
public void deleteCollo(MtbColt mtbColtToDelete, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
mtbColtToDelete.setOperation(CommonModelConsts.OPERATION.DELETE);
|
||||
|
||||
saveCollo(mtbColtToDelete, value -> {
|
||||
if (onComplete != null) onComplete.run();
|
||||
}, onFailed);
|
||||
}
|
||||
public void getBySSCC(String ssccString, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
colliMagazzinoRESTConsumerService.getColloByBarcode(ssccString, onlyResiduo, throwExcIfNull).enqueue(new Callback<>() {
|
||||
@@ -449,52 +446,6 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
}
|
||||
|
||||
public void canLUBeDeleted(MtbColt mtbColt, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
HashMap<String, Object> params = new HashMap<>();
|
||||
params.put("mtb_colt.gestione", mtbColt.getGestione());
|
||||
params.put("mtb_colt.ser_collo", mtbColt.getSerCollo());
|
||||
params.put("mtb_colt.num_collo", mtbColt.getNumCollo());
|
||||
params.put("mtb_colt.data_collo", mtbColt.getDataColloD());
|
||||
|
||||
String whereCond = UtilityQuery.concatFieldsInWhereCond(params);
|
||||
|
||||
|
||||
String query = "SELECT mtb_colt.* " +
|
||||
"FROM mtb_colt " +
|
||||
"LEFT OUTER JOIN " +
|
||||
" (SELECT gestione, " +
|
||||
" data_collo, " +
|
||||
" num_collo, " +
|
||||
" ser_collo, " +
|
||||
" cod_mart, " +
|
||||
" cod_col, " +
|
||||
" cod_tagl, " +
|
||||
" partita_mag, " +
|
||||
" SUM(qta_col) sum_qta_col " +
|
||||
" FROM mtb_colr " +
|
||||
" GROUP BY gestione, " +
|
||||
" data_collo, " +
|
||||
" num_collo, " +
|
||||
" ser_collo, " +
|
||||
" cod_mart, " +
|
||||
" cod_col, " +
|
||||
" cod_tagl, " +
|
||||
" partita_mag) sum_mtb_colr ON mtb_colt.gestione = sum_mtb_colr.gestione " +
|
||||
"AND mtb_colt.num_collo = sum_mtb_colr.num_collo " +
|
||||
"AND mtb_colt.data_collo = sum_mtb_colr.data_collo " +
|
||||
"AND mtb_colt.ser_collo = sum_mtb_colr.ser_collo " +
|
||||
"AND sum_mtb_colr.sum_qta_col > 0 " +
|
||||
"WHERE sum_mtb_colr.num_collo IS NULL " +
|
||||
" AND " + whereCond;
|
||||
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {
|
||||
}.getType();
|
||||
this.mSystemRESTConsumer.<ArrayList<MtbColt>>processSql(query, typeOfObjectsList, data -> {
|
||||
onComplete.run(data != null && data.size() > 0);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
public static void retrieveBasketColli(RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
@@ -698,4 +649,66 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
onComplete.run(data.get(0));
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void canULBeDeleted(MtbColt mtbColt, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
CanULBeDeletedRequestDTO canULBeDeletedRequestDTO = new CanULBeDeletedRequestDTO()
|
||||
.setMtbColt(mtbColt);
|
||||
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
|
||||
colliMagazzinoRESTConsumerService.canULBeDeleted(canULBeDeletedRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Boolean>> call, Response<ServiceRESTResponse<Boolean>> response) {
|
||||
analyzeAnswer(response, "generic/canULBeDeleted", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void deleteUL(DeleteULRequestDTO deleteULRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
|
||||
colliMagazzinoRESTConsumerService.deleteUL(deleteULRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswer(response, "generic/deleteUL", Void -> onComplete.run(), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void printUL(PrintULRequestDTO printULRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||
|
||||
colliMagazzinoRESTConsumerService.printUL(printULRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswer(response, "generic/printUL", Void -> onComplete.run(), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CanULBeDeletedRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.PrintULRequestDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
@@ -43,4 +46,14 @@ public interface ColliMagazzinoRESTConsumerService {
|
||||
@POST("wms/confirmGiacenzaUL")
|
||||
Call<ServiceRESTResponse<Object>> confirmGiacenzaUL(@Body MtbColt mtbColt);
|
||||
|
||||
|
||||
@POST("wms/generic/canULBeDeleted")
|
||||
Call<ServiceRESTResponse<Boolean>> canULBeDeleted(@Body CanULBeDeletedRequestDTO canULBeDeletedRequestDTO);
|
||||
|
||||
@POST("wms/generic/deleteUL")
|
||||
Call<ServiceRESTResponse<Void>> deleteUL(@Body DeleteULRequestDTO deleteULRequestDTO);
|
||||
|
||||
@POST("wms/generic/printUL")
|
||||
Call<ServiceRESTResponse<Void>> printUL(@Body PrintULRequestDTO printULRequestDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -8,18 +8,15 @@ import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliScaricoRESTConsumerInterface;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CanUDSBeDeletedRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.PrintUDSRequestDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
@@ -64,60 +61,6 @@ public class ColliSpedizioneRESTConsumer extends _BaseRESTConsumer implements Co
|
||||
|
||||
}
|
||||
|
||||
public void canUDSBeDeleted(CanUDSBeDeletedRequestDTO canUDSBeDeletedRequestDTO, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
||||
|
||||
colliSpedizioneRESTConsumerService.canUDSBeDeleted(canUDSBeDeletedRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Boolean>> call, Response<ServiceRESTResponse<Boolean>> response) {
|
||||
analyzeAnswer(response, "spedizione/canUDSBeDeleted", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void deleteUDS(DeleteUDSRequestDTO deleteUDSRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
||||
|
||||
colliSpedizioneRESTConsumerService.deleteUDS(deleteUDSRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswer(response, "spedizione/deleteUDS", Void -> onComplete.run(), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void printUDS(PrintUDSRequestDTO printUDSRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
||||
|
||||
colliSpedizioneRESTConsumerService.printUDS(printUDSRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswer(response, "spedizione/printUDS", Void -> onComplete.run(), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void insertUDSRow(InsertUDSRowRequestDTO insertUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
||||
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CanUDSBeDeletedRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.PrintUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.PrintULRequestDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.POST;
|
||||
@@ -25,14 +23,8 @@ public interface ColliSpedizioneRESTConsumerService {
|
||||
@POST("wms/spedizione/closeUDS")
|
||||
Call<ServiceRESTResponse<CloseUDSResponseDTO>> closeUDS(@Body CloseUDSRequestDTO createUDSRequestDTO);
|
||||
|
||||
@POST("wms/spedizione/canUDSBeDeleted")
|
||||
Call<ServiceRESTResponse<Boolean>> canUDSBeDeleted(@Body CanUDSBeDeletedRequestDTO canUDSBeDeletedRequestDTO);
|
||||
|
||||
@POST("wms/spedizione/deleteUDS")
|
||||
Call<ServiceRESTResponse<Void>> deleteUDS(@Body DeleteUDSRequestDTO deleteUDSRequestDTO);
|
||||
|
||||
@POST("wms/spedizione/printUDS")
|
||||
Call<ServiceRESTResponse<Void>> printUDS(@Body PrintUDSRequestDTO printUDSRequestDTO);
|
||||
Call<ServiceRESTResponse<Void>> printUDS(@Body PrintULRequestDTO printULRequestDTO);
|
||||
|
||||
@POST("wms/spedizione/insertUDSRow")
|
||||
Call<ServiceRESTResponse<InsertUDSRowResponseDTO>> insertUDSRow(@Body InsertUDSRowRequestDTO insertUDSRowRequestDTO);
|
||||
|
||||
@@ -53,9 +53,9 @@ public class DocumentRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
|
||||
public void loadDocumentoAvailableArts(String codDtip, String codMgrp, RunnableArgs<RetrieveDocumentoArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public void loadDocumentAvailableArts(String codDtip, String codMgrp, String codAnagForn, RunnableArgs<RetrieveDocumentoArtsResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
var inventarioRESTConsumerService = RESTBuilder.getService(DocumentiRESTConsumerService.class);
|
||||
inventarioRESTConsumerService.retrieveArts(codDtip, codMgrp)
|
||||
inventarioRESTConsumerService.retrieveArts(codDtip, codMgrp, codAnagForn)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> call, @NonNull Response<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> response) {
|
||||
|
||||
@@ -26,6 +26,7 @@ public interface DocumentiRESTConsumerService {
|
||||
@GET("wms/documento/arts")
|
||||
Call<ServiceRESTResponse<RetrieveDocumentoArtsResponseDTO>> retrieveArts(
|
||||
@Query("codDtip") String codDtip,
|
||||
@Query("codMgrp") String codMgrp);
|
||||
@Query("codMgrp") String codMgrp,
|
||||
@Query("codAnagForn") String codAnagForn);
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
@@ -13,6 +14,7 @@ import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
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 retrofit2.Call;
|
||||
@@ -120,7 +122,10 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<InstantItemSituationResponseDto>> call, Response<ServiceRESTResponse<InstantItemSituationResponseDto>> response) {
|
||||
analyzeAnswer(response, "getInstantItemSituation", onComplete, onFailed);
|
||||
analyzeAnswer(response, "getInstantItemSituation", data -> {
|
||||
|
||||
fillInstantItemSituationWithMtbAarts(data, onComplete, onFailed);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -130,5 +135,54 @@ public class GiacenzaRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
private void fillInstantItemSituationWithMtbAarts(InstantItemSituationResponseDto data, RunnableArgs<InstantItemSituationResponseDto> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
var inputCodMarts = new ArrayList<String>();
|
||||
|
||||
if (data.getIncomingItems() != null && !data.getIncomingItems().isEmpty()) {
|
||||
inputCodMarts.addAll(Stream.of(data.getIncomingItems())
|
||||
.map(InstantItemSituationIncomingItemDto::getCodMart)
|
||||
.toList());
|
||||
}
|
||||
|
||||
if (data.getAvailableItems() != null && !data.getAvailableItems().isEmpty()) {
|
||||
inputCodMarts.addAll(Stream.of(data.getAvailableItems())
|
||||
.map(MvwSitArtUdcDetInventario::getCodMart)
|
||||
.toList());
|
||||
}
|
||||
|
||||
if (inputCodMarts.isEmpty()) {
|
||||
onComplete.run(data);
|
||||
return;
|
||||
}
|
||||
|
||||
mArticoloRESTConsumer.getByCodMarts(inputCodMarts, mtbAarts -> {
|
||||
|
||||
mArticoloRESTConsumer.fillMtbAartsWithMtbUntMis(mtbAarts, newMtbAarts -> {
|
||||
if (data.getIncomingItems() != null && !data.getIncomingItems().isEmpty()) {
|
||||
for (var item : data.getIncomingItems()) {
|
||||
var mtbAart = Stream.of(newMtbAarts).filter(x -> x.getCodMart().equalsIgnoreCase(item.getCodMart()))
|
||||
.findFirstOrElse(null);
|
||||
|
||||
if (mtbAart != null)
|
||||
item.setMtbAart(mtbAart);
|
||||
}
|
||||
}
|
||||
|
||||
if (data.getAvailableItems() != null && !data.getAvailableItems().isEmpty()) {
|
||||
for (var item : data.getAvailableItems()) {
|
||||
var mtbAart = Stream.of(newMtbAarts).filter(x -> x.getCodMart().equalsIgnoreCase(item.getCodMart()))
|
||||
.findFirstOrElse(null);
|
||||
|
||||
if (mtbAart != null)
|
||||
item.setMtbAart(mtbAart);
|
||||
}
|
||||
}
|
||||
|
||||
onComplete.run(data);
|
||||
}, onFailed);
|
||||
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class InventarioRESTConsumer extends _BaseRESTConsumer {
|
||||
var request = new InsertInventarioRequestDTO()
|
||||
.setMtbInvent(inventarioToInsert);
|
||||
|
||||
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class, 120);
|
||||
var inventarioRESTConsumerService = RESTBuilder.getService(InventarioRESTConsumerService.class, 300);
|
||||
inventarioRESTConsumerService
|
||||
.insert(inventarioToInsert.getIdInventario(), request)
|
||||
.enqueue(new Callback<>() {
|
||||
|
||||
@@ -61,7 +61,10 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
||||
.filter(x -> !UtilityString.isNullOrEmpty(x.getPartitaMag()))
|
||||
.forEach(x -> {
|
||||
|
||||
if (!Stream.of(batchLotsToSearch).anyMatch(batchLotToSearch -> batchLotToSearch.getCodMart().equalsIgnoreCase(x.getCodMart()) && batchLotToSearch.getPartitaMag().equalsIgnoreCase(x.getPartitaMag()))) {
|
||||
if (!Stream.of(batchLotsToSearch)
|
||||
.anyMatch(batchLotToSearch ->
|
||||
batchLotToSearch.getCodMart().equalsIgnoreCase(x.getCodMart()) &&
|
||||
batchLotToSearch.getPartitaMag().equalsIgnoreCase(x.getPartitaMag()))) {
|
||||
MtbPartitaMag mtbPartitaMag = new MtbPartitaMag()
|
||||
.setCodMart(x.getCodMart())
|
||||
.setPartitaMag(x.getPartitaMag());
|
||||
|
||||
@@ -29,6 +29,7 @@ import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.system.RegisterDeviceRequestDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
@@ -39,6 +40,27 @@ import retrofit2.Response;
|
||||
@Singleton
|
||||
public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
|
||||
public void registerDevice(final Runnable onSuccess, final RunnableArgs<Exception> onFailed) {
|
||||
RegisterDeviceRequestDTO registerDeviceRequestDTO = new RegisterDeviceRequestDTO()
|
||||
.setApp("WMS");
|
||||
|
||||
SystemRESTConsumerService systemRESTConsumerService = RESTBuilder.getService(SystemRESTConsumerService.class);
|
||||
systemRESTConsumerService.registerDevice(registerDeviceRequestDTO)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswer(response, "device/register", Void -> onSuccess.run(), onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public <T> void processSql(String nativeSql, final Type clazz, final RunnableArgs<T> onComplete, final RunnableArgs<Exception> onFailed) {
|
||||
NativeSqlRequestDTO nativeSqlDTO = new NativeSqlRequestDTO();
|
||||
nativeSqlDTO.nativeSql = nativeSql;
|
||||
|
||||
@@ -6,6 +6,7 @@ import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.rest.model.system.RegisterDeviceRequestDTO;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
@@ -14,6 +15,9 @@ import retrofit2.http.Query;
|
||||
|
||||
public interface SystemRESTConsumerService {
|
||||
|
||||
@POST("device/register")
|
||||
Call<ServiceRESTResponse<Void>> registerDevice(@Body RegisterDeviceRequestDTO registerDeviceRequestDTO);
|
||||
|
||||
@POST("processSql")
|
||||
Call<ServiceRESTResponse<Object>> processSql(@Body NativeSqlRequestDTO nativeSqlDTO);
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers.interfaces;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CloseUDCResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CreateUDCRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.DeleteUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowRequestDTO;
|
||||
|
||||
public interface ColliCaricoRESTConsumerInterface {
|
||||
|
||||
void createUDC(CreateUDCRequestDTO createUDCRequestDTO, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed);
|
||||
|
||||
void closeUDC(CloseUDCRequestDTO closeUDCRequestDTO, RunnableArgs<CloseUDCResponseDTO> onComplete, RunnableArgs<Exception> onFailed);
|
||||
|
||||
void insertUDCRow(InsertUDCRowRequestDTO insertUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed);
|
||||
|
||||
void editUDCRow(EditUDCRowRequestDTO editUDCRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed);
|
||||
|
||||
void deleteUDCRow(DeleteUDCRowRequestDTO deleteUDCRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed);
|
||||
}
|
||||
@@ -3,15 +3,12 @@ package it.integry.integrywmsnative.core.rest.consumers.interfaces;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CanUDSBeDeletedRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.PrintUDSRequestDTO;
|
||||
|
||||
public interface ColliScaricoRESTConsumerInterface {
|
||||
|
||||
@@ -19,12 +16,6 @@ public interface ColliScaricoRESTConsumerInterface {
|
||||
|
||||
void closeUDS(CloseUDSRequestDTO closeUDSRequestDTO, RunnableArgs<CloseUDSResponseDTO> onComplete, RunnableArgs<Exception> onFailed);
|
||||
|
||||
void canUDSBeDeleted(CanUDSBeDeletedRequestDTO canUDSBeDeletedRequestDTO, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed);
|
||||
|
||||
void deleteUDS(DeleteUDSRequestDTO deleteUDSRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed);
|
||||
|
||||
void printUDS(PrintUDSRequestDTO printUDSRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed);
|
||||
|
||||
void insertUDSRow(InsertUDSRowRequestDTO insertUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed);
|
||||
|
||||
void editUDSRow(EditUDSRowRequestDTO editUDSRowRequestDTO, RunnableArgs<MtbColr> onComplete, RunnableArgs<Exception> onFailed);
|
||||
|
||||
@@ -313,7 +313,7 @@ public class Ean128Model {
|
||||
public String InternalPart;
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal1;
|
||||
public String Internal1; //USED FOR COD_MART
|
||||
|
||||
///<summary>Informazioni interne</summary>
|
||||
public String Internal2;
|
||||
|
||||
@@ -28,6 +28,7 @@ public class SitArtOrdDTO {
|
||||
private String descrizioneMsfa;
|
||||
private String untord;
|
||||
private BigDecimal qtaOmg;
|
||||
private BigDecimal qtaArrivo;
|
||||
|
||||
private final HashMap<String, Object> extraInfo = new HashMap<>();
|
||||
|
||||
@@ -232,4 +233,13 @@ public class SitArtOrdDTO {
|
||||
this.qtaOmg = qtaOmg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaArrivo() {
|
||||
return qtaArrivo;
|
||||
}
|
||||
|
||||
public SitArtOrdDTO setQtaArrivo(BigDecimal qtaArrivo) {
|
||||
this.qtaArrivo = qtaArrivo;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.articolo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RetrieveArticoloByCodMartRequestDTO {
|
||||
|
||||
private List<String> codMarts;
|
||||
|
||||
public List<String> getCodMarts() {
|
||||
return codMarts;
|
||||
}
|
||||
|
||||
public RetrieveArticoloByCodMartRequestDTO setCodMarts(List<String> codMarts) {
|
||||
this.codMarts = codMarts;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package it.integry.integrywmsnative.core.rest.model.giacenza;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
|
||||
public class InstantItemSituationIncomingItemDto {
|
||||
|
||||
private BigDecimal qtaOrd;
|
||||
@@ -21,6 +23,7 @@ public class InstantItemSituationIncomingItemDto {
|
||||
private String codJcom;
|
||||
private String codMdep;
|
||||
private String untMis;
|
||||
private MtbAart mtbAart;
|
||||
|
||||
public BigDecimal getQtaOrd() {
|
||||
return qtaOrd;
|
||||
@@ -85,4 +88,13 @@ public class InstantItemSituationIncomingItemDto {
|
||||
public String getUntMis() {
|
||||
return untMis;
|
||||
}
|
||||
|
||||
public MtbAart getMtbAart() {
|
||||
return mtbAart;
|
||||
}
|
||||
|
||||
public InstantItemSituationIncomingItemDto setMtbAart(MtbAart mtbAart) {
|
||||
this.mtbAart = mtbAart;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.system;
|
||||
|
||||
public class RegisterDeviceRequestDTO {
|
||||
|
||||
private String app;
|
||||
|
||||
public String getApp() {
|
||||
return app;
|
||||
}
|
||||
|
||||
public RegisterDeviceRequestDTO setApp(String app) {
|
||||
this.app = app;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.udc;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
|
||||
public class CloseUDCRequestDTO {
|
||||
|
||||
private MtbColt mtbColt;
|
||||
|
||||
|
||||
public MtbColt getMtbColt() {
|
||||
return mtbColt;
|
||||
}
|
||||
|
||||
public CloseUDCRequestDTO setMtbColt(MtbColt mtbColt) {
|
||||
this.mtbColt = mtbColt;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.udc;
|
||||
|
||||
public class CloseUDCResponseDTO {
|
||||
|
||||
private boolean saved;
|
||||
private boolean deleted;
|
||||
|
||||
public boolean isSaved() {
|
||||
return saved;
|
||||
}
|
||||
|
||||
public CloseUDCResponseDTO setSaved(boolean saved) {
|
||||
this.saved = saved;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isDeleted() {
|
||||
return deleted;
|
||||
}
|
||||
|
||||
public CloseUDCResponseDTO setDeleted(boolean deleted) {
|
||||
this.deleted = deleted;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.udc;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CreateUDCRequestDTO {
|
||||
|
||||
private String codMdep;
|
||||
private Integer numCollo;
|
||||
private String serCollo;
|
||||
private String codTcol;
|
||||
|
||||
private String annotazioni;
|
||||
|
||||
private List<CreateUDCRequestOrderDTO> orders;
|
||||
|
||||
|
||||
public String getCodMdep() {
|
||||
return codMdep;
|
||||
}
|
||||
|
||||
public CreateUDCRequestDTO setCodMdep(String codMdep) {
|
||||
this.codMdep = codMdep;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumCollo() {
|
||||
return numCollo;
|
||||
}
|
||||
|
||||
public CreateUDCRequestDTO setNumCollo(Integer numCollo) {
|
||||
this.numCollo = numCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSerCollo() {
|
||||
return serCollo;
|
||||
}
|
||||
|
||||
public CreateUDCRequestDTO setSerCollo(String serCollo) {
|
||||
this.serCollo = serCollo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodTcol() {
|
||||
return codTcol;
|
||||
}
|
||||
|
||||
public CreateUDCRequestDTO setCodTcol(String codTcol) {
|
||||
this.codTcol = codTcol;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAnnotazioni() {
|
||||
return annotazioni;
|
||||
}
|
||||
|
||||
public CreateUDCRequestDTO setAnnotazioni(String annotazioni) {
|
||||
this.annotazioni = annotazioni;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<CreateUDCRequestOrderDTO> getOrders() {
|
||||
return orders;
|
||||
}
|
||||
|
||||
public CreateUDCRequestDTO setOrders(List<CreateUDCRequestOrderDTO> orders) {
|
||||
this.orders = orders;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.udc;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
public class CreateUDCRequestOrderDTO {
|
||||
|
||||
|
||||
private String gestione;
|
||||
private LocalDate dataOrd;
|
||||
private LocalDate dataCons;
|
||||
private int numOrd;
|
||||
|
||||
|
||||
public String getGestione() {
|
||||
return gestione;
|
||||
}
|
||||
|
||||
public CreateUDCRequestOrderDTO setGestione(String gestione) {
|
||||
this.gestione = gestione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDate getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public CreateUDCRequestOrderDTO setDataOrd(LocalDate dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDate getDataCons() {
|
||||
return dataCons;
|
||||
}
|
||||
|
||||
public CreateUDCRequestOrderDTO setDataCons(LocalDate dataCons) {
|
||||
this.dataCons = dataCons;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getNumOrd() {
|
||||
return numOrd;
|
||||
}
|
||||
|
||||
public CreateUDCRequestOrderDTO setNumOrd(int numOrd) {
|
||||
this.numOrd = numOrd;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.udc;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
|
||||
public class CreateUDCResponseDTO {
|
||||
|
||||
private MtbColt mtbColt;
|
||||
|
||||
public MtbColt getMtbColt() {
|
||||
return mtbColt;
|
||||
}
|
||||
|
||||
public CreateUDCResponseDTO setMtbColt(MtbColt mtbColt) {
|
||||
this.mtbColt = mtbColt;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.udc;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
|
||||
public class DeleteUDCRowRequestDTO {
|
||||
|
||||
private MtbColr mtbColrToDelete;
|
||||
|
||||
public MtbColr getMtbColrToDelete() {
|
||||
return mtbColrToDelete;
|
||||
}
|
||||
|
||||
public DeleteUDCRowRequestDTO setMtbColrToDelete(MtbColr mtbColrToDelete) {
|
||||
this.mtbColrToDelete = mtbColrToDelete;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.udc;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
|
||||
public class EditUDCRowRequestDTO {
|
||||
private MtbColr sourceMtbColr;
|
||||
|
||||
private BigDecimal newQtaTot;
|
||||
private BigDecimal newQtaCnf;
|
||||
private BigDecimal newNumCnf;
|
||||
private String newPartitaMag;
|
||||
private LocalDate newDataScad;
|
||||
|
||||
public MtbColr getSourceMtbColr() {
|
||||
return sourceMtbColr;
|
||||
}
|
||||
|
||||
public EditUDCRowRequestDTO setSourceMtbColr(MtbColr sourceMtbColr) {
|
||||
this.sourceMtbColr = sourceMtbColr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNewQtaTot() {
|
||||
return newQtaTot;
|
||||
}
|
||||
|
||||
public EditUDCRowRequestDTO setNewQtaTot(BigDecimal newQtaTot) {
|
||||
this.newQtaTot = newQtaTot;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNewQtaCnf() {
|
||||
return newQtaCnf;
|
||||
}
|
||||
|
||||
public EditUDCRowRequestDTO setNewQtaCnf(BigDecimal newQtaCnf) {
|
||||
this.newQtaCnf = newQtaCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNewNumCnf() {
|
||||
return newNumCnf;
|
||||
}
|
||||
|
||||
public EditUDCRowRequestDTO setNewNumCnf(BigDecimal newNumCnf) {
|
||||
this.newNumCnf = newNumCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNewPartitaMag() {
|
||||
return newPartitaMag;
|
||||
}
|
||||
|
||||
public EditUDCRowRequestDTO setNewPartitaMag(String newPartitaMag) {
|
||||
this.newPartitaMag = newPartitaMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDate getNewDataScad() {
|
||||
return newDataScad;
|
||||
}
|
||||
|
||||
public EditUDCRowRequestDTO setNewDataScad(LocalDate newDataScad) {
|
||||
this.newDataScad = newDataScad;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.udc;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
|
||||
public class EditUDCRowResponseDTO {
|
||||
private MtbColr savedMtbColr;
|
||||
|
||||
public MtbColr getSavedMtbColr() {
|
||||
return savedMtbColr;
|
||||
}
|
||||
|
||||
public EditUDCRowResponseDTO setSavedMtbColr(MtbColr savedMtbColr) {
|
||||
this.savedMtbColr = savedMtbColr;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package it.integry.integrywmsnative.core.rest.model.uds;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
|
||||
public class CanUDSBeDeletedRequestDTO {
|
||||
public class CanULBeDeletedRequestDTO {
|
||||
|
||||
|
||||
private MtbColt mtbColt;
|
||||
@@ -11,7 +11,7 @@ public class CanUDSBeDeletedRequestDTO {
|
||||
return mtbColt;
|
||||
}
|
||||
|
||||
public CanUDSBeDeletedRequestDTO setMtbColt(MtbColt mtbColt) {
|
||||
public CanULBeDeletedRequestDTO setMtbColt(MtbColt mtbColt) {
|
||||
this.mtbColt = mtbColt;
|
||||
return this;
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package it.integry.integrywmsnative.core.rest.model.uds;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
|
||||
public class DeleteUDSRequestDTO {
|
||||
public class DeleteULRequestDTO {
|
||||
|
||||
private MtbColt mtbColt;
|
||||
|
||||
@@ -10,7 +10,7 @@ public class DeleteUDSRequestDTO {
|
||||
return mtbColt;
|
||||
}
|
||||
|
||||
public DeleteUDSRequestDTO setMtbColt(MtbColt mtbColt) {
|
||||
public DeleteULRequestDTO setMtbColt(MtbColt mtbColt) {
|
||||
this.mtbColt = mtbColt;
|
||||
return this;
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.uds;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
|
||||
public class InsertUDCRowRequestDTO {
|
||||
private MtbColt targetMtbColt;
|
||||
|
||||
private String codMart;
|
||||
private BigDecimal qtaTot;
|
||||
private BigDecimal qtaCnf;
|
||||
private BigDecimal numCnf;
|
||||
private String partitaMag;
|
||||
private LocalDate dataScad;
|
||||
private String codJcom;
|
||||
private String gestioneRif;
|
||||
|
||||
private LocalDate dataOrd;
|
||||
private Integer numOrd;
|
||||
private Integer rigaOrd;
|
||||
|
||||
|
||||
public MtbColt getTargetMtbColt() {
|
||||
return targetMtbColt;
|
||||
}
|
||||
|
||||
public InsertUDCRowRequestDTO setTargetMtbColt(MtbColt targetMtbColt) {
|
||||
this.targetMtbColt = targetMtbColt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public InsertUDCRowRequestDTO setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaTot() {
|
||||
return qtaTot;
|
||||
}
|
||||
|
||||
public InsertUDCRowRequestDTO setQtaTot(BigDecimal qtaTot) {
|
||||
this.qtaTot = qtaTot;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaCnf() {
|
||||
return qtaCnf;
|
||||
}
|
||||
|
||||
public InsertUDCRowRequestDTO setQtaCnf(BigDecimal qtaCnf) {
|
||||
this.qtaCnf = qtaCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getNumCnf() {
|
||||
return numCnf;
|
||||
}
|
||||
|
||||
public InsertUDCRowRequestDTO setNumCnf(BigDecimal numCnf) {
|
||||
this.numCnf = numCnf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public InsertUDCRowRequestDTO setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDate getDataScad() {
|
||||
return dataScad;
|
||||
}
|
||||
|
||||
public InsertUDCRowRequestDTO setDataScad(LocalDate dataScad) {
|
||||
this.dataScad = dataScad;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJcom() {
|
||||
return codJcom;
|
||||
}
|
||||
|
||||
public InsertUDCRowRequestDTO setCodJcom(String codJcom) {
|
||||
this.codJcom = codJcom;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGestioneRif() {
|
||||
return gestioneRif;
|
||||
}
|
||||
|
||||
public InsertUDCRowRequestDTO setGestioneRif(String gestioneRif) {
|
||||
this.gestioneRif = gestioneRif;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LocalDate getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public InsertUDCRowRequestDTO setDataOrd(LocalDate dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getNumOrd() {
|
||||
return numOrd;
|
||||
}
|
||||
|
||||
public InsertUDCRowRequestDTO setNumOrd(Integer numOrd) {
|
||||
this.numOrd = numOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Integer getRigaOrd() {
|
||||
return rigaOrd;
|
||||
}
|
||||
|
||||
public InsertUDCRowRequestDTO setRigaOrd(Integer rigaOrd) {
|
||||
this.rigaOrd = rigaOrd;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.uds;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
|
||||
public class InsertUDCRowResponseDTO {
|
||||
|
||||
private MtbColr savedMtbColr;
|
||||
|
||||
public MtbColr getSavedMtbColr() {
|
||||
return savedMtbColr;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
package it.integry.integrywmsnative.core.rest.model.uds;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
|
||||
public class PrintUDSRequestDTO {
|
||||
public class PrintULRequestDTO {
|
||||
|
||||
private List<MtbColt> mtbColts;
|
||||
|
||||
@@ -12,8 +13,14 @@ public class PrintUDSRequestDTO {
|
||||
return mtbColts;
|
||||
}
|
||||
|
||||
public PrintUDSRequestDTO setMtbColts(List<MtbColt> mtbColts) {
|
||||
public PrintULRequestDTO setMtbColts(List<MtbColt> mtbColts) {
|
||||
this.mtbColts = mtbColts;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PrintULRequestDTO setMtbColt(MtbColt mtbColt) {
|
||||
this.mtbColts = new ArrayList<>(1);
|
||||
this.mtbColts.add(mtbColt);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -38,10 +38,13 @@ public class DBSettingsModel {
|
||||
private boolean flagSpedizioneUseQtaOrd;
|
||||
private boolean flagOrdinaNuoviArticoliInGriglia;
|
||||
private boolean flagOrdinaArticoliOnScan;
|
||||
private boolean flagConsentiFuoriPianoLogistico;
|
||||
private boolean flagConsentiOrdineSenzaGriglia;
|
||||
private String docInterniCheckFornitore;
|
||||
private String produzioneDefaultCodAnag;
|
||||
private boolean flagPrintPackingListOnOrderClose;
|
||||
private boolean flagPrintEtichetteOnOrderClose;
|
||||
private boolean flagPrintEtichetteOnLUClose;
|
||||
private int onNumCnfInputChanged = 1;
|
||||
private int onQtaTotInputChanged = 1;
|
||||
private boolean flagAccettazioneUseQtaOrd = false;
|
||||
@@ -55,6 +58,10 @@ public class DBSettingsModel {
|
||||
private boolean showCodFornSpedizione = true;
|
||||
private boolean flagCanCreateInventario = true;
|
||||
private boolean flagCanAddUnknownItemsInventario = true;
|
||||
private boolean flagShouldAskToCreateOrUpdateRowInventario = false;
|
||||
private String commessaMagazzino;
|
||||
private boolean flagGeneraDocumentoSpedizione = false;
|
||||
private boolean flagIsInventarioCacheEnabled = false;
|
||||
|
||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||
return flagSpedizioneEnableFakeGiacenza;
|
||||
@@ -281,6 +288,15 @@ public class DBSettingsModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagPrintEtichetteOnLUClose() {
|
||||
return flagPrintEtichetteOnLUClose;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagPrintEtichetteOnLUClose(boolean flagPrintEtichetteOnLUClose) {
|
||||
this.flagPrintEtichetteOnLUClose = flagPrintEtichetteOnLUClose;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getOnNumCnfInputChanged() {
|
||||
return onNumCnfInputChanged;
|
||||
}
|
||||
@@ -416,4 +432,58 @@ public class DBSettingsModel {
|
||||
this.flagCanAddUnknownItemsInventario = flagCanAddUnknownItemsInventario;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagShouldAskToCreateOrUpdateRowInventario() {
|
||||
return flagShouldAskToCreateOrUpdateRowInventario;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagShouldAskToCreateOrUpdateRowInventario(boolean flagShouldAskToCreateOrUpdateRowInventario) {
|
||||
this.flagShouldAskToCreateOrUpdateRowInventario = flagShouldAskToCreateOrUpdateRowInventario;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagConsentiFuoriPianoLogistico() {
|
||||
return flagConsentiFuoriPianoLogistico;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagConsentiFuoriPianoLogistico(boolean flagConsentiFuoriPianoLogistico) {
|
||||
this.flagConsentiFuoriPianoLogistico = flagConsentiFuoriPianoLogistico;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagConsentiOrdineSenzaGriglia() {
|
||||
return flagConsentiOrdineSenzaGriglia;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagConsentiOrdineSenzaGriglia(boolean flagConsentiOrdineSenzaGriglia) {
|
||||
this.flagConsentiOrdineSenzaGriglia = flagConsentiOrdineSenzaGriglia;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCommessaMagazzino() {
|
||||
return commessaMagazzino;
|
||||
}
|
||||
|
||||
public DBSettingsModel setCommessaMagazzino(String commessaMagazzino) {
|
||||
this.commessaMagazzino = commessaMagazzino;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagGeneraDocumentoSpedizione() {
|
||||
return flagGeneraDocumentoSpedizione;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagGeneraDocumentoSpedizione(boolean flagGeneraDocumentoSpedizione) {
|
||||
this.flagGeneraDocumentoSpedizione = flagGeneraDocumentoSpedizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isFlagIsInventarioCacheEnabled() {
|
||||
return flagIsInventarioCacheEnabled;
|
||||
}
|
||||
|
||||
public DBSettingsModel setFlagIsInventarioCacheEnabled(boolean flagIsInventarioCacheEnabled) {
|
||||
this.flagIsInventarioCacheEnabled = flagIsInventarioCacheEnabled;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.List;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.StbGestSetup;
|
||||
import it.integry.integrywmsnative.core.model.dto.InternalCodAnagsDTO;
|
||||
@@ -24,6 +25,7 @@ import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityFirebase;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
|
||||
@Singleton
|
||||
public class SettingsManager {
|
||||
@@ -108,6 +110,7 @@ public class SettingsManager {
|
||||
};
|
||||
|
||||
RunnableArgs<Exception> tmpOnFailed = ex -> {
|
||||
UtilityLogger.error(ex);
|
||||
perfTrace.putAttribute("failed", "true");
|
||||
if (!(ex instanceof SocketTimeoutException)) onFailed.run(ex);
|
||||
else
|
||||
@@ -305,6 +308,14 @@ public class SettingsManager {
|
||||
.setGestName("PVM")
|
||||
.setSection("ORDINI_A")
|
||||
.setKeySection("ORDINA_ARTICOLI_ON_SCAN"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PVM")
|
||||
.setSection("ORDINI_A")
|
||||
.setKeySection("FLAG_CONSENTI_ORDINE_DA_GRIGLIA"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PVM")
|
||||
.setSection("ORDINI_A")
|
||||
.setKeySection("FLAG_CONSENTI_ORDINE_SENZA_GRIGLIA"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PVM")
|
||||
.setSection("DOC_INTERNI")
|
||||
@@ -325,6 +336,10 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_PRINT_ETICHETTE_ON_CLOSE"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("FLAG_PRINT_ETICHETTE_ON_LU_CLOSE"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
@@ -357,6 +372,22 @@ public class SettingsManager {
|
||||
.setGestName("PICKING")
|
||||
.setSection("INVENTARIO")
|
||||
.setKeySection("FLAG_CAN_ADD_UNKNOWN_ITEMS"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("INVENTARIO")
|
||||
.setKeySection("FLAG_SHOULD_ASK_TO_CREATE_OR_UPDATE_ROW"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("INVENTARIO")
|
||||
.setKeySection("ENABLE_OFFLINE_CACHE"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SETUP")
|
||||
.setKeySection("COMMESSA_MAGAZZINO"));
|
||||
stbGestSetupList.add(new StbGestSetup()
|
||||
.setGestName("PICKING")
|
||||
.setSection("SPEDIZIONE")
|
||||
.setKeySection("GENERA_DOC"));
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
|
||||
mGestSetupRESTConsumer.getValues(codMdep, stbGestSetupList, list -> {
|
||||
@@ -381,8 +412,11 @@ public class SettingsManager {
|
||||
dbSettingsModelIstance.setFlagAccettazioneUseQtaOrd(getValueFromList(list, "ACCETTAZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagPickLiberoAllowEmptyDest(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_DEST", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagOrdinaArticoliOnScan(getValueFromList(list, "ORDINI_A", "ORDINA_ARTICOLI_ON_SCAN", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagConsentiFuoriPianoLogistico(getValueFromList(list, "ORDINI_A", "FLAG_CONSENTI_ORDINE_DA_GRIGLIA", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagConsentiOrdineSenzaGriglia(getValueFromList(list, "ORDINI_A", "FLAG_CONSENTI_ORDINE_SENZA_GRIGLIA", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagPrintPackingListOnOrderClose(getValueFromList(list, "SPEDIZIONE", "FLAG_PRINT_PACKING_LIST_ON_CLOSE", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagPrintEtichetteOnOrderClose(getValueFromList(list, "SPEDIZIONE", "FLAG_PRINT_ETICHETTE_ON_CLOSE", Boolean.class));
|
||||
dbSettingsModelIstance.setFlagPrintEtichetteOnLUClose(getValueFromList(list, "SPEDIZIONE", "FLAG_PRINT_ETICHETTE_ON_LU_CLOSE", Boolean.class, true));
|
||||
dbSettingsModelIstance.setFlagAskInfoAggiuntiveSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_ASK_INFO_AGGIUNTIVE", Boolean.class));
|
||||
dbSettingsModelIstance.setFilterFornitoreProd(getValueFromList(list, "PRODUZIONE", "FILTER_FORNTIORE_PROD", String.class));
|
||||
dbSettingsModelIstance.setCodDtipOrdTrasfV(getValueFromList(list, "SPEDIZIONE", "COD_DTIP_ORD_TRASF", String.class));
|
||||
@@ -391,6 +425,10 @@ public class SettingsManager {
|
||||
dbSettingsModelIstance.setGroupShippingByCommodityGroup(getValueFromList(list, "SPEDIZIONE", "FLAG_GROUP_BY_GRP_MERC", Boolean.class, Boolean.FALSE));
|
||||
dbSettingsModelIstance.setFlagCanCreateInventario(getValueFromList(list, "INVENTARIO", "FLAG_CAN_CREATE_INVENTARIO", Boolean.class, Boolean.TRUE));
|
||||
dbSettingsModelIstance.setFlagCanAddUnknownItemsInventario(getValueFromList(list, "INVENTARIO", "FLAG_CAN_ADD_UNKNOWN_ITEMS", Boolean.class, Boolean.TRUE));
|
||||
dbSettingsModelIstance.setFlagShouldAskToCreateOrUpdateRowInventario(getValueFromList(list, "INVENTARIO", "FLAG_SHOULD_ASK_TO_CREATE_OR_UPDATE_ROW", Boolean.class, Boolean.FALSE));
|
||||
dbSettingsModelIstance.setCommessaMagazzino(getValueFromList(list, "SETUP", "COMMESSA_MAGAZZINO", String.class, CommonConst.Config.COMMESSA_MAG));
|
||||
dbSettingsModelIstance.setFlagGeneraDocumentoSpedizione(getValueFromList(list, "SPEDIZIONE", "GENERA_DOC", Boolean.class, Boolean.FALSE));
|
||||
dbSettingsModelIstance.setFlagIsInventarioCacheEnabled(getValueFromList(list, "INVENTARIO", "ENABLE_OFFLINE_CACHE", Boolean.class, Boolean.FALSE));
|
||||
|
||||
String notePerdita = getValueFromList(list, "DOC_INTERNI", "NOTE_PERDITA", String.class);
|
||||
if (notePerdita != null)
|
||||
@@ -420,7 +458,7 @@ public class SettingsManager {
|
||||
.filter(x -> x.getSection().equalsIgnoreCase(section) && x.getKeySection().equalsIgnoreCase(keySectionName))
|
||||
.findFirstOrElse(null);
|
||||
|
||||
if(value != null) {
|
||||
if (value != null) {
|
||||
if (clazz == String.class) {
|
||||
return clazz.cast(value.getValue());
|
||||
} else if (clazz == Boolean.class) {
|
||||
@@ -428,6 +466,12 @@ public class SettingsManager {
|
||||
} else if (clazz == Integer.class && value.getValue() != null) {
|
||||
return clazz.cast(Integer.parseInt(value.getValue()));
|
||||
}
|
||||
} else if (defaultValue == null) {
|
||||
if (clazz == Boolean.class) {
|
||||
return clazz.cast(Boolean.FALSE);
|
||||
} else if (clazz == Integer.class) {
|
||||
return clazz.cast(0);
|
||||
}
|
||||
}
|
||||
|
||||
return defaultValue;
|
||||
|
||||
@@ -95,10 +95,19 @@ public class SettingsModel {
|
||||
}
|
||||
|
||||
public static class UserSession {
|
||||
private String deviceId;
|
||||
private String profileDB;
|
||||
private AvailableCodMdepsDTO depo;
|
||||
private Integer defaultOrdinamentoPickingAccettazione = 0;
|
||||
|
||||
public String getDeviceId() {
|
||||
return deviceId;
|
||||
}
|
||||
|
||||
public void setDeviceId(String deviceId) {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getProfileDB() {
|
||||
return profileDB;
|
||||
}
|
||||
|
||||
@@ -27,9 +27,11 @@ public class UpdatesManager {
|
||||
public void init(AppCompatActivity activityContext) {
|
||||
this.mContext = activityContext;
|
||||
|
||||
final String baseEndpoint = SettingsManager.i().getServer().getProtocol() + "://" + SettingsManager.i().getServer().getHost() +
|
||||
(SettingsManager.i().getServer().getPort() > 0 ? ":" + SettingsManager.i().getServer().getPort() : "");
|
||||
|
||||
String currentVersionUrl = SettingsManager.i().getServer().getProtocol() + "://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/currentVersion";
|
||||
String currentDownloadUrl = SettingsManager.i().getServer().getProtocol() + "://" + SettingsManager.i().getServer().getHost() + ":" + SettingsManager.i().getServer().getPort() + "/ems-api/wms/android-release.apk";
|
||||
final String currentVersionUrl = baseEndpoint + "/ems-api/wms/currentVersion";
|
||||
final String currentDownloadUrl = baseEndpoint + "/ems-api/wms/android-release.apk";
|
||||
|
||||
|
||||
AppUpdater appUpdater = new AppUpdater(mContext)
|
||||
|
||||
@@ -40,7 +40,6 @@ public class PermissionsHelper {
|
||||
}
|
||||
|
||||
|
||||
|
||||
String[] permissionArray = new String[permissionsToAsk.size()];
|
||||
permissionsToAsk.toArray(permissionArray);
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
|
||||
public class UntMisUtils {
|
||||
|
||||
public static boolean shouldBeShowInColli(MtbAart mtbAart) {
|
||||
return SettingsManager.iDB().isFlagForceAllToColli() || (mtbAart == null || !mtbAart.isFlagQtaCnfFissaBoolean());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -36,6 +36,10 @@ public class UtilityBarcode {
|
||||
return barcodeScanDTO != null && barcodeScanDTO.getType() == BarcodeType.EAN128;
|
||||
}
|
||||
|
||||
public static boolean isCode128(BarcodeScanDTO barcodeScanDTO) {
|
||||
return barcodeScanDTO != null && barcodeScanDTO.getType() == BarcodeType.CODE128;
|
||||
}
|
||||
|
||||
public static boolean isEtichettaPosizione(BarcodeScanDTO barcodeScanDTO) {
|
||||
return isEtichettaPosizione(barcodeScanDTO, true);
|
||||
}
|
||||
|
||||
@@ -31,9 +31,9 @@ public class UtilityExceptions {
|
||||
public static void defaultException(Context context, Exception ex, boolean sendEmail) {
|
||||
|
||||
if (ex.getMessage() != null) {
|
||||
Logger.e(ex, Html.fromHtml(ex.getMessage()).toString());
|
||||
Logger.e(ex, Html.fromHtml(ex.getMessage()).toString(), ex.getStackTrace());
|
||||
} else {
|
||||
Logger.e(ex, "Errore");
|
||||
Logger.e(ex, "Errore", ex.getStackTrace());
|
||||
}
|
||||
|
||||
String errorMessage = CommonRESTException.tryRecognizeThenGetMessage(ex);
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||
|
||||
public class UtilityProgress {
|
||||
|
||||
public static DialogProgressView createDefaultProgressDialog(FragmentActivity mContext) {
|
||||
var progress = DialogProgressView.newInstance(null, null, true);
|
||||
progress.show(mContext.getSupportFragmentManager(), "tag");
|
||||
return progress;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -41,9 +41,15 @@ public class UtilityServer {
|
||||
public static void isEmsApiAvailable(final String protocol, final String serverAddress, final int serverTCPport, final Runnable onComplete, final RunnableArgs<Exception> onFailed) {
|
||||
new Thread(() -> {
|
||||
|
||||
String url = null;
|
||||
|
||||
if(serverTCPport > 0)
|
||||
url = String.format("%s://%s:%d/ems-api/system/ok", protocol, serverAddress, serverTCPport);
|
||||
else
|
||||
url = String.format("%s://%s/ems-api/system/ok", protocol, serverAddress);
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(String.format("%s://%s:%d/ems-api/system/ok", protocol, serverAddress, serverTCPport))
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try {
|
||||
|
||||
@@ -290,7 +290,7 @@ public class MainAccettazioneFragment extends BaseFragment implements ISearchabl
|
||||
DialogSimpleMessageView.makeInfoDialog(getText(R.string.orders).toString(),
|
||||
Html.fromHtml(String.format(getActivity().getResources().getQuantityString(R.plurals.loaded_orders_message, (int) ordsCounter), ordsCounter)
|
||||
+ "<br /><br />" +
|
||||
"<b>" + artsCounter + "</b> " + getActivity().getResources().getQuantityString(R.plurals.available_articles, (int) artsCounter)),
|
||||
"<b>" + artsCounter + "</b> " + getActivity().getResources().getQuantityString(R.plurals.ordered_articles, (int) artsCounter)),
|
||||
null,
|
||||
() -> {
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package it.integry.integrywmsnative.gest.accettazione.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
|
||||
@@ -20,7 +21,7 @@ public class SitArtOrdDTO {
|
||||
private BigDecimal qtaRiservata;
|
||||
private String untOrd;
|
||||
private String codMdep;
|
||||
private String dataOrd;
|
||||
private LocalDate dataOrd;
|
||||
private int numOrd;
|
||||
private String gestione;
|
||||
private int rigaOrd;
|
||||
@@ -168,11 +169,11 @@ public class SitArtOrdDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDataOrd() {
|
||||
public LocalDate getDataOrd() {
|
||||
return dataOrd;
|
||||
}
|
||||
|
||||
public SitArtOrdDTO setDataOrd(String dataOrd) {
|
||||
public SitArtOrdDTO setDataOrd(LocalDate dataOrd) {
|
||||
this.dataOrd = dataOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
v -> initBottomSheetDialogFilter(filterChipDTO));
|
||||
|
||||
switch (filterChipDTO.getID()) {
|
||||
case AccettazionePickingBindings.COD_ART_FILTER_ID:
|
||||
case AccettazionePickingBindings.COD_ART_FILTER_ID -> {
|
||||
mAppliedFilterViewModel.getCurrentCodArtPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -199,8 +199,8 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
}
|
||||
});
|
||||
filterChipView.setOnResetClicked(() -> mAppliedFilterViewModel.getCurrentCodArtPredicate().set(null));
|
||||
break;
|
||||
case AccettazionePickingBindings.DESCR_FILTER_ID:
|
||||
}
|
||||
case AccettazionePickingBindings.DESCR_FILTER_ID -> {
|
||||
mAppliedFilterViewModel.getCurrentDescrPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -221,8 +221,8 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
}
|
||||
});
|
||||
filterChipView.setOnResetClicked(() -> mAppliedFilterViewModel.getCurrentDescrPredicate().set(null));
|
||||
break;
|
||||
case AccettazionePickingBindings.POS_FILTER_ID:
|
||||
}
|
||||
case AccettazionePickingBindings.POS_FILTER_ID -> {
|
||||
mAppliedFilterViewModel.getCurrentPosPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -243,7 +243,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
}
|
||||
});
|
||||
filterChipView.setOnResetClicked(() -> mAppliedFilterViewModel.getCurrentPosPredicate().set(null));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.mBindings.filterChipsGroup.addView(filterChipView);
|
||||
@@ -262,43 +262,39 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
.getFilterLayoutView();
|
||||
|
||||
switch (filterChipDTO.getID()) {
|
||||
case AccettazionePickingBindings.COD_ART_FILTER_ID:
|
||||
((FilterCodArtLayoutView) filterLayoutView)
|
||||
.setAll(mAppliedFilterViewModel.getAllCodArts())
|
||||
.setAvailable(mAppliedFilterViewModel.getAvailableCodArts())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setCodArtFilter)
|
||||
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentCodArtPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentCodArtPredicate().get())
|
||||
.map(x -> x.getSitArtOrdDTO().getCodMart())
|
||||
.toList());
|
||||
break;
|
||||
case AccettazionePickingBindings.DESCR_FILTER_ID:
|
||||
((FilterDescrLayoutView) filterLayoutView)
|
||||
.setAll(mAppliedFilterViewModel.getAllDescrs())
|
||||
.setAvailable(mAppliedFilterViewModel.getAvailableDescrs())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setDescrFilter)
|
||||
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentDescrPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentDescrPredicate().get())
|
||||
.map(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt())
|
||||
.toList());
|
||||
break;
|
||||
case AccettazionePickingBindings.POS_FILTER_ID:
|
||||
((FilterPosizioneLayoutView) filterLayoutView)
|
||||
.setAll(mAppliedFilterViewModel.getAllPos())
|
||||
.setAvailable(mAppliedFilterViewModel.getAvailablePos())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setPosFilter)
|
||||
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentPosPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentPosPredicate().get())
|
||||
.map(x -> x.getMtbAart().getPosizione())
|
||||
.toList());
|
||||
break;
|
||||
|
||||
case AccettazionePickingBindings.COD_ART_FILTER_ID ->
|
||||
((FilterCodArtLayoutView) filterLayoutView)
|
||||
.setAll(mAppliedFilterViewModel.getAllCodArts())
|
||||
.setAvailable(mAppliedFilterViewModel.getAvailableCodArts())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setCodArtFilter)
|
||||
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentCodArtPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentCodArtPredicate().get())
|
||||
.map(x -> x.getSitArtOrdDTO().getCodMart())
|
||||
.toList());
|
||||
case AccettazionePickingBindings.DESCR_FILTER_ID ->
|
||||
((FilterDescrLayoutView) filterLayoutView)
|
||||
.setAll(mAppliedFilterViewModel.getAllDescrs())
|
||||
.setAvailable(mAppliedFilterViewModel.getAvailableDescrs())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setDescrFilter)
|
||||
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentDescrPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentDescrPredicate().get())
|
||||
.map(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt())
|
||||
.toList());
|
||||
case AccettazionePickingBindings.POS_FILTER_ID ->
|
||||
((FilterPosizioneLayoutView) filterLayoutView)
|
||||
.setAll(mAppliedFilterViewModel.getAllPos())
|
||||
.setAvailable(mAppliedFilterViewModel.getAvailablePos())
|
||||
.setOnFilterApplied(mAppliedFilterViewModel::setPosFilter)
|
||||
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||
.filter(mAppliedFilterViewModel.getCurrentPosPredicate().get() == null ?
|
||||
x -> false :
|
||||
mAppliedFilterViewModel.getCurrentPosPredicate().get())
|
||||
.map(x -> x.getMtbAart().getPosizione())
|
||||
.toList());
|
||||
}
|
||||
|
||||
if (!filterLayoutView.isAdded())
|
||||
@@ -373,9 +369,6 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
}
|
||||
|
||||
private void refreshList() {
|
||||
//this.onLoadingStarted();
|
||||
|
||||
//new Thread(() -> {
|
||||
|
||||
runOnUiThread(() -> {
|
||||
List<PickingObjectDTO> tmpList;
|
||||
@@ -393,7 +386,6 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
this.mAccettazioneMutableData.addAll(list);
|
||||
this.noItemsToPick.set(!isThereAnyItemToPick(tmpList));
|
||||
|
||||
//this.onLoadingEnded();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -402,21 +394,11 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
.filter(x -> !x.isHidden() && UtilityBigDecimal.greaterThan(x.getSitArtOrdDTO().getQtaDaEvadere(), BigDecimal.ZERO))
|
||||
.toList();
|
||||
|
||||
List<AccettazioneListModel> sortedList = null;
|
||||
|
||||
switch (mCurrentOrderBy) {
|
||||
case COD_ART_FOR:
|
||||
sortedList = convertDataModelToListModel__CodArtForn(tmpList);
|
||||
break;
|
||||
case DESCR_ART:
|
||||
sortedList = convertDataModelToListModel__DescrArt(tmpList);
|
||||
break;
|
||||
case RAG_SOC_COM:
|
||||
sortedList = convertDataModelToListModel__RagSocCom(tmpList);
|
||||
break;
|
||||
}
|
||||
|
||||
return sortedList;
|
||||
return switch (mCurrentOrderBy) {
|
||||
case COD_ART_FOR -> convertDataModelToListModel__CodArtForn(tmpList);
|
||||
case DESCR_ART -> convertDataModelToListModel__DescrArt(tmpList);
|
||||
case RAG_SOC_COM -> convertDataModelToListModel__RagSocCom(tmpList);
|
||||
};
|
||||
}
|
||||
|
||||
private List<AccettazioneListModel> convertDataModelToListModel__CodArtForn(List<PickingObjectDTO> dataList) {
|
||||
|
||||
@@ -4,8 +4,9 @@ import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliAccettazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.accettazione_picking.rest.AccettazionePickingRESTConsumer;
|
||||
@@ -25,8 +26,21 @@ public class AccettazionePickingModule {
|
||||
}
|
||||
|
||||
@Provides
|
||||
AccettazionePickingViewModel providesAccettazioneViewModel(ArticoloRESTConsumer articoloRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, PrinterRESTConsumer printerRESTConsumer, AccettazionePickingRESTConsumer accettazionePickingRESTConsumer, GestSetupRESTConsumer gestSetupRESTConsumer) {
|
||||
return new AccettazionePickingViewModel(articoloRESTConsumer, barcodeRESTConsumer, colliMagazzinoRESTConsumer, printerRESTConsumer, accettazionePickingRESTConsumer, gestSetupRESTConsumer);
|
||||
AccettazionePickingViewModel providesAccettazioneViewModel(
|
||||
ArticoloRESTConsumer articoloRESTConsumer,
|
||||
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||
PrinterRESTConsumer printerRESTConsumer,
|
||||
AccettazionePickingRESTConsumer accettazionePickingRESTConsumer,
|
||||
ColliAccettazioneRESTConsumer colliAccettazioneRESTConsumer,
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer) {
|
||||
return new AccettazionePickingViewModel(articoloRESTConsumer,
|
||||
barcodeRESTConsumer,
|
||||
colliMagazzinoRESTConsumer,
|
||||
printerRESTConsumer,
|
||||
accettazionePickingRESTConsumer,
|
||||
colliAccettazioneRESTConsumer,
|
||||
colliLavorazioneRESTConsumer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILUBaseOperationsListener;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILUPrintListener;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
@@ -38,17 +37,26 @@ import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliAccettazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliCaricoRESTConsumerInterface;
|
||||
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;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CreateUDCRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.CreateUDCRequestOrderDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.DeleteUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.udc.EditUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.uds.PrintULRequestDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
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.utility.UtilityThread;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.HistoryMtbAartDTO;
|
||||
@@ -66,18 +74,19 @@ public class AccettazionePickingViewModel {
|
||||
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||
private final PrinterRESTConsumer mPrinterRESTConsumer;
|
||||
private final AccettazionePickingRESTConsumer mAccettazionePickingRESTConsumer;
|
||||
private final GestSetupRESTConsumer mGestSetupRESTConsumer;
|
||||
private final ColliAccettazioneRESTConsumer mColliAccettazioneRESTConsumer;
|
||||
private final ColliLavorazioneRESTConsumer mColliLavorazioneRESTConsumer;
|
||||
|
||||
private ColliCaricoRESTConsumerInterface mColliCaricoRESTConsumer;
|
||||
|
||||
private AccettazionePickingViewModel.Listener mListener;
|
||||
|
||||
private List<OrdineAccettazioneInevasoDTO> mOrders;
|
||||
private List<SitArtOrdDTO> mSitArts;
|
||||
private boolean mUseQtaOrd;
|
||||
private final MutableLiveData<List<PickingObjectDTO>> mPickingList = new MutableLiveData<>();
|
||||
|
||||
private MtbColt mCurrentMtbColt = null;
|
||||
private GestioneEnum defaultGestioneOfUL = null;
|
||||
private String mDefaultCodMdep = null;
|
||||
|
||||
private final List<HistoryMtbAartDTO> mHistoryUsedAarts = new ArrayList<>();
|
||||
|
||||
@@ -87,28 +96,29 @@ public class AccettazionePickingViewModel {
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||
PrinterRESTConsumer printerRESTConsumer,
|
||||
AccettazionePickingRESTConsumer accettazionePickingRESTConsumer,
|
||||
GestSetupRESTConsumer gestSetupRESTConsumer) {
|
||||
ColliAccettazioneRESTConsumer colliAccettazioneRESTConsumer,
|
||||
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer) {
|
||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||
this.mPrinterRESTConsumer = printerRESTConsumer;
|
||||
this.mAccettazionePickingRESTConsumer = accettazionePickingRESTConsumer;
|
||||
this.mGestSetupRESTConsumer = gestSetupRESTConsumer;
|
||||
this.mColliAccettazioneRESTConsumer = colliAccettazioneRESTConsumer;
|
||||
this.mColliLavorazioneRESTConsumer = colliLavorazioneRESTConsumer;
|
||||
}
|
||||
|
||||
|
||||
public void init(List<OrdineAccettazioneInevasoDTO> orders, List<SitArtOrdDTO> sitArts, String codMdep, boolean useQtaOrd) {
|
||||
this.mOrders = orders;
|
||||
this.mDefaultCodMdep = codMdep;
|
||||
this.mUseQtaOrd = useQtaOrd;
|
||||
|
||||
this.mSitArts = Stream.of(sitArts)
|
||||
.filter(x -> UtilityBigDecimal.greaterThan(x.getNumCnfDaEvadere(), BigDecimal.ZERO) && UtilityBigDecimal.greaterThan(x.getQtaDaEvadere(), BigDecimal.ZERO))
|
||||
List<SitArtOrdDTO> mSitArts = Stream.of(sitArts)
|
||||
.filter(x ->
|
||||
UtilityBigDecimal.greaterThan(x.getNumCnfDaEvadere(), BigDecimal.ZERO) &&
|
||||
UtilityBigDecimal.greaterThan(x.getQtaDaEvadere(), BigDecimal.ZERO))
|
||||
.toList();
|
||||
|
||||
getEmptyPickingList(this.mSitArts, pickingObjectList -> {
|
||||
this.mPickingList.postValue(pickingObjectList);
|
||||
});
|
||||
getEmptyPickingList(mSitArts, this.mPickingList::postValue);
|
||||
|
||||
//Definizione della gestione collo di default
|
||||
Boolean isOrdTrasf = Stream.of(mOrders)
|
||||
@@ -133,6 +143,11 @@ public class AccettazionePickingViewModel {
|
||||
} else {
|
||||
this.sendError(new InvalidLUMultiGestioneException());
|
||||
}
|
||||
|
||||
switch (defaultGestioneOfUL) {
|
||||
case ACQUISTO -> this.mColliCaricoRESTConsumer = mColliAccettazioneRESTConsumer;
|
||||
case LAVORAZIONE -> this.mColliCaricoRESTConsumer = mColliLavorazioneRESTConsumer;
|
||||
}
|
||||
}
|
||||
|
||||
private void getEmptyPickingList(List<SitArtOrdDTO> sitArtOrdList, RunnableArgs<List<PickingObjectDTO>> onComplete) {
|
||||
@@ -357,83 +372,102 @@ public class AccettazionePickingViewModel {
|
||||
public void createNewLU(Integer customNumCollo, String customSerCollo, boolean disablePrint, Runnable onComplete) {
|
||||
this.sendOnInfoAggiuntiveRequest((additionalNotes, tCol) -> {
|
||||
|
||||
this.mGestSetupRESTConsumer.getValue("PICKING", "SETUP", "DEFAULT_POSIZIONE_COLLI_ACCETTAZIONE", defaultPosAccettazioneDTO -> {
|
||||
// this.mGestSetupRESTConsumer.getValue("PICKING", "SETUP", "DEFAULT_POSIZIONE_COLLI_ACCETTAZIONE", defaultPosAccettazioneDTO -> {
|
||||
//
|
||||
// String defaultPosAccettazione = null;
|
||||
// if (defaultPosAccettazioneDTO != null && !UtilityString.isNullOrEmpty(defaultPosAccettazioneDTO.value))
|
||||
// defaultPosAccettazione = defaultPosAccettazioneDTO.value;
|
||||
//
|
||||
// MtbColt mtbColt = new MtbColt();
|
||||
// mtbColt
|
||||
// .initDefaultFields(defaultGestioneOfUL)
|
||||
// .setAnnotazioni(additionalNotes)
|
||||
// .setPosizione(defaultPosAccettazione)
|
||||
// .setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
//
|
||||
// if (tCol != null) {
|
||||
// mtbColt.setCodTcol(tCol.getCodTcol());
|
||||
// mtbColt.setMtbTCol(tCol);
|
||||
// }
|
||||
//
|
||||
// if (customNumCollo != null) {
|
||||
// mtbColt.setNumCollo(customNumCollo);
|
||||
// }
|
||||
//
|
||||
// if (!UtilityString.isNullOrEmpty(customSerCollo)) {
|
||||
// mtbColt.setSerCollo(customSerCollo);
|
||||
// }
|
||||
//
|
||||
// List<String> codAnags =
|
||||
// Stream.of(mOrders)
|
||||
// .map(OrdineAccettazioneInevasoDTO::getCodAnagOrd)
|
||||
// .distinct()
|
||||
// .toList();
|
||||
//
|
||||
// if (codAnags.size() == 1) {
|
||||
// mtbColt.setCodAnag(codAnags.get(0));
|
||||
// }
|
||||
//
|
||||
// List<String> rifOrds =
|
||||
// Stream.of(mOrders)
|
||||
// .map(OrdineAccettazioneInevasoDTO::getRifOrd)
|
||||
// .distinct()
|
||||
// .toList();
|
||||
//
|
||||
// if (rifOrds.size() == 1) {
|
||||
// mtbColt.setRifOrd(rifOrds.get(0));
|
||||
// }
|
||||
//
|
||||
// List<String> numDataOrds =
|
||||
// Stream.of(mOrders)
|
||||
// .map(value -> value.getNumero() + value.getData())
|
||||
// .distinct()
|
||||
// .toList();
|
||||
//
|
||||
// if (numDataOrds.size() == 1) {
|
||||
// mtbColt.setNumOrd(mOrders.get(0).getNumero());
|
||||
// mtbColt.setDataOrd(mOrders.get(0).getData());
|
||||
// }
|
||||
//
|
||||
// this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, savedMtbColt -> {
|
||||
// mtbColt
|
||||
// .setNumCollo(savedMtbColt.getNumCollo())
|
||||
// .setDataCollo(savedMtbColt.getDataColloS())
|
||||
// .setMtbColr(new ObservableArrayList<>())
|
||||
// .setDisablePrint(disablePrint);
|
||||
//
|
||||
// this.mCurrentMtbColt = mtbColt;
|
||||
//
|
||||
// if (onComplete != null) onComplete.run();
|
||||
// this.sendLUOpened(mtbColt);
|
||||
// }, this::sendError);
|
||||
//
|
||||
// }, this::sendError);
|
||||
|
||||
String defaultPosAccettazione = null;
|
||||
if (defaultPosAccettazioneDTO != null && !UtilityString.isNullOrEmpty(defaultPosAccettazioneDTO.value))
|
||||
defaultPosAccettazione = defaultPosAccettazioneDTO.value;
|
||||
final List<CreateUDCRequestOrderDTO> orders = Stream.of(this.mOrders)
|
||||
.map(x -> new CreateUDCRequestOrderDTO()
|
||||
.setDataCons(x.getDataConsD() != null ? UtilityDate.toLocalDate(x.getDataConsD()) : null)
|
||||
.setDataOrd(UtilityDate.toLocalDate(x.getDataD()))
|
||||
.setGestione(x.getGestione())
|
||||
.setNumOrd(x.getNumero()))
|
||||
.toList();
|
||||
|
||||
MtbColt mtbColt = new MtbColt();
|
||||
mtbColt
|
||||
.initDefaultFields(defaultGestioneOfUL)
|
||||
.setAnnotazioni(additionalNotes)
|
||||
.setPosizione(defaultPosAccettazione)
|
||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
final CreateUDCRequestDTO createUDCRequestDTO = new CreateUDCRequestDTO()
|
||||
.setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep())
|
||||
.setAnnotazioni(additionalNotes)
|
||||
.setCodTcol(tCol != null ? tCol.getCodTcol() : null)
|
||||
.setNumCollo(customNumCollo)
|
||||
.setSerCollo(customSerCollo)
|
||||
.setOrders(orders);
|
||||
|
||||
if (tCol != null) {
|
||||
mtbColt.setCodTcol(tCol.getCodTcol());
|
||||
mtbColt.setMtbTCol(tCol);
|
||||
}
|
||||
this.mColliCaricoRESTConsumer.createUDC(createUDCRequestDTO, createdUDS -> {
|
||||
this.mCurrentMtbColt = createdUDS;
|
||||
|
||||
if (customNumCollo != null) {
|
||||
mtbColt.setNumCollo(customNumCollo);
|
||||
}
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(customSerCollo)) {
|
||||
mtbColt.setSerCollo(customSerCollo);
|
||||
}
|
||||
|
||||
List<String> codAnags =
|
||||
Stream.of(mOrders)
|
||||
.map(OrdineAccettazioneInevasoDTO::getCodAnagOrd)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if (codAnags != null && codAnags.size() == 1) {
|
||||
mtbColt.setCodAnag(codAnags.get(0));
|
||||
}
|
||||
|
||||
List<String> rifOrds =
|
||||
Stream.of(mOrders)
|
||||
.map(OrdineAccettazioneInevasoDTO::getRifOrd)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if (rifOrds != null && rifOrds.size() == 1) {
|
||||
mtbColt.setRifOrd(rifOrds.get(0));
|
||||
}
|
||||
|
||||
List<String> numDataOrds =
|
||||
Stream.of(mOrders)
|
||||
.map(value -> value.getNumero() + value.getData())
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if (numDataOrds != null && numDataOrds.size() == 1) {
|
||||
mtbColt.setNumOrd(mOrders.get(0).getNumero());
|
||||
mtbColt.setDataOrd(mOrders.get(0).getData());
|
||||
|
||||
try {
|
||||
mtbColt.generaFiltroOrdine();
|
||||
} catch (Exception ex) {
|
||||
this.sendError(ex);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, savedMtbColt -> {
|
||||
mtbColt
|
||||
.setNumCollo(savedMtbColt.getNumCollo())
|
||||
.setDataCollo(savedMtbColt.getDataColloS())
|
||||
.setMtbColr(new ObservableArrayList<>())
|
||||
.setDisablePrint(disablePrint);
|
||||
|
||||
this.mCurrentMtbColt = mtbColt;
|
||||
|
||||
if (onComplete != null) onComplete.run();
|
||||
this.sendLUOpened(mtbColt);
|
||||
}, this::sendError);
|
||||
this.mCurrentMtbColt.setMtbColr(new ObservableArrayList<>())
|
||||
.setDisablePrint(disablePrint);
|
||||
|
||||
if (onComplete != null) onComplete.run();
|
||||
this.sendLUOpened(createdUDS);
|
||||
}, this::sendError);
|
||||
|
||||
});
|
||||
@@ -584,69 +618,57 @@ public class AccettazionePickingViewModel {
|
||||
|
||||
|
||||
public void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
||||
if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) {
|
||||
resetMatchedRows();
|
||||
|
||||
if (shouldCloseLU) closeLU();
|
||||
return;
|
||||
}
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
UtilityThread.executeParallel(() -> {
|
||||
String gestioneRif = pickingObjectDTO.getSitArtOrdDTO().getGestioneEnum() == GestioneEnum.PRODUZIONE ? "L" : pickingObjectDTO.getSitArtOrdDTO().getGestione();
|
||||
|
||||
String gestioneRif = pickingObjectDTO.getSitArtOrdDTO().getGestioneEnum() == GestioneEnum.PRODUZIONE ? "L" : pickingObjectDTO.getSitArtOrdDTO().getGestione();
|
||||
var clonedTargetMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||
clonedTargetMtbColt.setMtbColr(null);
|
||||
|
||||
final MtbColr mtbColr = new MtbColr()
|
||||
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
|
||||
.setPartitaMag(partitaMag)
|
||||
.setDataScadPartita(dataScad)
|
||||
.setQtaCol(qtaTot)
|
||||
.setQtaCnf(qtaCnf)
|
||||
.setNumCnf(numCnf)
|
||||
.setGestioneRif(gestioneRif)
|
||||
.setCodJcom(pickingObjectDTO.getSitArtOrdDTO().getCodJcom())
|
||||
.setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa())
|
||||
.setDatetimeRow(UtilityDate.getDateInstance())
|
||||
.setDataOrd(pickingObjectDTO.getSitArtOrdDTO().getDataOrd())
|
||||
.setNumOrd(pickingObjectDTO.getSitArtOrdDTO().getNumOrd())
|
||||
.setRigaOrd(pickingObjectDTO.getSitArtOrdDTO().getRigaOrd());
|
||||
var insertUDCRowRequestDto = new InsertUDCRowRequestDTO()
|
||||
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
|
||||
.setQtaTot(qtaTot)
|
||||
.setQtaCnf(qtaCnf)
|
||||
.setNumCnf(numCnf)
|
||||
.setPartitaMag(partitaMag)
|
||||
.setCodJcom(pickingObjectDTO.getSitArtOrdDTO().getCodJcom())
|
||||
.setGestioneRif(gestioneRif)
|
||||
.setDataOrd(pickingObjectDTO.getSitArtOrdDTO().getDataOrd())
|
||||
.setNumOrd(pickingObjectDTO.getSitArtOrdDTO().getNumOrd())
|
||||
.setRigaOrd(pickingObjectDTO.getSitArtOrdDTO().getRigaOrd())
|
||||
.setTargetMtbColt(clonedTargetMtbColt);
|
||||
|
||||
if (dataScad != null)
|
||||
insertUDCRowRequestDto
|
||||
.setDataScad(UtilityDate.toLocalDate(dataScad));
|
||||
|
||||
this.addHistoryItem(mtbColr);
|
||||
mColliCaricoRESTConsumer.insertUDCRow(insertUDCRowRequestDto, insertedMtbColr -> {
|
||||
this.addHistoryItem(insertedMtbColr);
|
||||
|
||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
insertedMtbColr
|
||||
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||
|
||||
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
||||
pickingObjectDTO.getWithdrawMtbColrs().add(insertedMtbColr);
|
||||
mCurrentMtbColt.getMtbColr().add(insertedMtbColr);
|
||||
|
||||
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
|
||||
cloneMtbColt.getMtbColr().add((MtbColr) mtbColr.clone());
|
||||
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
|
||||
resetMatchedRows();
|
||||
|
||||
if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) {
|
||||
resetMatchedRows();
|
||||
this.sendOnLoadingEnded();
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
if (shouldCloseLU) closeLU();
|
||||
return;
|
||||
}
|
||||
if (shouldCloseLU) closeLU();
|
||||
|
||||
mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> {
|
||||
}, this::sendError);
|
||||
|
||||
mtbColr
|
||||
.setDataCollo(value.getDataColloS())
|
||||
.setNumCollo(value.getNumCollo())
|
||||
.setGestione(value.getGestione())
|
||||
.setSerCollo(value.getSerCollo())
|
||||
.setRiga(value.getMtbColr().get(value.getMtbColr().size() - 1).getRiga())
|
||||
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||
|
||||
pickingObjectDTO.getWithdrawMtbColrs().add(mtbColr);
|
||||
mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||
|
||||
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
|
||||
resetMatchedRows();
|
||||
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
if (shouldCloseLU) closeLU();
|
||||
}, this::sendError);
|
||||
}, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -683,46 +705,41 @@ public class AccettazionePickingViewModel {
|
||||
private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
MtbColt mtbColt = new MtbColt()
|
||||
.setNumCollo(mtbColrToUpdate.getNumCollo())
|
||||
.setDataCollo(mtbColrToUpdate.getDataColloS())
|
||||
.setSerCollo(mtbColrToUpdate.getSerCollo())
|
||||
.setGestione(mtbColrToUpdate.getGestione())
|
||||
.setMtbColr(new ObservableArrayList<>());
|
||||
mtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||
MtbColr mtbColrClone = (MtbColr) mtbColrToUpdate.clone();
|
||||
mtbColrClone.setMtbAart(null)
|
||||
.setMtbPartitaMag(null);
|
||||
|
||||
final MtbColr mtbColr = (MtbColr) mtbColrToUpdate.clone();
|
||||
mtbColr.setOperation(CommonModelConsts.OPERATION.UPDATE);
|
||||
mtbColr
|
||||
.setNumCnf(numCnf)
|
||||
.setQtaCnf(qtaCnf)
|
||||
.setQtaCol(qtaTot)
|
||||
.setPartitaMag(partitaMag)
|
||||
.setDataScadPartita(dataScad)
|
||||
.setUtente(SettingsManager.i().getUser().getFullname())
|
||||
.setDatetimeRow(UtilityDate.getDateInstance());
|
||||
var editUDCRowRequest = new EditUDCRowRequestDTO()
|
||||
.setSourceMtbColr(mtbColrClone)
|
||||
.setNewNumCnf(numCnf)
|
||||
.setNewQtaCnf(qtaCnf)
|
||||
.setNewQtaTot(qtaTot)
|
||||
.setNewPartitaMag(partitaMag);
|
||||
|
||||
mtbColt.getMtbColr().add(mtbColr);
|
||||
if (dataScad != null)
|
||||
editUDCRowRequest
|
||||
.setNewDataScad(UtilityDate.toLocalDate(dataScad));
|
||||
|
||||
this.addHistoryItem(mtbColr);
|
||||
|
||||
this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
||||
this.mColliCaricoRESTConsumer.editUDCRow(editUDCRowRequest, (editedMtbColr) -> {
|
||||
|
||||
mtbColr.setNumCnf(numCnf)
|
||||
.setQtaCnf(qtaCnf)
|
||||
.setQtaCol(qtaTot);
|
||||
this.addHistoryItem(editedMtbColr);
|
||||
|
||||
Optional<PickingObjectDTO> pickingObjectDTO = Stream.of(this.mPickingList.getValue())
|
||||
.filter(x -> Stream.of(x.getWithdrawMtbColrs()).anyMatch(y -> y == mtbColrToUpdate))
|
||||
.findSingle();
|
||||
|
||||
editedMtbColr
|
||||
.setUntMis(mtbColrToUpdate.getUntMis())
|
||||
.setMtbAart(mtbColrToUpdate.getMtbAart());
|
||||
|
||||
if (pickingObjectDTO.isPresent()) {
|
||||
pickingObjectDTO.get().getWithdrawMtbColrs().remove(mtbColrToUpdate);
|
||||
pickingObjectDTO.get().getWithdrawMtbColrs().add(mtbColr);
|
||||
pickingObjectDTO.get().getWithdrawMtbColrs().add(editedMtbColr);
|
||||
}
|
||||
|
||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToUpdate);
|
||||
this.mCurrentMtbColt.getMtbColr().add(mtbColr);
|
||||
this.mCurrentMtbColt.getMtbColr().add(editedMtbColr);
|
||||
|
||||
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
|
||||
resetMatchedRows();
|
||||
@@ -737,42 +754,31 @@ public class AccettazionePickingViewModel {
|
||||
public void deleteRow(MtbColr mtbColrToDelete) {
|
||||
this.sendMtbColrDeleteRequest(shouldDelete -> {
|
||||
|
||||
if (shouldDelete) {
|
||||
this.sendOnLoadingStarted();
|
||||
MtbColt mtbColt = new MtbColt()
|
||||
.setNumCollo(mtbColrToDelete.getNumCollo())
|
||||
.setDataCollo(mtbColrToDelete.getDataColloS())
|
||||
.setSerCollo(mtbColrToDelete.getSerCollo())
|
||||
.setGestione(mtbColrToDelete.getGestione())
|
||||
.setMtbColr(new ObservableArrayList<>());
|
||||
mtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||
if (!shouldDelete)
|
||||
return;
|
||||
|
||||
MtbColr mtbColr = (MtbColr) mtbColrToDelete.clone();
|
||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||
mtbColr.setQtaCol(mtbColr.getQtaCol().multiply(new BigDecimal(-1)))
|
||||
.setNumCnf(mtbColr.getNumCnf().multiply(new BigDecimal(-1)))
|
||||
.setRiga(null);
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
mtbColt.getMtbColr().add(mtbColr);
|
||||
var deleteUDCRowRequest = new DeleteUDCRowRequestDTO()
|
||||
.setMtbColrToDelete(mtbColrToDelete);
|
||||
|
||||
this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
||||
this.mColliCaricoRESTConsumer.deleteUDCRow(deleteUDCRowRequest,
|
||||
() -> {
|
||||
Optional<PickingObjectDTO> pickingObjectDTO = Stream.of(this.mPickingList.getValue())
|
||||
.filter(x -> Stream.of(x.getWithdrawMtbColrs()).anyMatch(y -> y == mtbColrToDelete))
|
||||
.findSingle();
|
||||
|
||||
Optional<PickingObjectDTO> pickingObjectDTO = Stream.of(this.mPickingList.getValue())
|
||||
.filter(x -> Stream.of(x.getWithdrawMtbColrs()).anyMatch(y -> y == mtbColrToDelete))
|
||||
.findSingle();
|
||||
if (pickingObjectDTO.isPresent()) {
|
||||
pickingObjectDTO.get().getWithdrawMtbColrs().remove(mtbColrToDelete);
|
||||
}
|
||||
|
||||
if (pickingObjectDTO.isPresent()) {
|
||||
pickingObjectDTO.get().getWithdrawMtbColrs().remove(mtbColrToDelete);
|
||||
}
|
||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToDelete);
|
||||
|
||||
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToDelete);
|
||||
this.resetMatchedRows();
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
|
||||
this.resetMatchedRows();
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
}, this::sendError);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -781,14 +787,16 @@ public class AccettazionePickingViewModel {
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
mColliMagazzinoRESTConsumer.canLUBeDeleted(mCurrentMtbColt, canBeDeleted -> {
|
||||
mColliMagazzinoRESTConsumer.canULBeDeleted(mCurrentMtbColt, canBeDeleted -> {
|
||||
if (canBeDeleted) {
|
||||
deleteLU(() -> {
|
||||
this.sendLUClosed();
|
||||
this.sendOnLoadingEnded();
|
||||
});
|
||||
} else {
|
||||
mColliMagazzinoRESTConsumer.updateDataFine(mCurrentMtbColt, () -> {
|
||||
CloseUDCRequestDTO closeUDCRequestDTO = new CloseUDCRequestDTO()
|
||||
.setMtbColt(mCurrentMtbColt);
|
||||
mColliCaricoRESTConsumer.closeUDC(closeUDCRequestDTO, closeUDCResponse -> {
|
||||
|
||||
Runnable onVersamentoCompleted = () -> {
|
||||
if (!mCurrentMtbColt.getDisablePrint()) {
|
||||
@@ -825,16 +833,15 @@ public class AccettazionePickingViewModel {
|
||||
|
||||
|
||||
private void printCollo(Runnable onComplete) {
|
||||
|
||||
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||
cloneMtbColt.setGestione(cloneMtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE ? GestioneEnum.PRODUZIONE : cloneMtbColt.getGestioneEnum());
|
||||
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
cloneMtbColt,
|
||||
() -> {
|
||||
this.sendLUSuccessfullyPrinted();
|
||||
onComplete.run();
|
||||
}, ex -> this.sendLUPrintError(ex, onComplete));
|
||||
var printUDSRequestDto = new PrintULRequestDTO()
|
||||
.setMtbColt(cloneMtbColt);
|
||||
|
||||
this.mColliMagazzinoRESTConsumer.printUL(printUDSRequestDto, onComplete,
|
||||
ex -> this.sendLUPrintError(ex, onComplete));
|
||||
}
|
||||
|
||||
private void postCloseOperations() {
|
||||
@@ -844,7 +851,10 @@ public class AccettazionePickingViewModel {
|
||||
}
|
||||
|
||||
private void deleteLU(Runnable onComplete) {
|
||||
mColliMagazzinoRESTConsumer.deleteCollo(mCurrentMtbColt, () -> {
|
||||
DeleteULRequestDTO deleteULRequestDTO = new DeleteULRequestDTO()
|
||||
.setMtbColt(this.mCurrentMtbColt);
|
||||
|
||||
mColliMagazzinoRESTConsumer.deleteUL(deleteULRequestDTO, () -> {
|
||||
this.mCurrentMtbColt = null;
|
||||
|
||||
if (onComplete != null) onComplete.run();
|
||||
|
||||
@@ -3,11 +3,12 @@ package it.integry.integrywmsnative.gest.contab_doc_interni;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
@@ -28,7 +29,6 @@ import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.rest.model.documento.DocumentoArtDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.databinding.FragmentDocInterniBinding;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoResponseDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dialog.DialogSelectDocInfoView;
|
||||
@@ -83,23 +83,29 @@ public class DocInterniFragment extends BaseFragment implements ITitledFragment,
|
||||
mBinding.setView(this);
|
||||
mBinding.setViewModel(mViewModel);
|
||||
|
||||
mViewModel.mtbGrup.observe(getViewLifecycleOwner(), mtbGrup -> mViewModel.fetchProducts());
|
||||
mViewModel.dtbTipi.observe(getViewLifecycleOwner(), dtbTipi -> mViewModel.fetchDocuments());
|
||||
this.initRecyclerView();
|
||||
|
||||
return mBinding.getRoot();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
if (!this.mViewModel.hasDocDetails()) {
|
||||
mViewModel.init();
|
||||
} else {
|
||||
this.mViewModel.fetchDocuments();
|
||||
this.onLoadingStarted();
|
||||
this.mViewModel.fetchDocuments(this::onLoadingEnded);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
||||
@@ -117,27 +123,7 @@ public class DocInterniFragment extends BaseFragment implements ITitledFragment,
|
||||
@Override
|
||||
public void onDocDetailsChanged(DialogSelectDocInfoResponseDTO selection) {
|
||||
mViewModel.setSelectedDocDetails(selection);
|
||||
|
||||
if (selection.isFornitoreRequired()) {
|
||||
mBinding.codAnagContainer.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mBinding.codAnagContainer.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
// if (selection.getGruppoArt() != null) {
|
||||
// mBinding.mtbGrpContainer.setVisibility(View.VISIBLE);
|
||||
// } else {
|
||||
// mBinding.mtbGrpContainer.setVisibility(View.GONE);
|
||||
// }
|
||||
|
||||
if (selection.isDocumentRequired()) {
|
||||
mBinding.docContainer.setVisibility(View.VISIBLE);
|
||||
mBinding.document.setText(Html.fromHtml(getString(R.string.doc_testata, String.valueOf(selection.getNumDoc()), UtilityDate.formatDate(selection.getDataDoc(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN))));
|
||||
} else {
|
||||
mBinding.docContainer.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
mBinding.invalidateAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -158,12 +144,9 @@ public class DocInterniFragment extends BaseFragment implements ITitledFragment,
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
public void showInfoArtDialog() {
|
||||
|
||||
}
|
||||
|
||||
private void initRecyclerView() {
|
||||
this.mViewModel.getDocsList().observe(getViewLifecycleOwner(), this::refreshList);
|
||||
|
||||
DocInterniListAdapter docInterniListAdapter = new DocInterniListAdapter(this.requireActivity(), this.mDocInterniMutableData);
|
||||
docInterniListAdapter.setEmptyView(this.mBinding.docInterniEmptyView);
|
||||
this.mBinding.docInterniMainList.setAdapter(docInterniListAdapter);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni;
|
||||
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -37,12 +37,12 @@ public class DocInterniViewModel {
|
||||
private List<DocumentoArtDTO> availableArts;
|
||||
private final MutableLiveData<List<DocInternoWrapper>> mDocsList = new MutableLiveData<>();
|
||||
|
||||
public final MutableLiveData<TipoDocDTO> dtbTipi = new MutableLiveData<>();
|
||||
public final MutableLiveData<GruppoArticoloDTO> mtbGrup = new MutableLiveData<>();
|
||||
public final MutableLiveData<FornitoreDTO> fornitore = new MutableLiveData<>();
|
||||
public final MutableLiveData<Date> dataDoc = new MutableLiveData<>();
|
||||
public final MutableLiveData<String> numDoc = new MutableLiveData<>();
|
||||
public final MutableLiveData<String> note = new MutableLiveData<>();
|
||||
public TipoDocDTO dtbTipi;
|
||||
public GruppoArticoloDTO mtbGrup;
|
||||
public FornitoreDTO fornitore;
|
||||
public Date dataDoc;
|
||||
public String numDoc;
|
||||
public String note;
|
||||
public final BindableInteger artsSize = new BindableInteger(0);
|
||||
|
||||
@Inject
|
||||
@@ -52,8 +52,6 @@ public class DocInterniViewModel {
|
||||
this.docInterniRESTConsumer = docInterniRESTConsumer;
|
||||
this.documentRepository = documentRepository;
|
||||
this.documentRESTConsumer = documentRESTConsumer;
|
||||
|
||||
this.mDocsList.setValue(new ArrayList<>());
|
||||
}
|
||||
|
||||
|
||||
@@ -83,54 +81,62 @@ public class DocInterniViewModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public MutableLiveData<List<DocInternoWrapper>> getDocsList() {
|
||||
public LiveData<List<DocInternoWrapper>> getDocsList() {
|
||||
return mDocsList;
|
||||
}
|
||||
|
||||
public void setSelectedDocDetails(DialogSelectDocInfoResponseDTO selection) {
|
||||
this.fornitore = selection.getFornitore();
|
||||
this.dtbTipi = selection.getTipoDoc();
|
||||
|
||||
this.fornitore.postValue(selection.getFornitore());
|
||||
this.dtbTipi.postValue(selection.getTipoDoc());
|
||||
this.mtbGrup = selection.getGruppoArt();
|
||||
this.dataDoc = selection.getDataDoc();
|
||||
this.numDoc = selection.getNumDoc() != null ? selection.getNumDoc().toString() : null;
|
||||
this.note = selection.getNote();
|
||||
|
||||
this.mtbGrup.postValue(selection.getGruppoArt());
|
||||
this.dataDoc.postValue(selection.getDataDoc());
|
||||
this.numDoc.postValue(selection.getNumDoc() != null ? selection.getNumDoc().toString() : null);
|
||||
this.note.postValue(selection.getNote());
|
||||
this.sendOnLoadingStarted();
|
||||
fetchProducts(() -> {
|
||||
fetchDocuments(this::sendOnLoadingEnded);
|
||||
});
|
||||
}
|
||||
|
||||
public void fetchProducts() {
|
||||
this.productsFetched = false;
|
||||
this.sendOnLoadingStarted();
|
||||
public void fetchProducts(Runnable onComplete) {
|
||||
documentRESTConsumer.loadDocumentAvailableArts(
|
||||
this.getCodDtip(),
|
||||
this.getCodMgrp(),
|
||||
this.getCodAnagForn(),
|
||||
data -> {
|
||||
this.productsFetched = true;
|
||||
this.availableArts = data.getArts();
|
||||
this.artsSize.set(this.availableArts.size());
|
||||
|
||||
documentRESTConsumer.loadDocumentoAvailableArts(this.getCodDtip(), this.getCodMgrp(), data -> {
|
||||
this.productsFetched = true;
|
||||
this.availableArts = data.getArts();
|
||||
this.artsSize.set(this.availableArts.size());
|
||||
|
||||
if (this.docsFetched)
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
}, this::sendError);
|
||||
onComplete.run();
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
public void fetchDocuments() {
|
||||
this.docsFetched = false;
|
||||
this.sendOnLoadingStarted();
|
||||
String codAnag = null, codVdes = null;
|
||||
FornitoreDTO fornitore = this.fornitore.getValue();
|
||||
public void fetchDocuments(Runnable onComplete) {
|
||||
String codAnag = null;
|
||||
String codVdes = null;
|
||||
|
||||
FornitoreDTO fornitore = this.fornitore;
|
||||
if (fornitore != null) {
|
||||
codAnag = fornitore.getCodAnag();
|
||||
codVdes = fornitore.getCodVdes();
|
||||
}
|
||||
documentRepository.getLocalDocumentsByCodDtip(this.getCodDtip(), codAnag, codVdes, dataDoc.getValue(), numDoc.getValue(), list -> {
|
||||
documentRepository.getNextNumCollo(nextNumCollo -> {
|
||||
this.mDocsList.postValue(list);
|
||||
this.setNextNumCollo(nextNumCollo);
|
||||
this.docsFetched = true;
|
||||
if (this.productsFetched) {
|
||||
this.sendOnLoadingEnded();
|
||||
}
|
||||
}, this::sendError);
|
||||
|
||||
|
||||
var docsList = documentRepository.getDocuments(this.getCodDtip(),
|
||||
codAnag, codVdes, dataDoc, numDoc);
|
||||
|
||||
docsList.observeForever(data -> {
|
||||
this.mDocsList.postValue(data);
|
||||
});
|
||||
|
||||
documentRepository.getNextNumCollo(nextNumCollo -> {
|
||||
this.setNextNumCollo(nextNumCollo);
|
||||
this.docsFetched = true;
|
||||
|
||||
onComplete.run();
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
@@ -139,24 +145,28 @@ public class DocInterniViewModel {
|
||||
}
|
||||
|
||||
private String getCodDtip() {
|
||||
if (this.dtbTipi.getValue() == null) {
|
||||
if (this.dtbTipi == null) {
|
||||
return null;
|
||||
}
|
||||
return this.dtbTipi.getValue().getCodDtip();
|
||||
return this.dtbTipi.getCodDtip();
|
||||
}
|
||||
|
||||
public TipoDocDTO getTipoDoc() {
|
||||
if (this.dtbTipi.getValue() == null) {
|
||||
return null;
|
||||
}
|
||||
return this.dtbTipi.getValue();
|
||||
return this.dtbTipi;
|
||||
}
|
||||
|
||||
private String getCodMgrp() {
|
||||
if (this.mtbGrup.getValue() == null) {
|
||||
if (this.mtbGrup == null) {
|
||||
return null;
|
||||
}
|
||||
return this.mtbGrup.getValue().getCodMgrp();
|
||||
return this.mtbGrup.getCodMgrp();
|
||||
}
|
||||
|
||||
private String getCodAnagForn() {
|
||||
if (this.fornitore == null) {
|
||||
return null;
|
||||
}
|
||||
return this.fornitore.getCodAnag();
|
||||
}
|
||||
|
||||
public void editDocument(SqlMtbColt document) {
|
||||
@@ -165,7 +175,7 @@ public class DocInterniViewModel {
|
||||
|
||||
public void newDocument() {
|
||||
SqlMtbColt document = new SqlMtbColt();
|
||||
if (this.dtbTipi.getValue() == null) {
|
||||
if (this.dtbTipi == null) {
|
||||
this.sendError(new NoDocTypeSelectedException());
|
||||
return;
|
||||
}
|
||||
@@ -173,18 +183,18 @@ public class DocInterniViewModel {
|
||||
document.setCodMgrp(this.getCodMgrp());
|
||||
document.setDataCollo(new Date());
|
||||
document.setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep());
|
||||
document.setAnnotazioni(this.note.getValue());
|
||||
document.setAnnotazioni(this.note);
|
||||
document.setSegno(-1);
|
||||
document.setSerCollo("/");
|
||||
document.setNumCollo(this.nextNumCollo);
|
||||
document.setGestione("L");
|
||||
document.setDataDoc(this.dataDoc.getValue());
|
||||
if (this.numDoc.getValue() != null) {
|
||||
document.setNumDoc(Integer.parseInt(this.numDoc.getValue()));
|
||||
document.setDataDoc(this.dataDoc);
|
||||
if (this.numDoc != null) {
|
||||
document.setNumDoc(Integer.parseInt(this.numDoc));
|
||||
}
|
||||
if (this.fornitore.getValue() != null) {
|
||||
document.setCodAnag(this.fornitore.getValue().getCodAnag());
|
||||
document.setCodVdes(this.fornitore.getValue().getCodVdes());
|
||||
if (this.fornitore != null) {
|
||||
document.setCodAnag(this.fornitore.getCodAnag());
|
||||
document.setCodVdes(this.fornitore.getCodVdes());
|
||||
}
|
||||
documentRepository.insert(document, id -> {
|
||||
document.setId(id);
|
||||
@@ -193,7 +203,7 @@ public class DocInterniViewModel {
|
||||
}
|
||||
|
||||
public boolean hasDocDetails() {
|
||||
return this.dtbTipi.getValue() != null;
|
||||
return this.dtbTipi != null;
|
||||
}
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
|
||||
@@ -90,17 +90,17 @@ public class DialogSelectDocInfoView extends BaseDialogFragment {
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
setCancelable(false);
|
||||
|
||||
mBindings = DialogSelectDocInfoViewBinding.inflate(LayoutInflater.from(this.mContext), null, false);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
mBindings.setView(this);
|
||||
|
||||
mViewModel.setFornitori(mDocInputData.getFornitori());
|
||||
|
||||
var cancelable = false;
|
||||
|
||||
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
|
||||
.setView(mBindings.getRoot())
|
||||
.setCancelable(cancelable)
|
||||
.setCancelable(isCancelable())
|
||||
.setPositiveButton(R.string.confirm, (dialog, which) -> {
|
||||
//Volutamente vuoto
|
||||
})
|
||||
@@ -110,7 +110,7 @@ public class DialogSelectDocInfoView extends BaseDialogFragment {
|
||||
.create();
|
||||
|
||||
alertDialog.setOnShowListener(this);
|
||||
alertDialog.setCanceledOnTouchOutside(cancelable);
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
alertDialog.setOnDismissListener(this);
|
||||
|
||||
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.dto;
|
||||
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
|
||||
public class DialogChooseRowFromListaDocRowsListModel {
|
||||
|
||||
private String codMart;
|
||||
private String descrizione;
|
||||
private String qtaOrdReadable;
|
||||
private String barcode;
|
||||
private boolean isNew;
|
||||
private SqlMtbColr originalModel;
|
||||
private BindableBoolean checked = new BindableBoolean(false);
|
||||
|
||||
public DialogChooseRowFromListaDocRowsListModel() {
|
||||
}
|
||||
|
||||
public BindableBoolean getChecked() {
|
||||
return checked;
|
||||
}
|
||||
|
||||
public DialogChooseRowFromListaDocRowsListModel setChecked(BindableBoolean checked) {
|
||||
this.checked = checked;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void toggleCheck() {
|
||||
this.checked.set(!this.checked.get());
|
||||
}
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public DialogChooseRowFromListaDocRowsListModel setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public DialogChooseRowFromListaDocRowsListModel setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getQtaOrdReadable() {
|
||||
return qtaOrdReadable;
|
||||
}
|
||||
|
||||
public DialogChooseRowFromListaDocRowsListModel setQtaOrdReadable(String qtaOrdReadable) {
|
||||
this.qtaOrdReadable = qtaOrdReadable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarcode() {
|
||||
return barcode;
|
||||
}
|
||||
|
||||
public DialogChooseRowFromListaDocRowsListModel setBarcode(String barcode) {
|
||||
this.barcode = barcode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isNew() {
|
||||
return isNew;
|
||||
}
|
||||
|
||||
public DialogChooseRowFromListaDocRowsListModel setNew(boolean aNew) {
|
||||
isNew = aNew;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SqlMtbColr getOriginalModel() {
|
||||
return originalModel;
|
||||
}
|
||||
|
||||
public DialogChooseRowFromListaDocRowsListModel setOriginalModel(SqlMtbColr originalModel) {
|
||||
this.originalModel = originalModel;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -41,13 +40,15 @@ import it.integry.integrywmsnative.core.rest.model.documento.DocumentoArtDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.databinding.ActivityContabDocInterniEditBinding;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipoDocDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsItemListModel;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsView;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.ui.DocumentRowsListAdapter;
|
||||
import it.integry.integrywmsnative.ui.FabMenuCustomAnimations;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalView;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||
import it.integry.integrywmsnative.view.dialogs.available_items.DialogAvailableItemListModel;
|
||||
import it.integry.integrywmsnative.view.dialogs.available_items.DialogAvailableItemsView;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleInputHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_arts.DialogChooseArtFromListaArtsView;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
|
||||
@@ -128,7 +129,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
if (document.getCodAnag() != null) {
|
||||
this.codAnag.set(document.getCodAnag() + (document.getCodVdes() != null ? " - " + document.getCodVdes() : ""));
|
||||
} else {
|
||||
this.binding.supplierLayout.setVisibility(View.GONE);
|
||||
this.codAnag.set(null);
|
||||
}
|
||||
|
||||
this.documentHeader.set(String.format(this.getString(R.string.doc_interni_doc_header), document.getId(), document.getCodDtipProvv()));
|
||||
@@ -136,7 +137,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
if (document.getNumDoc() != null && document.getDataDoc() != null) {
|
||||
this.documentRifHeader.set(String.format(this.getString(R.string.doc_testata), document.getNumDoc().toString(), UtilityDate.formatDate(document.getDataDoc(), UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN)));
|
||||
} else {
|
||||
this.binding.docRifLayout.setVisibility(View.GONE);
|
||||
this.documentRifHeader.set(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,7 +185,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
"Ricerca articolo",
|
||||
null,
|
||||
"Cod articolo / Barcode",
|
||||
barcodeProd -> this.viewModel.loadArticolo(barcodeProd, null), BarcodeManager::enable).show();
|
||||
barcodeProd -> this.viewModel.loadArticoloByCodMartOrBarcode(barcodeProd), BarcodeManager::enable).show();
|
||||
}
|
||||
|
||||
|
||||
@@ -230,7 +231,6 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
|
||||
@Override
|
||||
public void onEditRowRequest(SqlMtbColr row, boolean flagTracciabilita, boolean isUntMisDig) {
|
||||
this.onLoadingStarted();
|
||||
MtbAart mtbAart = new MtbAart();
|
||||
mtbAart.setBarCode(row.getCodBarre());
|
||||
mtbAart.setDiacod(row.getCodBarre());
|
||||
@@ -256,6 +256,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
.setSaveOnImeDone(true)
|
||||
.setPartitaMag(row.getPartitaMag())
|
||||
.setDataScad(row.getDataScad())
|
||||
.setCanInputZeroQuantity(true)
|
||||
.setCanOverflowOrderQuantity(false)
|
||||
.setCanLUBeClosed(false)
|
||||
.setNotesAllowed(true)
|
||||
@@ -278,7 +279,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
this.onLoadingStarted();
|
||||
this.viewModel.saveRow(row, resultDTO);
|
||||
})
|
||||
.setOnAbort(this::onLoadingEnded)
|
||||
.setOnAbort(() -> {})
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@@ -319,13 +320,22 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
|
||||
@Override
|
||||
public void onMultipleRowsFound(List<SqlMtbColr> rows, DocumentoArtDTO articolo) {
|
||||
DialogSelectDocRowsView.newInstance(rows, (row) -> {
|
||||
this.onLoadingEnded();
|
||||
if (row != null) {
|
||||
this.viewModel.dispatchRowEdit(row, articolo.isFlagTracciabilita(), articolo.isUntMisDigitale());
|
||||
}
|
||||
}
|
||||
).show(this.getSupportFragmentManager(), "dialogSelectDocRows");
|
||||
List<DialogSelectDocRowsItemListModel<Object>> dataset =
|
||||
Stream.of(rows)
|
||||
.map(x -> new DialogSelectDocRowsItemListModel<>()
|
||||
.setCodMart(x.getCodMart())
|
||||
.setBarcode(x.getCodBarre())
|
||||
.setOriginalModel(x)
|
||||
.setNew(x.getId() < 1)
|
||||
.setDescrizione(x.getDescrizione())
|
||||
.setQtaOrd(BigDecimal.valueOf(x.getQtaCol()))
|
||||
.setUntMisOrd(x.getUntMis()))
|
||||
.toList();
|
||||
|
||||
DialogSelectDocRowsView.newInstance(dataset, data -> {
|
||||
this.viewModel.dispatchRowEdit((SqlMtbColr) data.getOriginalModel(), articolo.isFlagTracciabilita(), articolo.isUntMisDigitale());
|
||||
}, () -> {})
|
||||
.show(this.getSupportFragmentManager(), "dialogSelectDocRowsNew");
|
||||
}
|
||||
|
||||
private MtbColr sqlToEntity(SqlMtbColr sqlMtbColr) {
|
||||
@@ -357,19 +367,24 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void showInfoArtDialog() {
|
||||
var listaMtbAart = Stream.of(this.viewModel.getProductsList())
|
||||
.map(x -> new MtbAart()
|
||||
.map(x -> new DialogAvailableItemListModel()
|
||||
.setCodMart(x.getCodMart())
|
||||
.setUntMis(x.getUntMis())
|
||||
.setDescrizione(x.getDescrizione())
|
||||
.setDescrizioneEstesa(x.getDescrizione())
|
||||
.setQtaCnf(x.getQtaCnf()))
|
||||
.setDescrizioneEstesa(x.getDescrizione()))
|
||||
.toList();
|
||||
|
||||
new DialogChooseArtFromListaArtsView(false, listaMtbAart, null)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
for (var documentRow : viewModel.getDocumentRows()) {
|
||||
var codMart = documentRow.getCodMart();
|
||||
|
||||
Stream.of(listaMtbAart)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(codMart))
|
||||
.forEach(x -> x.setAggiunto(true));
|
||||
}
|
||||
|
||||
|
||||
new DialogAvailableItemsView(listaMtbAart, null)
|
||||
.show(getSupportFragmentManager(), "DialogAvailableInventarioItemsView");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,13 +4,11 @@ import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -21,6 +19,7 @@ import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColrDataSource;
|
||||
import it.integry.integrywmsnative.core.data_store.db.repository.MtbColtRepository;
|
||||
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||
import it.integry.integrywmsnative.core.exception.NoResultFromCodMartException;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||
@@ -37,17 +36,17 @@ import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQua
|
||||
|
||||
public class DocInterniEditFormViewModel {
|
||||
|
||||
@Inject
|
||||
MtbColrDataSource mtbColrRepository;
|
||||
@Inject
|
||||
MtbColtRepository mtbColtRepository;
|
||||
private final MtbColrDataSource mtbColrRepository;
|
||||
private final MtbColtRepository mtbColtRepository;
|
||||
private final DocInterniRESTConsumer docInterniRESTConsumer;
|
||||
private DocInterniEditFormViewModel.Listener listener;
|
||||
private Listener listener;
|
||||
private List<DocumentoArtDTO> productsList;
|
||||
private HashMap<String, String> flattedBarcodesCodMarts;
|
||||
private TipoDocDTO tipoDoc;
|
||||
|
||||
private boolean isCheckPartitaMag = false;
|
||||
private JSONObject checkFornitoreRules = null;
|
||||
|
||||
|
||||
public MutableLiveData<SqlMtbColt> document = new MutableLiveData<>();
|
||||
public MutableLiveData<List<SqlMtbColr>> docRows = new MutableLiveData<>();
|
||||
|
||||
@@ -129,16 +128,29 @@ public class DocInterniEditFormViewModel {
|
||||
this.listener.onDocumentHoldRequest();
|
||||
}
|
||||
|
||||
public void loadArticolo(String barcodeProd, Ean128Model ean128Model) {
|
||||
public void loadArticoloByCodMartOrBarcode(String codMart) {
|
||||
var matchedArt = Stream.of(productsList)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(codMart) ||
|
||||
x.getBarcode().contains(codMart))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
|
||||
if (matchedArt == null) {
|
||||
this.sendError(new NoResultFromCodMartException(codMart));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
loadArticolo(matchedArt, null);
|
||||
}
|
||||
|
||||
public void loadArticoloByBarcode(String barcodeProd, Ean128Model ean128Model) {
|
||||
DocumentoArtDTO matchedArt;
|
||||
String usedBarcode = null;
|
||||
|
||||
String leftBarcode = StringUtils.leftPad(barcodeProd, 13, '0');
|
||||
|
||||
matchedArt = Stream.of(productsList)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(barcodeProd) ||
|
||||
leftBarcode.equalsIgnoreCase(x.getCodMart()) ||
|
||||
x.getBarcode().contains(barcodeProd))
|
||||
.filter(x -> x.getBarcode().contains(barcodeProd))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
@@ -151,15 +163,17 @@ public class DocInterniEditFormViewModel {
|
||||
return;
|
||||
}
|
||||
|
||||
List<SqlMtbColr> rows = this.getRowsForArticolo(matchedArt, usedBarcode);
|
||||
loadArticolo(matchedArt, usedBarcode);
|
||||
}
|
||||
|
||||
private void loadArticolo(DocumentoArtDTO documentoArtDTO, String usedBarcode) {
|
||||
List<SqlMtbColr> rows = this.getRowsForArticolo(documentoArtDTO, usedBarcode);
|
||||
|
||||
if (rows.size() > 1) {
|
||||
this.listener.onMultipleRowsFound(rows, matchedArt);
|
||||
this.listener.onMultipleRowsFound(rows, documentoArtDTO);
|
||||
} else {
|
||||
this.dispatchRowEdit(rows.get(0), matchedArt.isFlagTracciabilita(), matchedArt.isUntMisDigitale());
|
||||
this.dispatchRowEdit(rows.get(0), documentoArtDTO.isFlagTracciabilita(), documentoArtDTO.isUntMisDigitale());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private List<SqlMtbColr> getRowsForArticolo(DocumentoArtDTO articolo, String barcode) {
|
||||
@@ -245,20 +259,32 @@ public class DocInterniEditFormViewModel {
|
||||
|
||||
private void initCheckFornitore() {
|
||||
SqlMtbColt doc = this.document.getValue();
|
||||
|
||||
if (doc == null)
|
||||
return;
|
||||
|
||||
boolean isCheckPartitaMag = false;
|
||||
if (doc != null && this.checkFornitoreRules != null) {
|
||||
String key = doc.getCodAnag();
|
||||
if (doc.getCodVdes() != null && !doc.getCodVdes().isEmpty()) {
|
||||
key += "-" + doc.getCodVdes();
|
||||
}
|
||||
try {
|
||||
if (this.checkFornitoreRules.has(key) && ((String) ((JSONObject) this.checkFornitoreRules.get(key)).get(doc.getCodDtipProvv())).equalsIgnoreCase("check-partitaMag")) {
|
||||
|
||||
try {
|
||||
if (this.checkFornitoreRules != null && this.checkFornitoreRules.has("value")) {
|
||||
isCheckPartitaMag = this.checkFornitoreRules.getBoolean("value");
|
||||
} else if (this.checkFornitoreRules != null) {
|
||||
String key = doc.getCodAnag();
|
||||
if (doc.getCodVdes() != null && !doc.getCodVdes().isEmpty()) {
|
||||
key += "-" + doc.getCodVdes();
|
||||
}
|
||||
if (this.checkFornitoreRules.has(key) &&
|
||||
((String) ((JSONObject) this.checkFornitoreRules.get(key))
|
||||
.get(doc.getCodDtipProvv()))
|
||||
.equalsIgnoreCase("check-partitaMag")) {
|
||||
isCheckPartitaMag = true;
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
} catch (JSONException e) {
|
||||
this.sendError(e);
|
||||
}
|
||||
|
||||
|
||||
this.isCheckPartitaMag = isCheckPartitaMag;
|
||||
}
|
||||
|
||||
@@ -272,13 +298,6 @@ public class DocInterniEditFormViewModel {
|
||||
|
||||
public void setProductsList(List<DocumentoArtDTO> productsList) {
|
||||
this.productsList = productsList;
|
||||
this.flattedBarcodesCodMarts = new HashMap<>();
|
||||
|
||||
for (DocumentoArtDTO documentArt : productsList) {
|
||||
for (String barcode : documentArt.getBarcode()) {
|
||||
this.flattedBarcodesCodMarts.put(barcode, documentArt.getCodMart());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void processBarcode(BarcodeScanDTO dto) {
|
||||
@@ -291,7 +310,7 @@ public class DocInterniEditFormViewModel {
|
||||
this.executeEtichettaEanPeso(barcodeScanDTO);
|
||||
|
||||
} else {
|
||||
this.loadArticolo(barcodeScanDTO.getStringValue(), null);
|
||||
this.loadArticoloByBarcode(barcodeScanDTO.getStringValue(), null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -299,7 +318,7 @@ public class DocInterniEditFormViewModel {
|
||||
private void executeEtichettaEanPeso(BarcodeScanDTO barcodeScanDTO) {
|
||||
try {
|
||||
Ean13PesoModel ean13PesoModel = Ean13PesoModel.fromBarcode(barcodeScanDTO.getStringValue());
|
||||
this.loadArticolo(ean13PesoModel.getPrecode(), ean13PesoModel.toEan128());
|
||||
this.loadArticoloByBarcode(ean13PesoModel.getPrecode(), ean13PesoModel.toEan128());
|
||||
} catch (Exception ex) {
|
||||
this.sendError(ex);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,5 @@ public interface DialogSelectDocRowsComponent {
|
||||
DialogSelectDocRowsComponent create();
|
||||
}
|
||||
|
||||
|
||||
void inject(DialogSelectDocRowsView dialogSelectDocInfoView);
|
||||
|
||||
}
|
||||
void inject(DialogSelectDocRowsView dialogSelectDocRowsView);
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
|
||||
public class DialogSelectDocRowsItemListModel<T> {
|
||||
|
||||
private String codMart;
|
||||
private String descrizione;
|
||||
private BigDecimal qtaOrd;
|
||||
private String untMisOrd;
|
||||
private String barcode;
|
||||
private boolean isNew;
|
||||
private T originalModel;
|
||||
private BindableBoolean checked = new BindableBoolean(false);
|
||||
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public DialogSelectDocRowsItemListModel<T> setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public DialogSelectDocRowsItemListModel<T> setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getQtaOrd() {
|
||||
return qtaOrd;
|
||||
}
|
||||
|
||||
public DialogSelectDocRowsItemListModel<T> setQtaOrd(BigDecimal qtaOrd) {
|
||||
this.qtaOrd = qtaOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUntMisOrd() {
|
||||
return untMisOrd;
|
||||
}
|
||||
|
||||
public DialogSelectDocRowsItemListModel<T> setUntMisOrd(String untMisOrd) {
|
||||
this.untMisOrd = untMisOrd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBarcode() {
|
||||
return barcode;
|
||||
}
|
||||
|
||||
public DialogSelectDocRowsItemListModel<T> setBarcode(String barcode) {
|
||||
this.barcode = barcode;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isNew() {
|
||||
return isNew;
|
||||
}
|
||||
|
||||
public DialogSelectDocRowsItemListModel<T> setNew(boolean aNew) {
|
||||
isNew = aNew;
|
||||
return this;
|
||||
}
|
||||
|
||||
public T getOriginalModel() {
|
||||
return originalModel;
|
||||
}
|
||||
|
||||
public DialogSelectDocRowsItemListModel<T> setOriginalModel(T originalModel) {
|
||||
this.originalModel = originalModel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BindableBoolean getChecked() {
|
||||
return checked;
|
||||
}
|
||||
|
||||
public DialogSelectDocRowsItemListModel<T> setChecked(BindableBoolean checked) {
|
||||
this.checked = checked;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,14 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = DialogSelectDocRowsComponent.class)
|
||||
public class DialogSelectDocRowsModule {
|
||||
|
||||
@Provides
|
||||
DialogSelectDocRowsViewModel providesDialogSelectDocRowsNewViewModel() {
|
||||
return new DialogSelectDocRowsViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,143 +1,128 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows;
|
||||
|
||||
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 android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
import com.ravikoradiya.liveadapter.Type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColr;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.databinding.DialogChooseRowFromListaDocRowsLayoutBinding;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.dto.DialogChooseRowFromListaDocRowsListModel;
|
||||
import kotlin.Unit;
|
||||
import it.integry.integrywmsnative.databinding.DialogSelectDocRowsBinding;
|
||||
import it.integry.integrywmsnative.databinding.DialogSelectDocRowsItemModelBinding;
|
||||
|
||||
/**
|
||||
* @noinspection rawtypes
|
||||
*/
|
||||
public class DialogSelectDocRowsView extends BaseDialogFragment {
|
||||
|
||||
private final RunnableArgs<SqlMtbColr> onRowSelected;
|
||||
private final List<SqlMtbColr> listArts;
|
||||
private final MutableLiveData<List<DialogChooseRowFromListaDocRowsListModel>> listModels = new MutableLiveData<>();
|
||||
private DialogChooseRowFromListaDocRowsLayoutBinding binding;
|
||||
public MutableLiveData<SqlMtbColr> selectedRow = new MutableLiveData<>();
|
||||
|
||||
public static DialogSelectDocRowsView newInstance(
|
||||
List<SqlMtbColr> listArts,
|
||||
RunnableArgs<SqlMtbColr> onDismiss
|
||||
) {
|
||||
return new DialogSelectDocRowsView(listArts, onDismiss);
|
||||
@Inject
|
||||
DialogSelectDocRowsViewModel mViewModel;
|
||||
|
||||
private DialogSelectDocRowsBinding mBindings;
|
||||
private Context mContext;
|
||||
|
||||
private final List<DialogSelectDocRowsItemListModel<Object>> listArts;
|
||||
private final RunnableArgs<DialogSelectDocRowsItemListModel> onConfirm;
|
||||
private final Runnable onAbort;
|
||||
|
||||
//Pass here all external parameters
|
||||
public static DialogSelectDocRowsView newInstance(List<DialogSelectDocRowsItemListModel<Object>> listArts,
|
||||
RunnableArgs<DialogSelectDocRowsItemListModel> onConfirm,
|
||||
Runnable onAbort) {
|
||||
return new DialogSelectDocRowsView(listArts, onConfirm, onAbort);
|
||||
}
|
||||
|
||||
|
||||
private DialogSelectDocRowsView(List<SqlMtbColr> listArts, RunnableArgs<SqlMtbColr> onDismiss) {
|
||||
private DialogSelectDocRowsView(List<DialogSelectDocRowsItemListModel<Object>> listArts,
|
||||
RunnableArgs<DialogSelectDocRowsItemListModel> onConfirm,
|
||||
Runnable onAbort) {
|
||||
super();
|
||||
this.onRowSelected = onDismiss;
|
||||
|
||||
this.listArts = listArts;
|
||||
this.onConfirm = onConfirm;
|
||||
this.onAbort = onAbort;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
super.onDismiss(dialog);
|
||||
if (onRowSelected != null) onRowSelected.run(this.selectedRow.getValue());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@NonNull
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
binding = DataBindingUtil.inflate(inflater, R.layout.dialog_choose_row_from_lista_doc_rows_layout, container, false);
|
||||
binding.setLifecycleOwner(this);
|
||||
MainApplication
|
||||
.appComponent
|
||||
.dialogSelectDocRowsComponent()
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
this.mContext = requireContext();
|
||||
|
||||
mBindings = DialogSelectDocRowsBinding.inflate(LayoutInflater.from(this.mContext), null, false);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
|
||||
MainApplication.appComponent
|
||||
.dialogSelectDocRowsNewComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
binding.setView(this);
|
||||
|
||||
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
initView();
|
||||
this.refreshList();
|
||||
setCancelable(false);
|
||||
|
||||
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
|
||||
.setView(mBindings.getRoot())
|
||||
.setCancelable(isCancelable())
|
||||
.setPositiveButton(R.string.confirm, (dialog, which) -> {
|
||||
final DialogSelectDocRowsItemListModel<Object> selectedItem = Stream.of(listArts)
|
||||
.filter(x -> x.getChecked().get())
|
||||
.findFirstOrElse(null);
|
||||
if (selectedItem != null)
|
||||
this.onConfirm.run(selectedItem);
|
||||
})
|
||||
.setNegativeButton(R.string.abort, (dialog, which) -> {
|
||||
if (this.onAbort != null) this.onAbort.run();
|
||||
})
|
||||
.create();
|
||||
|
||||
binding.positiveButton.setOnClickListener(view -> {
|
||||
getDialog().dismiss();
|
||||
});
|
||||
|
||||
binding.negativeButton.setOnClickListener(view -> {
|
||||
this.selectedRow.setValue(null);
|
||||
getDialog().dismiss();
|
||||
});
|
||||
|
||||
|
||||
this.onLoadingEnded();
|
||||
return binding.getRoot();
|
||||
alertDialog.setCanceledOnTouchOutside(isCancelable());
|
||||
alertDialog.setOnShowListener(this);
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
private void refreshList() {
|
||||
var list = Stream.of(this.listArts).map(row -> {
|
||||
DialogChooseRowFromListaDocRowsListModel model = new DialogChooseRowFromListaDocRowsListModel();
|
||||
model.setCodMart(row.getCodMart());
|
||||
model.setBarcode(row.getCodMart());
|
||||
model.setOriginalModel(row);
|
||||
model.setNew(row.getId() < 1);
|
||||
model.setDescrizione(row.getDescrizione());
|
||||
model.setQtaOrdReadable(row.getQtaCol() + "\n" + row.getUntMis());
|
||||
model.getChecked().addOnPropertyChangedCallback(() -> {
|
||||
this.checkRow(row, model.getChecked().get());
|
||||
});
|
||||
return model;
|
||||
}).toList();
|
||||
this.listModels.postValue(list);
|
||||
@Override
|
||||
public void onShow(DialogInterface dialogInterface) {
|
||||
super.onShow(dialogInterface);
|
||||
|
||||
this.listArts.get(0).getChecked().set(true);
|
||||
this.initRecyclerView();
|
||||
}
|
||||
|
||||
private void checkRow(SqlMtbColr row, boolean checked) {
|
||||
if (checked) {
|
||||
this.selectedRow.setValue(row);
|
||||
var models = this.listModels.getValue();
|
||||
if (models != null && !models.isEmpty()) {
|
||||
Stream.of(models).filter(model -> model.getOriginalModel().getId() != row.getId()).forEach(model -> {
|
||||
model.getChecked().set(false);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
var selectedRow = this.selectedRow.getValue();
|
||||
if (selectedRow != null && selectedRow.getId() == row.getId()) {
|
||||
this.selectedRow.setValue(null);
|
||||
}
|
||||
private void initRecyclerView() {
|
||||
var itemType = new Type<DialogSelectDocRowsItemListModel, DialogSelectDocRowsItemModelBinding>(R.layout.dialog_select_doc_rows__item_model, BR.row);
|
||||
// itemType.areItemSame((oldItem, newItem) -> Objects.equals(oldItem.getId(), newItem.getId()));
|
||||
itemType.areContentsTheSame(DialogSelectDocRowsItemListModel::equals);
|
||||
itemType.onClick(x -> {
|
||||
resetChecks();
|
||||
x.getBinding().getRow().getChecked().set(true);
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
new LiveAdapter(listArts)
|
||||
.map(DialogSelectDocRowsItemListModel.class, itemType)
|
||||
.into(this.mBindings.itemList);
|
||||
}
|
||||
|
||||
private void resetChecks() {
|
||||
for (var item : listArts) {
|
||||
item.getChecked().set(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
initArrayAdapters();
|
||||
}
|
||||
|
||||
private void initArrayAdapters() {
|
||||
|
||||
new LiveAdapter(listModels, getViewLifecycleOwner(), BR.row)
|
||||
.map(DialogChooseRowFromListaDocRowsListModel.class, R.layout.dialog_choose_row_from_lista_doc_rows__item_model)
|
||||
.onNoData(noData -> {
|
||||
binding.emptyView.setVisibility(noData ? View.VISIBLE : View.GONE);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
).into(binding.listaDocRows);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows;
|
||||
|
||||
public class DialogSelectDocRowsViewModel {
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user