Fix su tara non presente in anagrafica articolo. Cambiato servizio di retrieve by codMart.
This commit is contained in:
@@ -152,7 +152,7 @@ dependencies {
|
||||
implementation 'com.github.pedromassango:doubleClick:3.0'
|
||||
|
||||
//SQLite ROOM
|
||||
def room_version = "2.5.2"
|
||||
def room_version = "2.6.1"
|
||||
|
||||
implementation "androidx.room:room-runtime:$room_version"
|
||||
annotationProcessor "androidx.room:room-compiler:$room_version"
|
||||
|
||||
@@ -78,14 +78,12 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
.setCodMarts(codMarts))
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||
analyzeAnswer(response, "getByCodMart", (m) -> {
|
||||
onComplete.run(response.body().getEntityList());
|
||||
}, onFailed);
|
||||
public void onResponse(Call<ServiceRESTResponse<List<MtbAart>>> call, Response<ServiceRESTResponse<List<MtbAart>>> response) {
|
||||
analyzeAnswer(response, "getByCodMart", onComplete, onFailed);
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
});
|
||||
@@ -112,26 +110,9 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
public void getByCodMart(String codMartToFind, RunnableArgs<MtbAart> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
ArticoloRESTConsumerService articoloRESTConsumer = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
articoloRESTConsumer.getByCodMart(
|
||||
new RetrieveArticoloByCodMartRequestDTO()
|
||||
.setCodMarts(Collections.singletonList(codMartToFind)))
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<MtbAart>> call, Response<ServiceRESTResponse<MtbAart>> response) {
|
||||
analyzeAnswer(response, "getByCodMart", (m) -> {
|
||||
if (response.body().getEntityList() != null && !response.body().getEntityList().isEmpty()) {
|
||||
onComplete.run(response.body().getEntityList().get(0));
|
||||
} else onComplete.run(null);
|
||||
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ServiceRESTResponse<MtbAart>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
getByCodMarts(Collections.singletonList(codMartToFind), artList -> {
|
||||
onComplete.run(artList != null && !artList.isEmpty() ? artList.get(0) : null);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public interface ArticoloRESTConsumerService {
|
||||
Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> searchByBarcode(@Body() SearchArticoloByBarcodeRequestDTO searchArticoloByBarcodeRequest);
|
||||
|
||||
@POST("wms/articolo/retrieveByCodMart")
|
||||
Call<ServiceRESTResponse<MtbAart>> getByCodMart(@Body RetrieveArticoloByCodMartRequestDTO retrieveArticoloByCodMartRequest);
|
||||
Call<ServiceRESTResponse<List<MtbAart>>> getByCodMart(@Body RetrieveArticoloByCodMartRequestDTO retrieveArticoloByCodMartRequest);
|
||||
|
||||
@POST("wms/articolo/updateBarcodeImballo")
|
||||
Call<ServiceRESTResponse<Void>> updateBarcodeImballo(@Body UpdateBarcodeImballoRequestDTO updateBarcodeImballoRequest);
|
||||
|
||||
@@ -16,8 +16,6 @@ public class SitBollaAccettazioneDTO {
|
||||
private BigDecimal qtaDoc;
|
||||
private BigDecimal qtaCnfDoc;
|
||||
private BigDecimal numCnfDoc;
|
||||
private BigDecimal qtaAccettata;
|
||||
private BigDecimal numCnfAccettata;
|
||||
private BigDecimal qtaDaAccettare;
|
||||
private BigDecimal numCnfDaAccettare;
|
||||
|
||||
@@ -111,24 +109,6 @@ public class SitBollaAccettazioneDTO {
|
||||
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() {
|
||||
return qtaDaAccettare;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,8 @@ public class BottomSheetFragmentLUContentView extends BottomSheetFragmentBaseVie
|
||||
List<MtbColr> mtbColrs = mViewModel.getObservableMtbColt().get().getMtbColr();
|
||||
mBinding.textviewArtCounter.setText(String.valueOf(mtbColrs.size()));
|
||||
mBinding.textviewArtDescription.setText(mContext.getResources().getQuantityString(R.plurals.articles, mtbColrs.size()));
|
||||
mViewModel.calcPesi();
|
||||
|
||||
mViewModel.refreshPesi();
|
||||
}
|
||||
|
||||
public BottomSheetFragmentLUContentView setListener(Listener listener) {
|
||||
|
||||
@@ -41,7 +41,7 @@ public class BottomSheetFragmentLUContentViewModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public void calcPesi() {
|
||||
public void refreshPesi() {
|
||||
MtbColt collo = this.mtbColt.get();
|
||||
if (collo == null) return;
|
||||
|
||||
@@ -52,7 +52,7 @@ public class BottomSheetFragmentLUContentViewModel {
|
||||
for (MtbColr mtbColr : collo.getMtbColr()) {
|
||||
MtbAart articolo = mtbColr.getMtbAart();
|
||||
|
||||
if (articolo == null || articolo.getPesoKg() == null)
|
||||
if (articolo == null || articolo.getPesoKg() == null || articolo.getTaraKg() == null)
|
||||
continue;
|
||||
|
||||
BigDecimal pesoRiga = articolo.isFlagQtaCnfFissaBoolean() ? mtbColr.getNumCnf().multiply(articolo.getPesoKg()) : mtbColr.getQtaCol();
|
||||
|
||||
Reference in New Issue
Block a user