Fix su tara non presente in anagrafica articolo. Cambiato servizio di retrieve by codMart.

This commit is contained in:
Giuseppe Scorrano 2023-12-15 10:16:44 +01:00
parent f5ad8e8b64
commit 4ba1b847e7
8 changed files with 15 additions and 53 deletions

View File

@ -152,7 +152,7 @@ dependencies {
implementation 'com.github.pedromassango:doubleClick:3.0' implementation 'com.github.pedromassango:doubleClick:3.0'
//SQLite ROOM //SQLite ROOM
def room_version = "2.5.2" def room_version = "2.6.1"
implementation "androidx.room:room-runtime:$room_version" implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version" annotationProcessor "androidx.room:room-compiler:$room_version"

View File

@ -78,14 +78,12 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
.setCodMarts(codMarts)) .setCodMarts(codMarts))
.enqueue(new Callback<>() { .enqueue(new Callback<>() {
@Override @Override
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) { public void onResponse(Call<ServiceRESTResponse<List<MtbAart>>> call, Response<ServiceRESTResponse<List<MtbAart>>> response) {
analyzeAnswer(response, "getByCodMart", (m) -> { analyzeAnswer(response, "getByCodMart", onComplete, onFailed);
onComplete.run(response.body().getEntityList());
}, onFailed);
} }
@Override @Override
public void onFailure(Call<ServiceRESTResponse<MtbAart>> call, Throwable t) { public void onFailure(Call<ServiceRESTResponse<List<MtbAart>>> call, Throwable t) {
onFailed.run(new Exception(t)); onFailed.run(new Exception(t));
} }
}); });
@ -112,26 +110,9 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
public void getByCodMart(String codMartToFind, RunnableArgs<MtbAart> onComplete, RunnableArgs<Exception> onFailed) { public void getByCodMart(String codMartToFind, RunnableArgs<MtbAart> onComplete, RunnableArgs<Exception> onFailed) {
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class); getByCodMarts(Collections.singletonList(codMartToFind), artList -> {
articoloRESTConsumer.getByCodMart( onComplete.run(artList != null && !artList.isEmpty() ? artList.get(0) : null);
new RetrieveArticoloByCodMartRequestDTO() }, onFailed);
.setCodMarts(Collections.singletonList(codMartToFind)))
.enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
analyzeAnswer(response, "getByCodMart", (m) -> {
if (response.body().getEntityList() != null && !response.body().getEntityList().isEmpty()) {
onComplete.run(response.body().getEntityList().get(0));
} else onComplete.run(null);
}, onFailed);
}
@Override
public void onFailure(Call<ServiceRESTResponse<MtbAart>> call, Throwable t) {
onFailed.run(new Exception(t));
}
});
} }

View File

@ -21,7 +21,7 @@ public interface ArticoloRESTConsumerService {
Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> searchByBarcode(@Body() SearchArticoloByBarcodeRequestDTO searchArticoloByBarcodeRequest); Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> searchByBarcode(@Body() SearchArticoloByBarcodeRequestDTO searchArticoloByBarcodeRequest);
@POST("wms/articolo/retrieveByCodMart") @POST("wms/articolo/retrieveByCodMart")
Call<ServiceRESTResponse<MtbAart>> getByCodMart(@Body RetrieveArticoloByCodMartRequestDTO retrieveArticoloByCodMartRequest); Call<ServiceRESTResponse<List<MtbAart>>> getByCodMart(@Body RetrieveArticoloByCodMartRequestDTO retrieveArticoloByCodMartRequest);
@POST("wms/articolo/updateBarcodeImballo") @POST("wms/articolo/updateBarcodeImballo")
Call<ServiceRESTResponse<Void>> updateBarcodeImballo(@Body UpdateBarcodeImballoRequestDTO updateBarcodeImballoRequest); Call<ServiceRESTResponse<Void>> updateBarcodeImballo(@Body UpdateBarcodeImballoRequestDTO updateBarcodeImballoRequest);

View File

@ -16,8 +16,6 @@ public class SitBollaAccettazioneDTO {
private BigDecimal qtaDoc; private BigDecimal qtaDoc;
private BigDecimal qtaCnfDoc; private BigDecimal qtaCnfDoc;
private BigDecimal numCnfDoc; private BigDecimal numCnfDoc;
private BigDecimal qtaAccettata;
private BigDecimal numCnfAccettata;
private BigDecimal qtaDaAccettare; private BigDecimal qtaDaAccettare;
private BigDecimal numCnfDaAccettare; private BigDecimal numCnfDaAccettare;
@ -111,24 +109,6 @@ public class SitBollaAccettazioneDTO {
return this; return this;
} }
public BigDecimal getQtaAccettata() {
return qtaAccettata;
}
public SitBollaAccettazioneDTO setQtaAccettata(BigDecimal qtaAccettata) {
this.qtaAccettata = qtaAccettata;
return this;
}
public BigDecimal getNumCnfAccettata() {
return numCnfAccettata;
}
public SitBollaAccettazioneDTO setNumCnfAccettata(BigDecimal numCnfAccettata) {
this.numCnfAccettata = numCnfAccettata;
return this;
}
public BigDecimal getQtaDaAccettare() { public BigDecimal getQtaDaAccettare() {
return qtaDaAccettare; return qtaDaAccettare;
} }

View File

@ -103,7 +103,8 @@ public class BottomSheetFragmentLUContentView extends BottomSheetFragmentBaseVie
List<MtbColr> mtbColrs = mViewModel.getObservableMtbColt().get().getMtbColr(); List<MtbColr> mtbColrs = mViewModel.getObservableMtbColt().get().getMtbColr();
mBinding.textviewArtCounter.setText(String.valueOf(mtbColrs.size())); mBinding.textviewArtCounter.setText(String.valueOf(mtbColrs.size()));
mBinding.textviewArtDescription.setText(mContext.getResources().getQuantityString(R.plurals.articles, mtbColrs.size())); mBinding.textviewArtDescription.setText(mContext.getResources().getQuantityString(R.plurals.articles, mtbColrs.size()));
mViewModel.calcPesi();
mViewModel.refreshPesi();
} }
public BottomSheetFragmentLUContentView setListener(Listener listener) { public BottomSheetFragmentLUContentView setListener(Listener listener) {

View File

@ -41,7 +41,7 @@ public class BottomSheetFragmentLUContentViewModel {
return this; return this;
} }
public void calcPesi() { public void refreshPesi() {
MtbColt collo = this.mtbColt.get(); MtbColt collo = this.mtbColt.get();
if (collo == null) return; if (collo == null) return;
@ -52,7 +52,7 @@ public class BottomSheetFragmentLUContentViewModel {
for (MtbColr mtbColr : collo.getMtbColr()) { for (MtbColr mtbColr : collo.getMtbColr()) {
MtbAart articolo = mtbColr.getMtbAart(); MtbAart articolo = mtbColr.getMtbAart();
if (articolo == null || articolo.getPesoKg() == null) if (articolo == null || articolo.getPesoKg() == null || articolo.getTaraKg() == null)
continue; continue;
BigDecimal pesoRiga = articolo.isFlagQtaCnfFissaBoolean() ? mtbColr.getNumCnf().multiply(articolo.getPesoKg()) : mtbColr.getQtaCol(); BigDecimal pesoRiga = articolo.isFlagQtaCnfFissaBoolean() ? mtbColr.getNumCnf().multiply(articolo.getPesoKg()) : mtbColr.getQtaCol();

View File

@ -3,7 +3,7 @@
buildscript { buildscript {
ext { ext {
kotlin_version = '1.9.0' kotlin_version = '1.9.0'
agp_version = '8.1.4' agp_version = '8.2.0'
} }
repositories { repositories {
@ -13,7 +13,7 @@ buildscript {
dependencies { dependencies {
classpath "com.android.tools.build:gradle:$agp_version" classpath "com.android.tools.build:gradle:$agp_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.15' classpath 'com.google.gms:google-services:4.4.0'
classpath 'com.google.firebase:perf-plugin:1.4.2' classpath 'com.google.firebase:perf-plugin:1.4.2'

View File

@ -1,6 +1,6 @@
#Mon Feb 13 15:14:43 CET 2023 #Mon Feb 13 15:14:43 CET 2023
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME