From ab14d6736c87d28c5170b57458e37f460d700217 Mon Sep 17 00:00:00 2001 From: GiuseppeS Date: Wed, 25 Jan 2023 17:11:25 +0100 Subject: [PATCH] Refactoring dei servizi utilizzati nelle gestioni di Lavorazione / Vendita. Fix su scansione articoli in Documenti Interni. --- app/build.gradle | 20 +- .../MainApplicationModule.java | 14 + ...ndita.java => OrdiniVenditaInterface.java} | 5 +- .../core/expansion/BaseActivity.java | 2 - .../integrywmsnative/core/model/MtbColt.java | 27 - .../ColliLavorazioneRESTConsumer.java | 158 ++++ .../ColliLavorazioneRESTConsumerService.java | 41 + .../consumers/ColliMagazzinoRESTConsumer.java | 2 +- .../ColliSpedizioneRESTConsumer.java | 154 ++++ .../ColliSpedizioneRESTConsumerService.java | 41 + .../rest/consumers/PrinterRESTConsumer.java | 33 +- .../rest/consumers/_BaseRESTConsumer.java | 5 +- .../ColliScaricoRESTConsumerInterface.java | 30 + .../model/uds/CanUDSBeDeletedRequestDTO.java | 18 + .../rest/model/uds/CloseUDSRequestDTO.java | 47 ++ .../rest/model/uds/CloseUDSResponseDTO.java | 24 + .../rest/model/uds/CreateUDSRequestDTO.java | 85 +++ .../model/uds/CreateUDSRequestOrderDTO.java | 49 ++ .../rest/model/uds/CreateUDSResponseDTO.java | 12 + .../rest/model/uds/DeleteUDSRequestDTO.java | 17 + .../model/uds/DeleteUDSRowRequestDTO.java | 17 + .../model/uds/InsertUDSRowRequestDTO.java | 92 +++ .../model/uds/InsertUDSRowResponseDTO.java | 12 + .../rest/model/uds/PrintUDSRequestDTO.java | 19 + .../rest/watcher/ServerStatusChecker.java | 12 +- .../core/utility/UtilityServer.java | 2 +- .../gest/main/MainFragment.java | 4 +- .../PVOrdineAcquistoEditActivity.java | 16 +- .../PVOrdineAcquistoEditViewModel.java | 39 +- .../gest/spedizione/SpedizioneActivity.java | 6 +- .../gest/spedizione/SpedizioneModule.java | 24 +- .../gest/spedizione/SpedizioneViewModel.java | 711 ++++++++++-------- .../bottom_sheet__inventario_actions_view.xml | 2 +- barcode_base_android_library/build.gradle | 8 +- build.gradle | 8 +- dynamic__base/build.gradle | 2 +- .../extensions/OrdiniVendita.java | 10 +- dynamic_vgalimenti/build.gradle | 2 +- .../extensions/OrdiniVendita.java | 19 +- gradle.properties | 2 +- honeywellscannerlibrary/build.gradle | 8 +- keyobardemulatorscannerlibrary/build.gradle | 6 +- pointmobilescannerlibrary/build.gradle | 8 +- zebrascannerlibrary/build.gradle | 8 +- 44 files changed, 1383 insertions(+), 438 deletions(-) rename app/src/main/java/it/integry/integrywmsnative/core/class_router/interfaces/{IOrdiniVendita.java => OrdiniVenditaInterface.java} (77%) create mode 100644 app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliLavorazioneRESTConsumer.java create mode 100644 app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliLavorazioneRESTConsumerService.java create mode 100644 app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliSpedizioneRESTConsumer.java create mode 100644 app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliSpedizioneRESTConsumerService.java create mode 100644 app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/interfaces/ColliScaricoRESTConsumerInterface.java create mode 100644 app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CanUDSBeDeletedRequestDTO.java create mode 100644 app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CloseUDSRequestDTO.java create mode 100644 app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CloseUDSResponseDTO.java create mode 100644 app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CreateUDSRequestDTO.java create mode 100644 app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CreateUDSRequestOrderDTO.java create mode 100644 app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CreateUDSResponseDTO.java create mode 100644 app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/DeleteUDSRequestDTO.java create mode 100644 app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/DeleteUDSRowRequestDTO.java create mode 100644 app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/InsertUDSRowRequestDTO.java create mode 100644 app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/InsertUDSRowResponseDTO.java create mode 100644 app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/PrintUDSRequestDTO.java diff --git a/app/build.gradle b/app/build.gradle index 1593df0a..927c8b1b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services' android { - def appVersionCode = 325 - def appVersionName = '1.30.07' + def appVersionCode = 326 + def appVersionName = '1.30.08' signingConfigs { release { @@ -31,12 +31,12 @@ android { } } - compileSdkVersion 32 + compileSdkVersion 33 defaultConfig { applicationId "it.integry.integrywmsnative" minSdkVersion 21 - targetSdkVersion 32 + targetSdkVersion 33 versionCode appVersionCode versionName appVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -66,7 +66,7 @@ android { compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 - coreLibraryDesugaringEnabled true + //coreLibraryDesugaringEnabled true } productFlavors { @@ -115,9 +115,9 @@ dependencies { implementation 'com.google.android.gms:play-services-basement:18.1.0' - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'com.google.android.material:material:1.6.1' + implementation 'com.google.android.material:material:1.8.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.2.1' @@ -156,12 +156,12 @@ dependencies { implementation 'com.github.pedromassango:doubleClick:3.0' //SQLite ROOM - def room_version = "2.4.3" + def room_version = "2.5.0" implementation "androidx.room:room-runtime:$room_version" annotationProcessor "androidx.room:room-compiler:$room_version" implementation "androidx.room:room-rxjava3:$room_version" - androidTestImplementation "androidx.room:room-testing:2.4.3" + androidTestImplementation "androidx.room:room-testing:2.5.0" //AppUpdate implementation 'com.github.javiersantos:AppUpdater:2.7' @@ -189,8 +189,6 @@ dependencies { implementation 'io.reactivex.rxjava2:rxjava:2.1.12' implementation 'io.reactivex.rxjava2:rxandroid:2.0.2' - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.0' - } repositories { diff --git a/app/src/main/java/it/integry/integrywmsnative/MainApplicationModule.java b/app/src/main/java/it/integry/integrywmsnative/MainApplicationModule.java index e46802cd..bdeff355 100644 --- a/app/src/main/java/it/integry/integrywmsnative/MainApplicationModule.java +++ b/app/src/main/java/it/integry/integrywmsnative/MainApplicationModule.java @@ -22,7 +22,9 @@ 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.ColliLavorazioneRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer; +import it.integry.integrywmsnative.core.rest.consumers.ColliSpedizioneRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.CommessaRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.DocumentiRESTConsumer; @@ -254,4 +256,16 @@ public class MainApplicationModule { return new DocumentiRESTConsumer(); } + @Provides + @Singleton + ColliSpedizioneRESTConsumer provideColliSpedizioneRESTConsumer() { + return new ColliSpedizioneRESTConsumer(); + } + + @Provides + @Singleton + ColliLavorazioneRESTConsumer provideColliLavorazioneRESTConsumer() { + return new ColliLavorazioneRESTConsumer(); + } + } diff --git a/app/src/main/java/it/integry/integrywmsnative/core/class_router/interfaces/IOrdiniVendita.java b/app/src/main/java/it/integry/integrywmsnative/core/class_router/interfaces/OrdiniVenditaInterface.java similarity index 77% rename from app/src/main/java/it/integry/integrywmsnative/core/class_router/interfaces/IOrdiniVendita.java rename to app/src/main/java/it/integry/integrywmsnative/core/class_router/interfaces/OrdiniVenditaInterface.java index a25ccc38..092cdb80 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/class_router/interfaces/IOrdiniVendita.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/class_router/interfaces/OrdiniVenditaInterface.java @@ -6,8 +6,11 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs; import it.integry.integrywmsnative.core.model.MtbColt; import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO; -public interface IOrdiniVendita { +public interface OrdiniVenditaInterface { + boolean isTrasfOrder(List testateOrdini); + + @Deprecated void distribuisciCollo(MtbColt mtbColt, List testateOrdini, RunnableArgs> onComplete, RunnableArgs onFailed); } diff --git a/app/src/main/java/it/integry/integrywmsnative/core/expansion/BaseActivity.java b/app/src/main/java/it/integry/integrywmsnative/core/expansion/BaseActivity.java index 85e6c7cd..994992b2 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/expansion/BaseActivity.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/expansion/BaseActivity.java @@ -37,14 +37,12 @@ public class BaseActivity extends AppCompatActivity { public void onLoadingEnded() { this.closeProgress(); - BarcodeManager.enable(); } public void onError(Exception ex) { this.runOnUiThread(() -> { this.closeProgress(); UtilityExceptions.defaultException(this, ex); - BarcodeManager.enable(); }); } diff --git a/app/src/main/java/it/integry/integrywmsnative/core/model/MtbColt.java b/app/src/main/java/it/integry/integrywmsnative/core/model/MtbColt.java index e06b7a5c..ded07f62 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/model/MtbColt.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/model/MtbColt.java @@ -600,33 +600,6 @@ public class MtbColt extends EntityBase { } } - /*if (filtroOrdineDtos != null && filtroOrdineDtos.size() > 0) { - - for (int i = 0; i < filtroOrdineDtos.size(); i++) { - FiltroOrdineDTO x = filtroOrdineDtos.get(i); - - try { - whereCond.append("("); - whereCond.append(String.format("d.g = %s AND d.d = %s and d.n = %s", - UtilityDB.valueToString(x.getGestioneOrd()), - UtilityDB.valueToString(UtilityDate.formatDate(x.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH)), - UtilityDB.valueToString(x.getNumOrd()))); - - if (!UtilityString.isNullOrEmpty(x.getDataConsS())) { - whereCond.append(String.format(" AND dr.dc = %s", - UtilityDB.valueToString(UtilityDate.formatDate(x.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH)))); - } - - whereCond.append(")"); - if (i < filtroOrdineDtos.size() - 1) { - whereCond.append(" OR "); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - }*/ whereCond = TextUtils.join(" OR ", conditions); this.filtroOrdini = xmlPrefix + whereCond + xmlSuffix; diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliLavorazioneRESTConsumer.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliLavorazioneRESTConsumer.java new file mode 100644 index 00000000..fe0669c8 --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliLavorazioneRESTConsumer.java @@ -0,0 +1,158 @@ +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.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.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 void createUDS(CreateUDSRequestDTO createUDSRequestDTO, RunnableArgs onComplete, RunnableArgs onFailed) { + ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class); + + colliLavorazioneRESTConsumerService.createUDS(createUDSRequestDTO) + .enqueue(new Callback<>() { + @Override + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "lavorazione/createUDS", data -> onComplete.run(data.getMtbColt()), onFailed); + } + + @Override + public void onFailure(Call> call, Throwable t) { + onFailed.run(new Exception(t)); + } + }); + + } + + @Override + public void closeUDS(CloseUDSRequestDTO closeUDSRequestDTO, RunnableArgs onComplete, RunnableArgs onFailed) { + ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class); + + colliLavorazioneRESTConsumerService.closeUDS(closeUDSRequestDTO) + .enqueue(new Callback<>() { + @Override + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "lavorazione/closeUDS", onComplete, onFailed); + } + + @Override + public void onFailure(Call> call, Throwable t) { + onFailed.run(new Exception(t)); + } + }); + } + + @Override + public void canUDSBeDeleted(CanUDSBeDeletedRequestDTO canUDSBeDeletedRequestDTO, RunnableArgs onComplete, RunnableArgs onFailed) { + ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class); + + colliLavorazioneRESTConsumerService.canUDSBeDeleted(canUDSBeDeletedRequestDTO) + .enqueue(new Callback<>() { + @Override + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "lavorazione/canUDSBeDeleted", onComplete, onFailed); + } + + @Override + public void onFailure(Call> call, Throwable t) { + onFailed.run(new Exception(t)); + } + }); + + } + + @Override + public void deleteUDS(DeleteUDSRequestDTO deleteUDSRequestDTO, Runnable onComplete, RunnableArgs onFailed) { + ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class); + + colliLavorazioneRESTConsumerService.deleteUDS(deleteUDSRequestDTO) + .enqueue(new Callback<>() { + @Override + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "lavorazione/deleteUDS", Void -> onComplete.run(), onFailed); + } + + @Override + public void onFailure(Call> call, Throwable t) { + onFailed.run(new Exception(t)); + } + }); + + } + + @Override + public void printUDS(PrintUDSRequestDTO printUDSRequestDTO, Runnable onComplete, RunnableArgs onFailed) { + ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class); + + colliLavorazioneRESTConsumerService.printUDS(printUDSRequestDTO) + .enqueue(new Callback<>() { + @Override + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "lavorazione/printUDS", Void -> onComplete.run(), onFailed); + } + + @Override + public void onFailure(Call> call, Throwable t) { + onFailed.run(new Exception(t)); + } + }); + + } + + @Override + public void insertUDSRow(InsertUDSRowRequestDTO insertUDSRowRequestDTO, RunnableArgs onComplete, RunnableArgs onFailed) { + ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class); + + colliLavorazioneRESTConsumerService.insertUDSRow(insertUDSRowRequestDTO) + .enqueue(new Callback<>() { + @Override + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "lavorazione/insertUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed); + } + + @Override + public void onFailure(Call> call, Throwable t) { + onFailed.run(new Exception(t)); + } + }); + } + + @Override + public void deleteUDSRow(DeleteUDSRowRequestDTO deleteUDSRowRequestDTO, Runnable onComplete, RunnableArgs onFailed) { + ColliLavorazioneRESTConsumerService colliLavorazioneRESTConsumerService = RESTBuilder.getService(ColliLavorazioneRESTConsumerService.class); + + colliLavorazioneRESTConsumerService.deleteUDSRow(deleteUDSRowRequestDTO) + .enqueue(new Callback<>() { + @Override + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "lavorazione/deleteUDSRow", data -> onComplete.run(), onFailed); + } + + @Override + public void onFailure(Call> call, Throwable t) { + onFailed.run(new Exception(t)); + } + }); + } + +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliLavorazioneRESTConsumerService.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliLavorazioneRESTConsumerService.java new file mode 100644 index 00000000..da8e7908 --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliLavorazioneRESTConsumerService.java @@ -0,0 +1,41 @@ +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.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/createUDS") + Call> createUDS(@Body CreateUDSRequestDTO createUDSRequestDTO); + + @POST("wms/lavorazione/closeUDS") + Call> closeUDS(@Body CloseUDSRequestDTO createUDSRequestDTO); + + @POST("wms/lavorazione/canUDSBeDeleted") + Call> canUDSBeDeleted(@Body CanUDSBeDeletedRequestDTO canUDSBeDeletedRequestDTO); + + @POST("wms/lavorazione/deleteUDS") + Call> deleteUDS(@Body DeleteUDSRequestDTO deleteUDSRequestDTO); + + @POST("wms/lavorazione/printUDS") + Call> printUDS(@Body PrintUDSRequestDTO printUDSRequestDTO); + + @POST("wms/lavorazione/insertUDSRow") + Call> insertUDSRow(@Body InsertUDSRowRequestDTO insertUDSRowRequestDTO); + + @POST("wms/lavorazione/deleteUDSRow") + Call> deleteUDSRow(@Body DeleteUDSRowRequestDTO deleteUDSRowRequestDTO); + +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumer.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumer.java index 58421651..8a245f2e 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumer.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumer.java @@ -292,7 +292,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer { ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class); colliMagazzinoRESTConsumerService.distribuisciCollo(distribuzioneColloDTO) - .enqueue(new Callback>() { + .enqueue(new Callback<>() { @Override public void onResponse(Call> call, Response> response) { analyzeAnswerList(response, "DistribuzioneCollo", obj -> { diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliSpedizioneRESTConsumer.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliSpedizioneRESTConsumer.java new file mode 100644 index 00000000..06408a31 --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliSpedizioneRESTConsumer.java @@ -0,0 +1,154 @@ +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.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.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 ColliSpedizioneRESTConsumer extends _BaseRESTConsumer implements ColliScaricoRESTConsumerInterface { + + + public void createUDS(CreateUDSRequestDTO createUDSRequestDTO, RunnableArgs onComplete, RunnableArgs onFailed) { + ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class); + + colliSpedizioneRESTConsumerService.createUDS(createUDSRequestDTO) + .enqueue(new Callback<>() { + @Override + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "spedizione/createUDS", data -> onComplete.run(data.getMtbColt()), onFailed); + } + + @Override + public void onFailure(Call> call, Throwable t) { + onFailed.run(new Exception(t)); + } + }); + + } + + public void closeUDS(CloseUDSRequestDTO closeUDSRequestDTO, RunnableArgs onComplete, RunnableArgs onFailed) { + ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class); + + colliSpedizioneRESTConsumerService.closeUDS(closeUDSRequestDTO) + .enqueue(new Callback<>() { + @Override + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "spedizione/closeUDS", onComplete, onFailed); + } + + @Override + public void onFailure(Call> call, Throwable t) { + onFailed.run(new Exception(t)); + } + }); + + } + + public void canUDSBeDeleted(CanUDSBeDeletedRequestDTO canUDSBeDeletedRequestDTO, RunnableArgs onComplete, RunnableArgs onFailed) { + ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class); + + colliSpedizioneRESTConsumerService.canUDSBeDeleted(canUDSBeDeletedRequestDTO) + .enqueue(new Callback<>() { + @Override + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "spedizione/canUDSBeDeleted", onComplete, onFailed); + } + + @Override + public void onFailure(Call> call, Throwable t) { + onFailed.run(new Exception(t)); + } + }); + + } + + public void deleteUDS(DeleteUDSRequestDTO deleteUDSRequestDTO, Runnable onComplete, RunnableArgs onFailed) { + ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class); + + colliSpedizioneRESTConsumerService.deleteUDS(deleteUDSRequestDTO) + .enqueue(new Callback<>() { + @Override + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "spedizione/deleteUDS", Void -> onComplete.run(), onFailed); + } + + @Override + public void onFailure(Call> call, Throwable t) { + onFailed.run(new Exception(t)); + } + }); + + } + + public void printUDS(PrintUDSRequestDTO printUDSRequestDTO, Runnable onComplete, RunnableArgs onFailed) { + ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class); + + colliSpedizioneRESTConsumerService.printUDS(printUDSRequestDTO) + .enqueue(new Callback<>() { + @Override + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "spedizione/printUDS", Void -> onComplete.run(), onFailed); + } + + @Override + public void onFailure(Call> call, Throwable t) { + onFailed.run(new Exception(t)); + } + }); + + } + + public void insertUDSRow(InsertUDSRowRequestDTO insertUDSRowRequestDTO, RunnableArgs onComplete, RunnableArgs onFailed) { + ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class); + + colliSpedizioneRESTConsumerService.insertUDSRow(insertUDSRowRequestDTO) + .enqueue(new Callback<>() { + @Override + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "spedizione/insertUDSRow", data -> onComplete.run(data.getSavedMtbColr()), onFailed); + } + + @Override + public void onFailure(Call> call, Throwable t) { + onFailed.run(new Exception(t)); + } + }); + } + + public void deleteUDSRow(DeleteUDSRowRequestDTO deleteUDSRowRequestDTO, Runnable onComplete, RunnableArgs onFailed) { + ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class); + + colliSpedizioneRESTConsumerService.deleteUDSRow(deleteUDSRowRequestDTO) + .enqueue(new Callback<>() { + @Override + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "spedizione/deleteUDSRow", data -> onComplete.run(), onFailed); + } + + @Override + public void onFailure(Call> call, Throwable t) { + onFailed.run(new Exception(t)); + } + }); + + } + +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliSpedizioneRESTConsumerService.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliSpedizioneRESTConsumerService.java new file mode 100644 index 00000000..b324a596 --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliSpedizioneRESTConsumerService.java @@ -0,0 +1,41 @@ +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.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 ColliSpedizioneRESTConsumerService { + + @POST("wms/spedizione/createUDS") + Call> createUDS(@Body CreateUDSRequestDTO createUDSRequestDTO); + + @POST("wms/spedizione/closeUDS") + Call> closeUDS(@Body CloseUDSRequestDTO createUDSRequestDTO); + + @POST("wms/spedizione/canUDSBeDeleted") + Call> canUDSBeDeleted(@Body CanUDSBeDeletedRequestDTO canUDSBeDeletedRequestDTO); + + @POST("wms/spedizione/deleteUDS") + Call> deleteUDS(@Body DeleteUDSRequestDTO deleteUDSRequestDTO); + + @POST("wms/spedizione/printUDS") + Call> printUDS(@Body PrintUDSRequestDTO printUDSRequestDTO); + + @POST("wms/spedizione/insertUDSRow") + Call> insertUDSRow(@Body InsertUDSRowRequestDTO insertUDSRowRequestDTO); + + @POST("wms/spedizione/deleteUDSRow") + Call> deleteUDSRow(@Body DeleteUDSRowRequestDTO deleteUDSRowRequestDTO); + +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/PrinterRESTConsumer.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/PrinterRESTConsumer.java index 6207acb6..dcb88f14 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/PrinterRESTConsumer.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/PrinterRESTConsumer.java @@ -66,24 +66,23 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer { } PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class); - Call> callable = null; - callable = printerService.printCollo(testataColloToPrint); + printerService + .printCollo(testataColloToPrint) + .enqueue(new Callback<>() { + @Override + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "printCollo", data -> { + onComplete.run(); + }, onFailed); + } - callable.enqueue(new Callback<>() { - @Override - public void onResponse(Call> call, Response> response) { - analyzeAnswer(response, "printCollo", data -> { - onComplete.run(); - }, onFailed); - } - - @Override - public void onFailure(Call> call, Throwable t) { - if (t.getMessage().contains("Printer not found")) { - onFailed.run(new NoPrintersFoundException()); - } else onFailed.run(new Exception(t)); - } - }); + @Override + public void onFailure(Call> call, Throwable t) { + if (t.getMessage().contains("Printer not found")) { + onFailed.run(new NoPrintersFoundException()); + } else onFailed.run(new Exception(t)); + } + }); } diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/_BaseRESTConsumer.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/_BaseRESTConsumer.java index 6dda06d8..eace9e55 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/_BaseRESTConsumer.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/_BaseRESTConsumer.java @@ -30,8 +30,9 @@ public abstract class _BaseRESTConsumer { onComplete.run(dataObj); } } else { - Log.e(logTitle, response.body().getErrorMessage()); - onFailed.run(CommonRESTException.tryRecognizeException(response.body().getErrorMessage())); + String errorMessage = UtilityString.isNull(response.body().getErrorMessage(), "Empty message"); + Log.e(logTitle, errorMessage); + onFailed.run(CommonRESTException.tryRecognizeException(errorMessage)); } } else { Log.e(logTitle, response.message()); diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/interfaces/ColliScaricoRESTConsumerInterface.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/interfaces/ColliScaricoRESTConsumerInterface.java new file mode 100644 index 00000000..c9be7035 --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/interfaces/ColliScaricoRESTConsumerInterface.java @@ -0,0 +1,30 @@ +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.InsertUDSRowRequestDTO; +import it.integry.integrywmsnative.core.rest.model.uds.PrintUDSRequestDTO; + +public interface ColliScaricoRESTConsumerInterface { + + void createUDS(CreateUDSRequestDTO createUDSRequestDTO, RunnableArgs onComplete, RunnableArgs onFailed); + + void closeUDS(CloseUDSRequestDTO closeUDSRequestDTO, RunnableArgs onComplete, RunnableArgs onFailed); + + void canUDSBeDeleted(CanUDSBeDeletedRequestDTO canUDSBeDeletedRequestDTO, RunnableArgs onComplete, RunnableArgs onFailed); + + void deleteUDS(DeleteUDSRequestDTO deleteUDSRequestDTO, Runnable onComplete, RunnableArgs onFailed); + + void printUDS(PrintUDSRequestDTO printUDSRequestDTO, Runnable onComplete, RunnableArgs onFailed); + + void insertUDSRow(InsertUDSRowRequestDTO insertUDSRowRequestDTO, RunnableArgs onComplete, RunnableArgs onFailed); + + void deleteUDSRow(DeleteUDSRowRequestDTO deleteUDSRequestDTO, Runnable onComplete, RunnableArgs onFailed); +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CanUDSBeDeletedRequestDTO.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CanUDSBeDeletedRequestDTO.java new file mode 100644 index 00000000..46df1d51 --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CanUDSBeDeletedRequestDTO.java @@ -0,0 +1,18 @@ +package it.integry.integrywmsnative.core.rest.model.uds; + +import it.integry.integrywmsnative.core.model.MtbColt; + +public class CanUDSBeDeletedRequestDTO { + + + private MtbColt mtbColt; + + public MtbColt getMtbColt() { + return mtbColt; + } + + public CanUDSBeDeletedRequestDTO setMtbColt(MtbColt mtbColt) { + this.mtbColt = mtbColt; + return this; + } +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CloseUDSRequestDTO.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CloseUDSRequestDTO.java new file mode 100644 index 00000000..e88cbc5e --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CloseUDSRequestDTO.java @@ -0,0 +1,47 @@ +package it.integry.integrywmsnative.core.rest.model.uds; + +import it.integry.integrywmsnative.core.model.MtbColt; + +public class CloseUDSRequestDTO { + + private boolean printSSCC; + private boolean enableTransferLogic; + private String orderCodMdep; + private MtbColt mtbColt; + + public boolean isPrintSSCC() { + return printSSCC; + } + + public CloseUDSRequestDTO setPrintSSCC(boolean printSSCC) { + this.printSSCC = printSSCC; + return this; + } + + public boolean isEnableTransferLogic() { + return enableTransferLogic; + } + + public CloseUDSRequestDTO setEnableTransferLogic(boolean enableTransferLogic) { + this.enableTransferLogic = enableTransferLogic; + return this; + } + + public String getOrderCodMdep() { + return orderCodMdep; + } + + public CloseUDSRequestDTO setOrderCodMdep(String orderCodMdep) { + this.orderCodMdep = orderCodMdep; + return this; + } + + public MtbColt getMtbColt() { + return mtbColt; + } + + public CloseUDSRequestDTO setMtbColt(MtbColt mtbColt) { + this.mtbColt = mtbColt; + return this; + } +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CloseUDSResponseDTO.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CloseUDSResponseDTO.java new file mode 100644 index 00000000..d24f43f7 --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CloseUDSResponseDTO.java @@ -0,0 +1,24 @@ +package it.integry.integrywmsnative.core.rest.model.uds; + +import java.util.List; + +import it.integry.integrywmsnative.core.model.MtbColt; + +public class CloseUDSResponseDTO { + private boolean saved; + private boolean deleted; + + private List generatedMtbColts; + + public boolean isSaved() { + return saved; + } + + public boolean isDeleted() { + return deleted; + } + + public List getGeneratedMtbColts() { + return generatedMtbColts; + } +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CreateUDSRequestDTO.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CreateUDSRequestDTO.java new file mode 100644 index 00000000..d53a312e --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CreateUDSRequestDTO.java @@ -0,0 +1,85 @@ +package it.integry.integrywmsnative.core.rest.model.uds; + +import java.util.List; + +public class CreateUDSRequestDTO { + + private String codMdep; + private int segno; + private String ragSoc; + private Integer numCollo; + private String serCollo; + private int causaleCollo; + + private List orders; + + public String getCodMdep() { + return codMdep; + } + + public CreateUDSRequestDTO setCodMdep(String codMdep) { + this.codMdep = codMdep; + return this; + } + + public int getSegno() { + return segno; + } + + public CreateUDSRequestDTO setSegno(int segno) { + this.segno = segno; + return this; + } + + public String getRagSoc() { + return ragSoc; + } + + public CreateUDSRequestDTO setRagSoc(String ragSoc) { + this.ragSoc = ragSoc; + return this; + } + + public Integer getNumCollo() { + return numCollo; + } + + public CreateUDSRequestDTO setNumCollo(Integer numCollo) { + this.numCollo = numCollo; + return this; + } + + public String getSerCollo() { + return serCollo; + } + + public CreateUDSRequestDTO setSerCollo(String serCollo) { + this.serCollo = serCollo; + return this; + } + + public int getCausaleCollo() { + return causaleCollo; + } + + public CreateUDSRequestDTO setCausaleCollo(int causaleCollo) { + this.causaleCollo = causaleCollo; + return this; + } + + public List getOrders() { + return orders; + } + + public CreateUDSRequestDTO setOrders(List orders) { + this.orders = orders; + return this; + } + + + + public static class Causale { + public static final int SCARICO = 0; + public static final int POSIZIONAMENTO = 1; + } +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CreateUDSRequestOrderDTO.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CreateUDSRequestOrderDTO.java new file mode 100644 index 00000000..ba3dd5de --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CreateUDSRequestOrderDTO.java @@ -0,0 +1,49 @@ +package it.integry.integrywmsnative.core.rest.model.uds; + +import java.time.LocalDate; + +public class CreateUDSRequestOrderDTO { + + + private String gestione; + private LocalDate dataOrd; + private LocalDate dataCons; + private int numOrd; + + + public String getGestione() { + return gestione; + } + + public CreateUDSRequestOrderDTO setGestione(String gestione) { + this.gestione = gestione; + return this; + } + + public LocalDate getDataOrd() { + return dataOrd; + } + + public CreateUDSRequestOrderDTO setDataOrd(LocalDate dataOrd) { + this.dataOrd = dataOrd; + return this; + } + + public LocalDate getDataCons() { + return dataCons; + } + + public CreateUDSRequestOrderDTO setDataCons(LocalDate dataCons) { + this.dataCons = dataCons; + return this; + } + + public int getNumOrd() { + return numOrd; + } + + public CreateUDSRequestOrderDTO setNumOrd(int numOrd) { + this.numOrd = numOrd; + return this; + } +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CreateUDSResponseDTO.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CreateUDSResponseDTO.java new file mode 100644 index 00000000..f0d59cbf --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/CreateUDSResponseDTO.java @@ -0,0 +1,12 @@ +package it.integry.integrywmsnative.core.rest.model.uds; + +import it.integry.integrywmsnative.core.model.MtbColt; + +public class CreateUDSResponseDTO { + + private MtbColt mtbColt; + + public MtbColt getMtbColt() { + return mtbColt; + } +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/DeleteUDSRequestDTO.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/DeleteUDSRequestDTO.java new file mode 100644 index 00000000..b82ddbe3 --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/DeleteUDSRequestDTO.java @@ -0,0 +1,17 @@ +package it.integry.integrywmsnative.core.rest.model.uds; + +import it.integry.integrywmsnative.core.model.MtbColt; + +public class DeleteUDSRequestDTO { + + private MtbColt mtbColt; + + public MtbColt getMtbColt() { + return mtbColt; + } + + public DeleteUDSRequestDTO setMtbColt(MtbColt mtbColt) { + this.mtbColt = mtbColt; + return this; + } +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/DeleteUDSRowRequestDTO.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/DeleteUDSRowRequestDTO.java new file mode 100644 index 00000000..e9a4d5e4 --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/DeleteUDSRowRequestDTO.java @@ -0,0 +1,17 @@ +package it.integry.integrywmsnative.core.rest.model.uds; + +import it.integry.integrywmsnative.core.model.MtbColr; + +public class DeleteUDSRowRequestDTO { + + private MtbColr mtbColrToDelete; + + public MtbColr getMtbColrToDelete() { + return mtbColrToDelete; + } + + public DeleteUDSRowRequestDTO setMtbColrToDelete(MtbColr mtbColrToDelete) { + this.mtbColrToDelete = mtbColrToDelete; + return this; + } +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/InsertUDSRowRequestDTO.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/InsertUDSRowRequestDTO.java new file mode 100644 index 00000000..4e704c4d --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/InsertUDSRowRequestDTO.java @@ -0,0 +1,92 @@ +package it.integry.integrywmsnative.core.rest.model.uds; + +import java.math.BigDecimal; +import java.time.LocalDate; + +import it.integry.integrywmsnative.core.model.MtbColr; +import it.integry.integrywmsnative.core.model.MtbColt; + +public class InsertUDSRowRequestDTO { + + private MtbColr sourceMtbColr; + private MtbColt targetMtbColt; + + private String codMart; + private BigDecimal qtaTot; + private BigDecimal qtaCnf; + private BigDecimal numCnf; + private String partitaMag; + private LocalDate dataScad; + + public MtbColr getSourceMtbColr() { + return sourceMtbColr; + } + + public InsertUDSRowRequestDTO setSourceMtbColr(MtbColr sourceMtbColr) { + this.sourceMtbColr = sourceMtbColr; + return this; + } + + public MtbColt getTargetMtbColt() { + return targetMtbColt; + } + + public InsertUDSRowRequestDTO setTargetMtbColt(MtbColt targetMtbColt) { + this.targetMtbColt = targetMtbColt; + return this; + } + + public String getCodMart() { + return codMart; + } + + public InsertUDSRowRequestDTO setCodMart(String codMart) { + this.codMart = codMart; + return this; + } + + public BigDecimal getQtaTot() { + return qtaTot; + } + + public InsertUDSRowRequestDTO setQtaTot(BigDecimal qtaTot) { + this.qtaTot = qtaTot; + return this; + } + + public BigDecimal getQtaCnf() { + return qtaCnf; + } + + public InsertUDSRowRequestDTO setQtaCnf(BigDecimal qtaCnf) { + this.qtaCnf = qtaCnf; + return this; + } + + public BigDecimal getNumCnf() { + return numCnf; + } + + public InsertUDSRowRequestDTO setNumCnf(BigDecimal numCnf) { + this.numCnf = numCnf; + return this; + } + + public String getPartitaMag() { + return partitaMag; + } + + public InsertUDSRowRequestDTO setPartitaMag(String partitaMag) { + this.partitaMag = partitaMag; + return this; + } + + public LocalDate getDataScad() { + return dataScad; + } + + public InsertUDSRowRequestDTO setDataScad(LocalDate dataScad) { + this.dataScad = dataScad; + return this; + } +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/InsertUDSRowResponseDTO.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/InsertUDSRowResponseDTO.java new file mode 100644 index 00000000..891759f6 --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/InsertUDSRowResponseDTO.java @@ -0,0 +1,12 @@ +package it.integry.integrywmsnative.core.rest.model.uds; + +import it.integry.integrywmsnative.core.model.MtbColr; + +public class InsertUDSRowResponseDTO { + + private MtbColr savedMtbColr; + + public MtbColr getSavedMtbColr() { + return savedMtbColr; + } +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/PrintUDSRequestDTO.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/PrintUDSRequestDTO.java new file mode 100644 index 00000000..c541259c --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/uds/PrintUDSRequestDTO.java @@ -0,0 +1,19 @@ +package it.integry.integrywmsnative.core.rest.model.uds; + +import java.util.List; + +import it.integry.integrywmsnative.core.model.MtbColt; + +public class PrintUDSRequestDTO { + + private List mtbColts; + + public List getMtbColts() { + return mtbColts; + } + + public PrintUDSRequestDTO setMtbColts(List mtbColts) { + this.mtbColts = mtbColts; + return this; + } +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/watcher/ServerStatusChecker.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/watcher/ServerStatusChecker.java index 3d0e2921..aa7a5e85 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/rest/watcher/ServerStatusChecker.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/watcher/ServerStatusChecker.java @@ -12,12 +12,12 @@ import it.integry.integrywmsnative.core.utility.UtilityString; public class ServerStatusChecker { - private static ServerStatusChecker instance = new ServerStatusChecker(); + private static final ServerStatusChecker instance = new ServerStatusChecker(); - private List> mCallback = new ArrayList<>(); + private final List> mCallback = new ArrayList<>(); - private RunnableArgs mInternalCallback = value -> { - for (RunnableArgs callback : mCallback) { + private final RunnableArgs mInternalCallback = value -> { + for (RunnableArgs callback : mCallback) { callback.run(value); } }; @@ -26,8 +26,8 @@ public class ServerStatusChecker { private final long MILLIS_DELAY = 5 * 1000; - private Handler handler = new Handler(); - private Runnable runnableCode = new Runnable() { + private final Handler handler = new Handler(); + private final Runnable runnableCode = new Runnable() { @Override public void run() { if (shouldExecute && !UtilityString.isNullOrEmpty(SettingsManager.i().getServer().getHost())) { diff --git a/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityServer.java b/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityServer.java index a661959a..3ffe676b 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityServer.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityServer.java @@ -43,7 +43,7 @@ public class UtilityServer { OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() - .url(String.format("http://%s:%d/ems-api/retail/status", serverAddress, serverTCPport)) + .url(String.format("http://%s:%d/ems-api/system/ok", serverAddress, serverTCPport)) .build(); try { diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/main/MainFragment.java b/app/src/main/java/it/integry/integrywmsnative/gest/main/MainFragment.java index eefe275b..030fd92b 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/main/MainFragment.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/main/MainFragment.java @@ -30,7 +30,7 @@ import it.integry.integrywmsnative.R; import it.integry.integrywmsnative.core.class_router.ClassRouter; import it.integry.integrywmsnative.core.class_router.configs.BaseMenuConfiguration; import it.integry.integrywmsnative.core.class_router.configs.MenuConfiguration; -import it.integry.integrywmsnative.core.class_router.interfaces.IOrdiniVendita; +import it.integry.integrywmsnative.core.class_router.interfaces.OrdiniVenditaInterface; import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverDTO; import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService; import it.integry.integrywmsnative.core.expansion.RunnableArgs; @@ -196,7 +196,7 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab if (recoveredMtbColt != null && (recoveredMtbColt.getGestioneEnum() == GestioneEnum.VENDITA || recoveredMtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && !UtilityString.isNullOrEmpty(recoveredMtbColt.getFiltroOrdini())) { - IOrdiniVendita ordiniVendita = ClassRouter.getInstance(ClassRouter.PATH.ORDINI_VENDITA); + OrdiniVenditaInterface ordiniVendita = ClassRouter.getInstance(ClassRouter.PATH.ORDINI_VENDITA); this.colliMagazzinoRESTConsumer.updateDataFine(recoveredMtbColt, () -> { ordiniVendita.distribuisciCollo(recoveredMtbColt, recoveredMtbColtDto.getTestateOrdini(), diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/pv_ordine_acquisto_edit/PVOrdineAcquistoEditActivity.java b/app/src/main/java/it/integry/integrywmsnative/gest/pv_ordine_acquisto_edit/PVOrdineAcquistoEditActivity.java index 434e8db0..c2b93767 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/pv_ordine_acquisto_edit/PVOrdineAcquistoEditActivity.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/pv_ordine_acquisto_edit/PVOrdineAcquistoEditActivity.java @@ -187,12 +187,10 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity implements PVOrdi public void onItemDispatched(ArticoloOrdine articoloOrdine, Runnable onSuccess) { DialogEditArticoloView .newInstance(articoloOrdine, articolo -> { - runOnUiThread(() -> { - if (articolo != null) { - Toast.makeText(this, "Articolo aggiunto all'ordine!", Toast.LENGTH_SHORT).show(); - } - this.mViewModel.refreshListArticoli(onSuccess); - }); + if (articolo != null) { + Toast.makeText(this, "Articolo aggiunto all'ordine!", Toast.LENGTH_SHORT).show(); + } + this.mViewModel.refreshListArticoli(onSuccess); }, null).show(this.getSupportFragmentManager(), "DialogEditArticoloView"); } @@ -203,10 +201,8 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity implements PVOrdi public void exportOrdine() { this.mViewModel.exportOrdine(() -> { - runOnUiThread(() -> { - Toast.makeText(this, "Ordine salvato con successo", Toast.LENGTH_SHORT).show(); - close(); - }); + Toast.makeText(this, "Ordine salvato con successo", Toast.LENGTH_SHORT).show(); + close(); }); } diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/pv_ordine_acquisto_edit/PVOrdineAcquistoEditViewModel.java b/app/src/main/java/it/integry/integrywmsnative/gest/pv_ordine_acquisto_edit/PVOrdineAcquistoEditViewModel.java index 1252a41d..f83182fa 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/pv_ordine_acquisto_edit/PVOrdineAcquistoEditViewModel.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/pv_ordine_acquisto_edit/PVOrdineAcquistoEditViewModel.java @@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; import javax.inject.Inject; @@ -123,23 +124,21 @@ public class PVOrdineAcquistoEditViewModel { public void processBarcode(String barcode) { try { - BarcodeManager.disable(); this.sendOnLoadingStarted(); + ArticoloDTO articoloDTO = getArticoloFromBarcode(barcode); if (articoloDTO == null) { throw new NoResultFromBarcodeException(barcode); } this.addArticoloToOrdine( articoloDTO, - BarcodeManager::enable, - e -> { - this.sendError(e); - BarcodeManager.enable(); - } + this::sendOnLoadingEnded, + this::sendError ); } catch (Exception e) { this.sendError(e); BarcodeManager.enable(); + } finally { } } @@ -154,26 +153,18 @@ public class PVOrdineAcquistoEditViewModel { public void addArticoloToOrdine(ArticoloDTO art, Runnable onSuccess, RunnableArgs onFail) { try { - mArticoliOrdineRepository.findArticoloByScanAndOrdine(mCurrentOrdine, art.codMart, (articolo) -> { - this.sendOnLoadingEnded(); - if (articolo != null) { - if (isAutoOrderOnScan()) { - articolo.setQtaOrd(articolo.getQtaOrd() + articolo.getQtaCnf()); - mArticoliOrdineRepository.saveArticoloToOrdine(articolo, () -> this.refreshListArticoli(onSuccess), onFail); - } else { - this.sendOnItemDispatched(articolo, onSuccess); - } + mArticoliOrdineRepository.findArticoloByScanAndOrdine(mCurrentOrdine, art.codMart, foundArt -> { + var articolo = foundArt != null ? foundArt : art.convertToArticoloOrdine(mCurrentOrdine); + if (isAutoOrderOnScan()) { + articolo.setQtaOrd(articolo.getQtaOrd() + articolo.getQtaCnf()); + mArticoliOrdineRepository.saveArticoloToOrdine(articolo, () -> this.refreshListArticoli(onSuccess), onFail); } else { - articolo = art.convertToArticoloOrdine(mCurrentOrdine); - if (isAutoOrderOnScan()) { - articolo.setQtaOrd(articolo.getQtaCnf()); - mArticoliOrdineRepository.saveArticoloToOrdine(articolo, () -> this.refreshListArticoli(onSuccess), onFail); - } else { - this.sendOnItemDispatched(articolo, onSuccess); - } + this.sendOnItemDispatched(articolo, onSuccess); } + + }, onFail); @@ -200,7 +191,9 @@ public class PVOrdineAcquistoEditViewModel { } private List getNewArticoli() { - return Stream.of(mArticoliGriglia).filter(x -> x.getQtaOrd() > 0f).toList(); + return mArticoliGriglia.stream() + .filter(x -> x.getQtaOrd() > 0f) + .collect(Collectors.toList()); } public void orderNewProducts() { diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneActivity.java b/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneActivity.java index 61868227..bc4bdac2 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneActivity.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneActivity.java @@ -248,7 +248,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo } else if (!noLUPresent.get()) { this.mShouldCloseActivity = true; BarcodeManager.removeCallback(barcodeScannerIstanceID); - this.mViewmodel.closeLU(true); + this.mViewmodel.requestCloseLU(true); } else { BarcodeManager.removeCallback(barcodeScannerIstanceID); super.onBackPressed(); @@ -948,7 +948,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo @Override public void onBottomSheetLUClose() { - this.mViewmodel.closeLU(true); + this.mViewmodel.requestCloseLU(true); } @Override @@ -958,7 +958,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo @Override public void onMtbColrDelete(MtbColr mtbColr) { - this.mViewmodel.deleteRow(mtbColr); + this.mViewmodel.requestDeleteRow(mtbColr); } diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneModule.java b/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneModule.java index 307a815c..de304ead 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneModule.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneModule.java @@ -5,7 +5,9 @@ import dagger.Provides; import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService; import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer; +import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer; +import it.integry.integrywmsnative.core.rest.consumers.ColliSpedizioneRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.DocumentiRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer; @@ -21,8 +23,26 @@ public class SpedizioneModule { } @Provides - SpedizioneViewModel providesSpedizioneViewModel(ArticoloRESTConsumer articoloRESTConsumer, ColliDataRecoverService colliDataRecoverService, OrdiniRESTConsumer ordiniRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, PrinterRESTConsumer printerRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, PosizioniRESTConsumer posizioniRESTConsumer, DocumentiRESTConsumer documentiRESTConsumer) { - return new SpedizioneViewModel(articoloRESTConsumer, barcodeRESTConsumer, colliDataRecoverService, ordiniRESTConsumer, colliMagazzinoRESTConsumer, printerRESTConsumer, posizioniRESTConsumer, documentiRESTConsumer); + SpedizioneViewModel providesSpedizioneViewModel(ArticoloRESTConsumer articoloRESTConsumer, + ColliDataRecoverService colliDataRecoverService, + OrdiniRESTConsumer ordiniRESTConsumer, + ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, + PrinterRESTConsumer printerRESTConsumer, + BarcodeRESTConsumer barcodeRESTConsumer, + PosizioniRESTConsumer posizioniRESTConsumer, + DocumentiRESTConsumer documentiRESTConsumer, + ColliSpedizioneRESTConsumer colliSpedizioneRESTConsumer, + ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer) { + return new SpedizioneViewModel(articoloRESTConsumer, + barcodeRESTConsumer, + colliDataRecoverService, + ordiniRESTConsumer, + colliMagazzinoRESTConsumer, + printerRESTConsumer, + posizioniRESTConsumer, + documentiRESTConsumer, + colliSpedizioneRESTConsumer, + colliLavorazioneRESTConsumer); } } diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java b/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java index 912b8e41..30228ed2 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java @@ -6,6 +6,7 @@ import androidx.lifecycle.MutableLiveData; import com.annimon.stream.Optional; import com.annimon.stream.Stream; +import org.apache.commons.lang3.NotImplementedException; import org.jetbrains.annotations.NotNull; import java.math.BigDecimal; @@ -15,13 +16,14 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; import javax.inject.Inject; import it.integry.barcode_base_android_library.model.BarcodeScanDTO; import it.integry.integrywmsnative.core.CommonConst; import it.integry.integrywmsnative.core.class_router.ClassRouter; -import it.integry.integrywmsnative.core.class_router.interfaces.IOrdiniVendita; +import it.integry.integrywmsnative.core.class_router.interfaces.OrdiniVenditaInterface; import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService; import it.integry.integrywmsnative.core.exception.EmptyLUException; import it.integry.integrywmsnative.core.exception.InvalidLUException; @@ -51,16 +53,27 @@ import it.integry.integrywmsnative.core.model.secondary.GestioneEnum; import it.integry.integrywmsnative.core.report.ReportType; import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer; +import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer; +import it.integry.integrywmsnative.core.rest.consumers.ColliSpedizioneRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.DocumentiRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.OrdiniRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer; import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer; +import it.integry.integrywmsnative.core.rest.consumers.interfaces.ColliScaricoRESTConsumerInterface; import it.integry.integrywmsnative.core.rest.model.Ean128Model; import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel; import it.integry.integrywmsnative.core.rest.model.LoadColliDTO; import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO; import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO; +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.CreateUDSRequestDTO; +import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestOrderDTO; +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.InsertUDSRowRequestDTO; +import it.integry.integrywmsnative.core.rest.model.uds.PrintUDSRequestDTO; import it.integry.integrywmsnative.core.settings.SettingsManager; import it.integry.integrywmsnative.core.utility.UtilityBarcode; import it.integry.integrywmsnative.core.utility.UtilityBigDecimal; @@ -88,12 +101,6 @@ public class SpedizioneViewModel { private int mDefaultSegnoCol = -1; private String mDefaultCodMdep = null; private final List mDefaultFiltroOrdine = new ArrayList<>(); - private String mDefaultCodAnagOfUL = null; - private String mDefaultRagSocOfUL = null; - private String mDefaultRifOrdOfUL = null; - private Integer mDefaultNumOrdOfUL = null; - private Date mDefaultDataOrdOfUL = null; - private String mDefaultCodJFasOfUL = null; private Integer mDefaultCausaleOfUL = null; private boolean mEnableGiacenza; @@ -116,9 +123,13 @@ public class SpedizioneViewModel { private final PrinterRESTConsumer mPrinterRESTConsumer; private final PosizioniRESTConsumer mPosizioneRESTConsumer; private final DocumentiRESTConsumer mDocumentiRESTConsumer; + private final ColliSpedizioneRESTConsumer mColliSpedizioneRESTConsumer; + private final ColliLavorazioneRESTConsumer mColliLavorazioneRESTConsumer; + + private ColliScaricoRESTConsumerInterface mColliScaricoRESTConsumer; @Inject - public SpedizioneViewModel(ArticoloRESTConsumer articoloRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, ColliDataRecoverService colliDataRecoverService, OrdiniRESTConsumer ordiniRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, PrinterRESTConsumer printerRESTConsumer, PosizioniRESTConsumer posizioniRESTConsumer, DocumentiRESTConsumer documentiRESTConsumer) { + public SpedizioneViewModel(ArticoloRESTConsumer articoloRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, ColliDataRecoverService colliDataRecoverService, OrdiniRESTConsumer ordiniRESTConsumer, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, PrinterRESTConsumer printerRESTConsumer, PosizioniRESTConsumer posizioniRESTConsumer, DocumentiRESTConsumer documentiRESTConsumer, ColliSpedizioneRESTConsumer colliSpedizioneRESTConsumer, ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer) { this.mArticoloRESTConsumer = articoloRESTConsumer; this.mBarcodeRESTConsumer = barcodeRESTConsumer; this.mColliDataRecoverService = colliDataRecoverService; @@ -127,6 +138,8 @@ public class SpedizioneViewModel { this.mPrinterRESTConsumer = printerRESTConsumer; this.mPosizioneRESTConsumer = posizioniRESTConsumer; this.mDocumentiRESTConsumer = documentiRESTConsumer; + this.mColliSpedizioneRESTConsumer = colliSpedizioneRESTConsumer; + this.mColliLavorazioneRESTConsumer = colliLavorazioneRESTConsumer; } @@ -143,6 +156,7 @@ public class SpedizioneViewModel { this.mDefaultCausaleOfUL = defaultCausaleUL; this.mEnableQuantityReset = enableQuantityReset; this.mUseQtaOrd = useQtaOrd; + if (testateOrdini != null) { this.mIsOrdTrasf = Stream.of(testateOrdini).map(OrdineUscitaInevasoDTO::isOrdTrasf).withoutNulls().distinctBy(x -> x).findFirst().get(); } @@ -203,59 +217,31 @@ public class SpedizioneViewModel { } } + //Definizione del filtro ordine da applicare a tutti i colli generati - Stream.of(mTestateOrdini).forEach(x -> { - FiltroOrdineDTO filtro = new FiltroOrdineDTO().setDataOrd(x.getDataOrdD()).setNumOrd(x.getNumOrd()).setGestioneOrd(x.getGestione()).setDataCons(x.getDataConsD()); + mTestateOrdini + .forEach(x -> { + var filtro = new FiltroOrdineDTO() + .setDataOrd(x.getDataOrdD()) + .setNumOrd(x.getNumOrd()) + .setGestioneOrd(x.getGestione()) + .setDataCons(x.getDataConsD()); - if (!mDefaultFiltroOrdine.contains(filtro)) mDefaultFiltroOrdine.add(filtro); - }); + if (!mDefaultFiltroOrdine.contains(filtro)) + mDefaultFiltroOrdine.add(filtro); + }); - //Definizione del codAnag - List foundCodAnag = Stream.of(mTestateOrdini).map(OrdineUscitaInevasoDTO::getCodAnagOrd).distinctBy(x -> x).toList(); + if (mDefaultGestioneOfUL == GestioneEnum.VENDITA) { + mColliScaricoRESTConsumer = mColliSpedizioneRESTConsumer; - if (foundCodAnag != null && foundCodAnag.size() == 1) { - mDefaultCodAnagOfUL = foundCodAnag.get(0); - } + } else if (mDefaultGestioneOfUL == GestioneEnum.LAVORAZIONE && mDefaultSegnoCol == -1) { + mColliScaricoRESTConsumer = mColliLavorazioneRESTConsumer; - - //Definizione del codAnag - List foundRagSoc = Stream.of(mTestateOrdini).map(OrdineUscitaInevasoDTO::getRagSocOrd).distinctBy(x -> x).toList(); - - if (foundRagSoc != null && foundRagSoc.size() == 1) { - mDefaultRagSocOfUL = foundRagSoc.get(0); - } - - - //Definizione del rifOrd - List foundRifOrd = Stream.of(mTestateOrdini).map(OrdineUscitaInevasoDTO::getRifOrd).distinctBy(x -> x).toList(); - - if (foundRifOrd != null && foundRifOrd.size() == 1) { - mDefaultRifOrdOfUL = foundRifOrd.get(0); - } - - - //Definizione del numOrd - List foundNumOrd = Stream.of(mTestateOrdini).map(OrdineUscitaInevasoDTO::getNumOrd).withoutNulls().distinctBy(x -> x).toList(); - - if (foundNumOrd != null && foundNumOrd.size() == 1) { - mDefaultNumOrdOfUL = foundNumOrd.get(0); - } - - - //Definizione del dataOrd - List foundDataOrd = Stream.of(mTestateOrdini).map(OrdineUscitaInevasoDTO::getDataOrdD).withoutNulls().distinctBy(x -> x).toList(); - - if (foundDataOrd != null && foundDataOrd.size() == 1) { - mDefaultDataOrdOfUL = foundDataOrd.get(0); - } - - - //Definizione del codJfas - List foundCodJfas = Stream.of(mTestateOrdini).map(OrdineUscitaInevasoDTO::getCodJfas).distinctBy(x -> x).toList(); - - if (foundCodJfas != null && foundCodJfas.size() == 1) { - mDefaultCodJFasOfUL = foundCodJfas.get(0); + } else if (mDefaultGestioneOfUL == GestioneEnum.LAVORAZIONE && mDefaultSegnoCol == +1) { + mColliScaricoRESTConsumer = mColliLavorazioneRESTConsumer; + } else { + this.sendError(new NotImplementedException(String.format("Gestione %s e segno %d non gestito", mDefaultGestioneOfUL.getText(), mDefaultSegnoCol))); } } @@ -282,7 +268,6 @@ public class SpedizioneViewModel { if (this.mListener != null) mListener.onCreateDocsRequest(); } - private void sendOnOrderClosed() { if (this.mListener != null) mListener.onOrderClosed(); } @@ -1126,98 +1111,128 @@ public class SpedizioneViewModel { } public void createNewLU(Integer customNumCollo, String customSerCollo, Runnable onComplete) { - MtbColt mtbColt = new MtbColt(); - mtbColt.initDefaultFields(mDefaultGestioneOfUL).setSegno(mDefaultSegnoCol).setRifOrd(mDefaultRifOrdOfUL).setNumOrd(mDefaultNumOrdOfUL).setDataOrdD(mDefaultDataOrdOfUL).setCodAnag(mDefaultCodAnagOfUL).setCodMdep(mDefaultCodMdep).setRagSocCliente(mDefaultRagSocOfUL).setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE); + final List orders = this.mTestateOrdini.stream() + .map(x -> new CreateUDSRequestOrderDTO() + .setDataCons(UtilityDate.toLocalDate(x.getDataConsD())) + .setDataOrd(UtilityDate.toLocalDate(x.getDataOrdD())) + .setGestione(x.getGestione()) + .setNumOrd(x.getNumOrd())) + .collect(Collectors.toList()); - if (mDefaultGestioneOfUL == GestioneEnum.LAVORAZIONE && mDefaultSegnoCol == -1) - mtbColt.setPosizione(mDefaultCodJFasOfUL); - if (customNumCollo != null) mtbColt.setNumCollo(customNumCollo); - if (!UtilityString.isNullOrEmpty(customSerCollo)) mtbColt.setSerCollo(customSerCollo); + final CreateUDSRequestDTO createUDSRequestDTO = new CreateUDSRequestDTO() + .setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep()) + .setSegno(mDefaultSegnoCol) + .setNumCollo(customNumCollo) + .setSerCollo(customSerCollo) + .setOrders(orders); - mtbColt.generaFiltroOrdineFromDTO(mDefaultFiltroOrdine); - - mColliMagazzinoRESTConsumer.saveCollo(mtbColt, value -> { - mtbColt.setNumCollo(value.getNumCollo()).setDataCollo(value.getDataColloS()).setMtbColr(new ObservableArrayList<>()); - - this.mCurrentMtbColt = mtbColt; - mMtbColtSessionID = this.mColliDataRecoverService.startNewSession(mtbColt, mTestateOrdini); + this.mColliScaricoRESTConsumer.createUDS(createUDSRequestDTO, createdUDS -> { + this.mCurrentMtbColt = createdUDS; + mMtbColtSessionID = this.mColliDataRecoverService.startNewSession(createdUDS, mTestateOrdini); this.mIsNewLU = true; if (onComplete != null) onComplete.run(); - this.sendLUOpened(mtbColt); + this.sendLUOpened(createdUDS); }, this::sendError); - } public void saveNewRow(PickingObjectDTO pickingObjectDTO, MtbColt refMtbColt, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) { this.sendOnLoadingStarted(); - final MtbColr mtbColr = new MtbColr().setCausale(mDefaultCausaleOfUL).setCodMart(pickingObjectDTO.getMtbAart().getCodMart()).setPartitaMag(partitaMag).setDataScadPartita(dataScad).setQtaCol(qtaTot).setQtaCnf(qtaCnf).setNumCnf(numCnf).setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa()).setDatetimeRow(UtilityDate.getDateInstance()); + +// final MtbColr mtbColr = new MtbColr() +// .setCausale(mDefaultCausaleOfUL) +// .setCodMart(pickingObjectDTO.getMtbAart().getCodMart()) +// .setPartitaMag(partitaMag) +// .setDataScadPartita(dataScad) +// .setQtaCol(qtaTot) +// .setQtaCnf(qtaCnf) +// .setNumCnf(numCnf) +// .setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa()) +// .setDatetimeRow(UtilityDate.getDateInstance()); //TODO: Al posto di prelevare la prima riga bisognerebbe controllare se c'è ne una che corrisponde con la partita richiesta - final MtbColr mtbColrToDispatch = pickingObjectDTO.getTempPickData() != null && pickingObjectDTO.getTempPickData().getSourceMtbColt() != null && pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr() != null && pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr().size() > 0 ? pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr().get(0) : null; - - if (mtbColrToDispatch != null) { - if (UtilityString.isNullOrEmpty(mCurrentMtbColt.getCodTcol())) - mCurrentMtbColt.setCodTcol(UtilityString.empty2null(pickingObjectDTO.getTempPickData().getSourceMtbColt().getCodTcol())); - - mtbColr.setCodJcom(UtilityString.empty2null(mtbColrToDispatch.getCodJcom())).setSerColloRif(UtilityString.empty2null(mtbColrToDispatch.getSerCollo())).setNumColloRif(mtbColrToDispatch.getNumCollo()).setGestioneRif(UtilityString.empty2null(mtbColrToDispatch.getGestione())).setDataColloRif(UtilityString.empty2null(mtbColrToDispatch.getDataColloS())); + final MtbColr mtbColrToDispatch = pickingObjectDTO.getTempPickData() != null && + pickingObjectDTO.getTempPickData().getSourceMtbColt() != null && + pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr() != null && + pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr().size() > 0 ? + pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr().get(0) : null; - if (mtbColrToDispatch.getPesoNettoKg() != null) { - //Proporzione - BigDecimal pesoNettoKg = UtilityBigDecimal.divide(UtilityBigDecimal.multiply(qtaTot, mtbColrToDispatch.getPesoNettoKg()), mtbColrToDispatch.getQtaCol()); - mtbColr.setPesoNettoKg(pesoNettoKg); - } - - if (mtbColrToDispatch.getPesoLordoKg() != null) { - //Proporzione - BigDecimal pesoLordoKg = UtilityBigDecimal.divide(UtilityBigDecimal.multiply(qtaTot, mtbColrToDispatch.getPesoLordoKg()), mtbColrToDispatch.getQtaCol()); - mtbColr.setPesoLordoKg(pesoLordoKg); - } +// if (mtbColrToDispatch != null) { +// if (UtilityString.isNullOrEmpty(mCurrentMtbColt.getCodTcol())) +// mCurrentMtbColt.setCodTcol(UtilityString.empty2null(pickingObjectDTO.getTempPickData().getSourceMtbColt().getCodTcol())); +// +// mtbColr.setCodJcom(UtilityString.empty2null(mtbColrToDispatch.getCodJcom())) +// .setSerColloRif(UtilityString.empty2null(mtbColrToDispatch.getSerCollo())) +// .setNumColloRif(mtbColrToDispatch.getNumCollo()) +// .setGestioneRif(UtilityString.empty2null(mtbColrToDispatch.getGestione())) +// .setDataColloRif(UtilityString.empty2null(mtbColrToDispatch.getDataColloS())); +// +// +// if (mtbColrToDispatch.getPesoNettoKg() != null) { +// //Proporzione +// BigDecimal pesoNettoKg = UtilityBigDecimal.divide(UtilityBigDecimal.multiply(qtaTot, mtbColrToDispatch.getPesoNettoKg()), mtbColrToDispatch.getQtaCol()); +// mtbColr.setPesoNettoKg(pesoNettoKg); +// } +// +// if (mtbColrToDispatch.getPesoLordoKg() != null) { +// //Proporzione +// BigDecimal pesoLordoKg = UtilityBigDecimal.divide(UtilityBigDecimal.multiply(qtaTot, mtbColrToDispatch.getPesoLordoKg()), mtbColrToDispatch.getQtaCol()); +// mtbColr.setPesoLordoKg(pesoLordoKg); +// } +// } +// +// mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE); +// +// MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone(); +// cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE); +// +// cloneMtbColt.setMtbColr(new ObservableArrayList<>()); +// cloneMtbColt.getMtbColr().add((MtbColr) mtbColr.clone()); - } else if (mEnableGiacenza && pickingObjectDTO.getMtbColts() != null && pickingObjectDTO.getMtbColts().size() > 0) { - // Vecchia logica di aggancio UL (se non ho sparato una etichetta UL comunque ti aggangio la prima UL suggerita) -// mtbColr -// .setCodJcom(UtilityString.empty2null(item.getCodJcom())) -// .setSerColloRif(UtilityString.empty2null(item.getSerCollo())) -// .setNumColloRif(item.getNumCollo()) -// .setGestioneRif(UtilityString.empty2null(item.getGestione())) -// .setDataColloRif(UtilityString.empty2null(item.getDataColloS())); - } - - mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE); - - MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone(); - cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE); - - cloneMtbColt.setMtbColr(new ObservableArrayList<>()); - cloneMtbColt.getMtbColr().add((MtbColr) mtbColr.clone()); - - boolean shouldPrint = true; + boolean shouldPrint = !shouldCloseLU || mCurrentMtbColt.getMtbColr().size() != 0; //Se è l'unico articolo del collo (controllo se è uguale a 0 perché ancora non è stato aggiunto nella lista delle righe) - if (shouldCloseLU && mCurrentMtbColt.getMtbColr().size() == 0) { - shouldPrint = false; - } - if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) { resetMatchedRows(); this.sendOnLoadingEnded(); - if (shouldCloseLU) closeLU(shouldPrint); + if (shouldCloseLU) requestCloseLU(shouldPrint); return; } - boolean finalShouldPrint = shouldPrint; - mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> { - 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()); + + var insertUDSRowRequestDto = new InsertUDSRowRequestDTO() + .setSourceMtbColr(mtbColrToDispatch) + .setCodMart(pickingObjectDTO.getMtbAart().getCodMart()) + .setQtaTot(qtaTot) + .setQtaCnf(qtaCnf) + .setNumCnf(numCnf) + .setPartitaMag(partitaMag) + .setTargetMtbColt(mCurrentMtbColt); + + if(dataScad != null) + insertUDSRowRequestDto + .setDataScad(UtilityDate.toLocalDate(dataScad)); + + this.mColliScaricoRESTConsumer.insertUDSRow(insertUDSRowRequestDto, createdMtbColr -> { + pickingObjectDTO.getWithdrawMtbColrs().add(createdMtbColr); + this.mCurrentMtbColt.getMtbColr().add(createdMtbColr); + + createdMtbColr + .setUntMis(pickingObjectDTO.getMtbAart().getUntMis()) + .setMtbAart(pickingObjectDTO.getMtbAart()); if (mEnableGiacenza) { - MtbColr refMtbColr = new MtbColr().setCodMart(mtbColr.getCodMart()).setPartitaMag(mtbColr.getPartitaMag()).setCodTagl(mtbColr.getCodTagl()).setCodCol(mtbColr.getCodCol()); + MtbColr refMtbColr = new MtbColr() + .setCodMart(createdMtbColr.getCodMart()) + .setPartitaMag(createdMtbColr.getPartitaMag()) + .setCodTagl(createdMtbColr.getCodTagl()) + .setCodCol(createdMtbColr.getCodCol()); if (refMtbColt != null) { @@ -1227,23 +1242,76 @@ public class SpedizioneViewModel { refMtbColr.setId(originalRefMtbColr.getId()); } - refMtbColr.setNumCollo(refMtbColt.getNumCollo()).setDataCollo(refMtbColt.getDataColloS()).setSerCollo(refMtbColt.getSerCollo()).setGestione(refMtbColt.getGestione()); + refMtbColr.setNumCollo(refMtbColt.getNumCollo()) + .setDataCollo(refMtbColt.getDataColloS()) + .setSerCollo(refMtbColt.getSerCollo()) + .setGestione(refMtbColt.getGestione()); } - mtbColr.setRefMtbColr(refMtbColr); + createdMtbColr.setRefMtbColr(refMtbColr); } - 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(finalShouldPrint); + if (shouldCloseLU) requestCloseLU(shouldPrint); + }, this::sendError); + + + + +// boolean finalShouldPrint = shouldPrint; +// mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, value -> { +// +// 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()); +// +// +// if (mEnableGiacenza) { +// MtbColr refMtbColr = new MtbColr() +// .setCodMart(mtbColr.getCodMart()) +// .setPartitaMag(mtbColr.getPartitaMag()) +// .setCodTagl(mtbColr.getCodTagl()) +// .setCodCol(mtbColr.getCodCol()); +// +// if (refMtbColt != null) { +// +// MtbColr originalRefMtbColr = refMtbColt.getMtbColr() != null && refMtbColt.getMtbColr().size() > 0 ? refMtbColt.getMtbColr().get(0) : null; +// +// if (originalRefMtbColr != null) { +// refMtbColr.setId(originalRefMtbColr.getId()); +// } +// +// refMtbColr.setNumCollo(refMtbColt.getNumCollo()) +// .setDataCollo(refMtbColt.getDataColloS()) +// .setSerCollo(refMtbColt.getSerCollo()) +// .setGestione(refMtbColt.getGestione()); +// } +// mtbColr.setRefMtbColr(refMtbColr); +// } +// +// 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) requestCloseLU(finalShouldPrint); +// }, this::sendError); + } private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) { @@ -1281,159 +1349,254 @@ public class SpedizioneViewModel { } - public void deleteRow(MtbColr mtbColrToDelete) { + public void requestDeleteRow(MtbColr mtbColrToDelete) { this.sendMtbColrDeleteRequest(canDelete -> { + if(!canDelete) + return; - if (canDelete) { - this.sendOnLoadingStarted(); + 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); + var deleteUDSRowRequestoDTO = new DeleteUDSRowRequestDTO() + .setMtbColrToDelete(mtbColrToDelete); - MtbColr mtbColr = (MtbColr) mtbColrToDelete.clone(); + this.mColliScaricoRESTConsumer.deleteUDSRow(deleteUDSRowRequestoDTO, () -> { + Optional pickingObjectDTO = Stream.of(this.mPickingList.getValue()) + .filter(x -> Stream.of(x.getWithdrawMtbColrs()).anyMatch(y -> y == mtbColrToDelete)) + .findSingle(); - if (mCurrentMtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) { - mtbColr.setOperation(CommonModelConsts.OPERATION.DELETE); - } else { - mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT); - mtbColr.setQtaCol(mtbColr.getQtaCol().multiply(new BigDecimal(-1))).setNumCnf(mtbColr.getNumCnf().multiply(new BigDecimal(-1))).setRiga(null).setPesoLordoKg(null).setPesoNettoKg(null); + if (pickingObjectDTO.isPresent()) { + pickingObjectDTO.get().getWithdrawMtbColrs().remove(mtbColrToDelete); } - mtbColt.getMtbColr().add(mtbColr); + this.mCurrentMtbColt.getMtbColr().remove(mtbColrToDelete); - this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> { - - Optional 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); - } - - this.mCurrentMtbColt.getMtbColr().remove(mtbColrToDelete); - - this.resetMatchedRows(); - this.sendOnRowSaved(); - this.sendOnLoadingEnded(); - - }, this::sendError); - } + this.resetMatchedRows(); + this.sendOnRowSaved(); + this.sendOnLoadingEnded(); + }, this::sendError); }); } - public void closeLU(boolean shouldPrint) { + public void requestCloseLU(boolean shouldPrint) { if (mCurrentMtbColt == null) return; this.sendOnLoadingStarted(); - mColliMagazzinoRESTConsumer.canLUBeDeleted(mCurrentMtbColt, canBeDeleted -> { + this.checkIfShouldBeDeleted(() -> { + deleteLU(() -> { + this.mCurrentMtbColt = null; - if (canBeDeleted) { - deleteLU(() -> { - this.mIsNewLU = false; - this.sendLUClosed(); - this.sendOnLoadingEnded(); - }); - } else { - if (mDefaultSegnoCol == -1) { - Runnable saveAction = () -> { - if (SettingsManager.iDB().isFlagAskInfoAggiuntiveSpedizione()) { - this.mListener.onInfoAggiuntiveRequired(mCurrentMtbColt, (note, mtbTcol) -> { - mCurrentMtbColt.setAnnotazioni(note); - if (mtbTcol != null) { - mCurrentMtbColt.setMtbTCol(mtbTcol); - mCurrentMtbColt.setCodTcol(mtbTcol.getCodTcol()); - } else { - mCurrentMtbColt.setMtbTCol(null); - mCurrentMtbColt.setCodTcol(null); - } - mColliMagazzinoRESTConsumer.updateDataFine(mCurrentMtbColt, () -> distribuisciLU((generatedMtbColts) -> { - if (shouldPrint) - printCollo(generatedMtbColts, () -> this.postCloseOperations(generatedMtbColts)); - else { - postCloseOperations(generatedMtbColts); - } - }), this::sendError); - }); - } else { + if (mMtbColtSessionID != null) + this.mColliDataRecoverService.closeSession(mMtbColtSessionID); - mColliMagazzinoRESTConsumer.updateDataFine(mCurrentMtbColt, () -> distribuisciLU((generatedMtbColts) -> { - if (shouldPrint) - printCollo(generatedMtbColts, () -> this.postCloseOperations(generatedMtbColts)); - else { - postCloseOperations(generatedMtbColts); - } - }), this::sendError); - } - }; + this.mIsNewLU = false; + this.sendLUClosed(); + this.sendOnLoadingEnded(); + }); - if (mShouldAskPesoLU) { - this.sendLUPesoRequired(mCurrentMtbColt.getCodTcol(), mCurrentMtbColt.getPesoNettoKg(), mCurrentMtbColt.getPesoKg(), (newCodTcol, newNetWeight, newGrossWeight) -> { + }, () -> { + this.askPeso(() -> { - mCurrentMtbColt.setCodTcol(newCodTcol); - mCurrentMtbColt.setPesoNettoKg(newNetWeight); - mCurrentMtbColt.setPesoKg(newGrossWeight); + this.askInfoAggiuntive(() -> { - saveAction.run(); - }); - } else { - saveAction.run(); - } - } else { + this.closeLU(generatedMtbColts -> { - distribuisciLU(mtbColts -> { - if (this.mIsNewLU) { - this.sendLUPositionChangeRequest((shouldChangePosition, mtbDepoPosizione) -> { + this.mColliMagazzinoRESTConsumer.fillMtbAartsOfMtbColts(generatedMtbColts, filledMtbColts -> { - if (shouldChangePosition) { + this.askPositionChange( + filledMtbColts, + positionedMtbColts -> { - if (mtbDepoPosizione != null) { - if (mtbDepoPosizione.isFlagMonoCollo()) { - this.mPosizioneRESTConsumer.getBancaliInPosizione(mtbDepoPosizione, destMtbColtList -> { - if (destMtbColtList == null || destMtbColtList.size() != 1) { - //Nessuna UL trovata oppure più UL nella stessa posizione - this.sendError(new NoLUFoundException()); - } else { - if (destMtbColtList.get(0).getSegno() != mDefaultSegnoCol) { - this.sendError(new InvalidLUException()); - } else { - moveLUtoLU(mtbColts, destMtbColtList.get(0), savedMtbColt -> { - ArrayList savedMtbColtList = new ArrayList<>(); - savedMtbColtList.add(savedMtbColt); - postCloseOperations(savedMtbColtList); - }); - } + this.askPrint(shouldPrint, positionedMtbColts, () -> { + positionedMtbColts.stream() + .filter(x -> !this.mColliRegistrati.contains(x)) + .forEach(x -> this.mColliRegistrati.add(x)); - } - }, this::sendError); - } else { - //La posizione non è Mono-UL - this.sendError(new CurrentMonoLUPositionIsNotCorrectException()); - } - } else { - //Nessuna posizione trovata con questo barcode - this.sendError(new ScannedPositionNotExistException()); - } - } else { - postCloseOperations(mtbColts); - } - }); - } else { - postCloseOperations(mtbColts); - } + postCloseOperations(positionedMtbColts); + + this.mIsNewLU = false; + + this.resetMatchedRows(); + this.sendLUClosed(); + this.sendOnLoadingEnded(); + }); + + }); + + }, this::sendError); }); - } - } - }, this::sendError); + + }); + }); + }); } - private void distribuisciLU(RunnableArgs> onComplete) { - MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone(); - IOrdiniVendita ordiniVendita = ClassRouter.getInstance(ClassRouter.PATH.ORDINI_VENDITA); - ordiniVendita.distribuisciCollo(cloneMtbColt, mTestateOrdini, mtbColts -> { - mColliMagazzinoRESTConsumer.fillMtbAartsOfMtbColts(mtbColts, onComplete, this::sendError); -// mColliMagazzinoRESTConsumer.getMultipleByTestate(mtbColts, false, onComplete, this::sendError); + private void closeLU(RunnableArgs> onComplete) { + var closeUDSRequestDto = new CloseUDSRequestDTO() + .setMtbColt(this.mCurrentMtbColt) + //.setPrintSSCC(shouldPrint) + .setOrderCodMdep(mTestateOrdini.get(0).getCodMdep()) + .setEnableTransferLogic(isTrasfOrderLogicEnabled()); + + + this.mColliSpedizioneRESTConsumer.closeUDS(closeUDSRequestDto, closeResponse -> { + onComplete.run(closeResponse.getGeneratedMtbColts()); }, this::sendError); + + + } + + private void checkIfShouldBeDeleted(Runnable onDeleted, Runnable onContinue) { + var requestDto = + new CanUDSBeDeletedRequestDTO() + .setMtbColt(this.mCurrentMtbColt); + + this.mColliSpedizioneRESTConsumer.canUDSBeDeleted(requestDto, + canBeDeleted -> { + if (canBeDeleted == null || !canBeDeleted) + onContinue.run(); + + else onDeleted.run(); + + }, this::sendError); + } + + + private void deleteLU(Runnable onComplete) { + this.mColliSpedizioneRESTConsumer.deleteUDS( + new DeleteUDSRequestDTO() + .setMtbColt(this.mCurrentMtbColt), + onComplete, this::sendError); + } + + private boolean isTrasfOrderLogicEnabled() { + OrdiniVenditaInterface ordiniVendita = ClassRouter.getInstance(ClassRouter.PATH.ORDINI_VENDITA); + return ordiniVendita != null && ordiniVendita.isTrasfOrder(mTestateOrdini); + } + + private void askPeso(Runnable onComplete) { + + if (mDefaultSegnoCol != -1 || !mShouldAskPesoLU) { + onComplete.run(); + return; + } + + this.sendLUPesoRequired(mCurrentMtbColt.getCodTcol(), mCurrentMtbColt.getPesoNettoKg(), mCurrentMtbColt.getPesoKg(), (newCodTcol, newNetWeight, newGrossWeight) -> { + + mCurrentMtbColt.setCodTcol(newCodTcol); + mCurrentMtbColt.setPesoNettoKg(newNetWeight); + mCurrentMtbColt.setPesoKg(newGrossWeight); + + onComplete.run(); + }); + + } + + private void askInfoAggiuntive(Runnable onComplete) { + if (mDefaultSegnoCol != -1 || !SettingsManager.iDB().isFlagAskInfoAggiuntiveSpedizione()) { + onComplete.run(); + return; + } + + this.mListener.onInfoAggiuntiveRequired(mCurrentMtbColt, (note, mtbTcol) -> { + mCurrentMtbColt.setAnnotazioni(note); + + if (mtbTcol != null) { + mCurrentMtbColt.setMtbTCol(mtbTcol); + mCurrentMtbColt.setCodTcol(mtbTcol.getCodTcol()); + } else { + mCurrentMtbColt.setMtbTCol(null); + mCurrentMtbColt.setCodTcol(null); + } + + onComplete.run(); + }); + } + + private void askPositionChange(List mtbColtsToMove, RunnableArgs> onComplete) { + if (mDefaultGestioneOfUL != GestioneEnum.LAVORAZIONE || mDefaultSegnoCol != 1 || !this.mIsNewLU) { + onComplete.run(mtbColtsToMove); + return; + } + + this.sendLUPositionChangeRequest((shouldChangePosition, mtbDepoPosizione) -> { + + if (!shouldChangePosition) { + onComplete.run(mtbColtsToMove); + return; + } + + if (mtbDepoPosizione == null) { + //Nessuna posizione trovata con questo barcode + this.sendError(new ScannedPositionNotExistException()); + return; + } + + if (!mtbDepoPosizione.isFlagMonoCollo()) { + //La posizione non è Mono-UL + this.sendError(new CurrentMonoLUPositionIsNotCorrectException()); + return; + } + + + this.mPosizioneRESTConsumer.getBancaliInPosizione(mtbDepoPosizione, destMtbColtList -> { + + if (destMtbColtList == null || destMtbColtList.size() != 1) { + //Nessuna UL trovata oppure più UL nella stessa posizione + this.sendError(new NoLUFoundException()); + return; + + } + + if (destMtbColtList.get(0).getSegno() != mDefaultSegnoCol) { + this.sendError(new InvalidLUException()); + return; + + } + + moveLUtoLU(mtbColtsToMove, destMtbColtList.get(0), savedMtbColt -> { + ArrayList savedMtbColtList = new ArrayList<>(); + savedMtbColtList.add(savedMtbColt); + onComplete.run(savedMtbColtList); + }); + + + }, this::sendError); + + + }); + + } + + + private void askPrint(boolean canPrint, List mtbColtsToPrint, Runnable onComplete) { + + if (mDefaultGestioneOfUL != GestioneEnum.VENDITA || + mDefaultSegnoCol != -1 || + mtbColtsToPrint == null || + mtbColtsToPrint.isEmpty() || + !canPrint) { + + onComplete.run(); + return; + } + + + this.sendLUPrintRequest(shouldPrint -> { + if (!shouldPrint) { + onComplete.run(); + return; + } + + var printUDSRequestDto = new PrintUDSRequestDTO() + .setMtbColts(mtbColtsToPrint); + + this.mColliSpedizioneRESTConsumer.printUDS(printUDSRequestDto, onComplete, + ex -> this.sendLUPrintError(ex, onComplete)); + + }); + } @@ -1462,33 +1625,6 @@ public class SpedizioneViewModel { }, this::sendError); } - private void printCollo(List mtbColtsToPrint, Runnable onComplete) { - this.sendLUPrintRequest(shouldPrint -> { - - if (!shouldPrint) { - onComplete.run(); - } else { - cyclicPrint(mtbColtsToPrint.iterator(), onComplete, ex -> this.sendLUPrintError(ex, onComplete)); - - } - - }); - } - - private void cyclicPrint(@NotNull Iterator sourceMtbColts, Runnable onComplete, RunnableArgs onAbort) { - if (sourceMtbColts.hasNext()) { - singlePrint(sourceMtbColts.next(), () -> { - cyclicPrint(sourceMtbColts, onComplete, onAbort); - }, onAbort); - } else { - onComplete.run(); - } - } - - private void singlePrint(MtbColt mtbColtToPrint, Runnable onComplete, RunnableArgs onFailed) { - this.mPrinterRESTConsumer.printCollo(mtbColtToPrint, onComplete, onFailed); - } - public void recoverLU(MtbColt mtbColt) { this.sendOnLoadingStarted(); @@ -1505,18 +1641,14 @@ public class SpedizioneViewModel { } private void postCloseOperations(List mtbColtList) { - Stream.of(mtbColtList).filter(x -> !this.mColliRegistrati.contains(x)).forEach(x -> this.mColliRegistrati.add(x)); - if (mTestateOrdini != null) { for (MtbColt mtbColt : mtbColtList) { - Stream.of(mTestateOrdini).filter(x -> x.getNumOrd().equals(mtbColt.getNumOrd()) && x.getDataOrdD().equals(mtbColt.getDataOrdD()) && x.getGestioneEnum() == mtbColt.getGestioneEnum()).forEach(x -> x.setExistColloBoolean(true)); + mTestateOrdini.stream() + .filter(x -> x.getNumOrd().equals(mtbColt.getNumOrd()) && x.getDataOrdD().equals(mtbColt.getDataOrdD()) && x.getGestioneEnum() == mtbColt.getGestioneEnum()) + .forEach(x -> x.setExistColloBoolean(true)); } } - if (mMtbColtSessionID != null) - this.mColliDataRecoverService.closeSession(mMtbColtSessionID); - this.mCurrentMtbColt = null; - if (mEnableQuantityReset) { for (PickingObjectDTO pickingObjectDTO : mPickingList.getValue()) { @@ -1547,21 +1679,6 @@ public class SpedizioneViewModel { pickingObjectDTO.setWithdrawMtbColrs(new ArrayList<>()); } } - - this.mIsNewLU = false; - - this.resetMatchedRows(); - this.sendLUClosed(); - this.sendOnLoadingEnded(); - } - - private void deleteLU(Runnable onComplete) { - mColliMagazzinoRESTConsumer.deleteCollo(mCurrentMtbColt, () -> { - this.mColliDataRecoverService.closeSession(mMtbColtSessionID); - this.mCurrentMtbColt = null; - - if (onComplete != null) onComplete.run(); - }, this::sendError); } public void resetMatchedRows() { diff --git a/app/src/main/res/layout/bottom_sheet__inventario_actions_view.xml b/app/src/main/res/layout/bottom_sheet__inventario_actions_view.xml index 4d3b4f88..4bfa501c 100644 --- a/app/src/main/res/layout/bottom_sheet__inventario_actions_view.xml +++ b/app/src/main/res/layout/bottom_sheet__inventario_actions_view.xml @@ -42,7 +42,7 @@ android:layout_height="wrap_content" android:layout_marginBottom="8dp" android:orientation="vertical" - app:layout_constraintEnd_toStartOf="@id/qta_layout" + app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> diff --git a/barcode_base_android_library/build.gradle b/barcode_base_android_library/build.gradle index de782954..fbe4e9f6 100644 --- a/barcode_base_android_library/build.gradle +++ b/barcode_base_android_library/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 32 + compileSdkVersion 33 defaultConfig { minSdkVersion 21 - targetSdkVersion 32 + targetSdkVersion 33 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' @@ -33,9 +33,9 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', { exclude group: 'com.android.support', module: 'support-annotations' }) diff --git a/build.gradle b/build.gradle index d09a27bf..d9edf287 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ buildscript { ext { - kotlin_version = '1.7.10' + kotlin_version = '1.7.21' } repositories { @@ -12,12 +12,12 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:7.4.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.google.gms:google-services:4.3.13' + classpath 'com.google.gms:google-services:4.3.15' - classpath 'com.google.firebase:perf-plugin:1.4.1' + classpath 'com.google.firebase:perf-plugin:1.4.2' // Add the Firebase Crashlytics Gradle plugin. - classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1' + classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/dynamic__base/build.gradle b/dynamic__base/build.gradle index e3258b1b..db54af84 100644 --- a/dynamic__base/build.gradle +++ b/dynamic__base/build.gradle @@ -3,7 +3,7 @@ plugins { } android { - compileSdkVersion 32 + compileSdkVersion 33 defaultConfig { minSdkVersion 21 diff --git a/dynamic__base/src/main/java/it/integry/wms/dynamic_customization/extensions/OrdiniVendita.java b/dynamic__base/src/main/java/it/integry/wms/dynamic_customization/extensions/OrdiniVendita.java index e5c916e6..4ec9cb0f 100644 --- a/dynamic__base/src/main/java/it/integry/wms/dynamic_customization/extensions/OrdiniVendita.java +++ b/dynamic__base/src/main/java/it/integry/wms/dynamic_customization/extensions/OrdiniVendita.java @@ -2,17 +2,23 @@ package it.integry.wms.dynamic_customization.extensions; import java.util.List; -import it.integry.integrywmsnative.core.class_router.interfaces.IOrdiniVendita; +import it.integry.integrywmsnative.core.class_router.interfaces.OrdiniVenditaInterface; import it.integry.integrywmsnative.core.expansion.RunnableArgs; import it.integry.integrywmsnative.core.model.MtbColt; import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer; import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO; import it.integry.integrywmsnative.core.settings.SettingsManager; -public class OrdiniVendita implements IOrdiniVendita { +public class OrdiniVendita implements OrdiniVenditaInterface { @Override + public boolean isTrasfOrder(List testateOrdini) { + return false; + } + + @Override + @Deprecated public void distribuisciCollo(MtbColt mtbColt, List testateOrdini, RunnableArgs> onComplete, RunnableArgs onFailed) { // UtilityToast.showToast("Avviato metodo in BaseFeature"); diff --git a/dynamic_vgalimenti/build.gradle b/dynamic_vgalimenti/build.gradle index d95e7e57..ef4a43c0 100644 --- a/dynamic_vgalimenti/build.gradle +++ b/dynamic_vgalimenti/build.gradle @@ -19,5 +19,5 @@ dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation project(':app') - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.0' } diff --git a/dynamic_vgalimenti/src/main/java/it/integry/wms/dynamic_customization/extensions/OrdiniVendita.java b/dynamic_vgalimenti/src/main/java/it/integry/wms/dynamic_customization/extensions/OrdiniVendita.java index 690b7b2a..c45ed15f 100644 --- a/dynamic_vgalimenti/src/main/java/it/integry/wms/dynamic_customization/extensions/OrdiniVendita.java +++ b/dynamic_vgalimenti/src/main/java/it/integry/wms/dynamic_customization/extensions/OrdiniVendita.java @@ -2,7 +2,7 @@ package it.integry.wms.dynamic_customization.extensions; import java.util.List; -import it.integry.integrywmsnative.core.class_router.interfaces.IOrdiniVendita; +import it.integry.integrywmsnative.core.class_router.interfaces.OrdiniVenditaInterface; import it.integry.integrywmsnative.core.expansion.RunnableArgs; import it.integry.integrywmsnative.core.model.MtbColt; import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer; @@ -11,15 +11,26 @@ import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO; import it.integry.integrywmsnative.core.settings.SettingsManager; import it.integry.integrywmsnative.core.utility.UtilityString; -public class OrdiniVendita implements IOrdiniVendita { +public class OrdiniVendita implements OrdiniVenditaInterface { @Override + public boolean isTrasfOrder(List testateOrdini) { + // Se il deposito del collo è diverso dal deposito dell'utente allora sto "evadendo" + // la merce per una vendita presente su un altro deposito + + String codMdepOrder = testateOrdini.get(0).getCodMdep(); + return !UtilityString.isNullOrEmpty(codMdepOrder) && + !codMdepOrder.equalsIgnoreCase(SettingsManager.i().getUserSession().getDepo().getCodMdep()); + } + + @Override + @Deprecated public void distribuisciCollo(MtbColt mtbColt, List testateOrdini, RunnableArgs> onComplete, RunnableArgs onFailed) { String codMdepOrder = testateOrdini.get(0).getCodMdep(); - //Se il deposito del collo è diverso dal deposito dell'utente allora sto "evadendo" la merce per una vendita presente - //su un altro deposito + //Se il deposito del collo è diverso dal deposito dell'utente allora sto "evadendo" la merce + // per una vendita presente su un altro deposito if(!UtilityString.isNullOrEmpty(codMdepOrder) && !codMdepOrder.equalsIgnoreCase(SettingsManager.i().getUserSession().getDepo().getCodMdep())) { diff --git a/gradle.properties b/gradle.properties index 743f49e2..3aeac783 100644 --- a/gradle.properties +++ b/gradle.properties @@ -34,4 +34,4 @@ org.gradle.parallel=true org.gradle.caching=true # Increase memory allotted to JVM org.gradle.jvmargs=-Xmx4096m -org.gradle.unsafe.configuration-cache=true \ No newline at end of file +#org.gradle.unsafe.configuration-cache=true \ No newline at end of file diff --git a/honeywellscannerlibrary/build.gradle b/honeywellscannerlibrary/build.gradle index 795db588..c01e1383 100644 --- a/honeywellscannerlibrary/build.gradle +++ b/honeywellscannerlibrary/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 32 + compileSdkVersion 33 defaultConfig { minSdkVersion 21 - targetSdkVersion 32 + targetSdkVersion 33 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -33,9 +33,9 @@ dependencies { // implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) implementation project(":honeywellsdk") - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test:runner:1.4.0' + androidTestImplementation 'androidx.test:runner:1.5.2' androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', { exclude group: 'com.android.support', module: 'support-annotations' }) diff --git a/keyobardemulatorscannerlibrary/build.gradle b/keyobardemulatorscannerlibrary/build.gradle index d3b26e12..8e1a9520 100644 --- a/keyobardemulatorscannerlibrary/build.gradle +++ b/keyobardemulatorscannerlibrary/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 32 + compileSdkVersion 33 defaultConfig { minSdkVersion 21 - targetSdkVersion 32 + targetSdkVersion 33 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' @@ -32,7 +32,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.0' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', { diff --git a/pointmobilescannerlibrary/build.gradle b/pointmobilescannerlibrary/build.gradle index 6bf5f17d..e9e976b7 100644 --- a/pointmobilescannerlibrary/build.gradle +++ b/pointmobilescannerlibrary/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 32 + compileSdkVersion 33 defaultConfig { minSdkVersion 21 - targetSdkVersion 32 + targetSdkVersion 33 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -30,9 +30,9 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test:runner:1.4.0' + androidTestImplementation 'androidx.test:runner:1.5.2' androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', { exclude group: 'com.android.support', module: 'support-annotations' }) diff --git a/zebrascannerlibrary/build.gradle b/zebrascannerlibrary/build.gradle index 022cc7c7..c5a3a246 100644 --- a/zebrascannerlibrary/build.gradle +++ b/zebrascannerlibrary/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 32 + compileSdkVersion 33 defaultConfig { minSdkVersion 21 - targetSdkVersion 32 + targetSdkVersion 33 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -32,9 +32,9 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test:runner:1.4.0' + androidTestImplementation 'androidx.test:runner:1.5.2' androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0', { exclude group: 'com.android.support', module: 'support-annotations' })