In accettazione bolla fatto in modo che vengono riconosciuti i kit quando leggono i componenti
This commit is contained in:
parent
6d48182d90
commit
c6a2b8c6ea
@ -1,5 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
@ -98,6 +100,25 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
public void findIfIsKit(MtbAart mtbAart, RunnableArgs<MtbAart> onComplete, RunnableArgs<Exception> onFailed){
|
||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||
|
||||
articoloRESTConsumerService
|
||||
.findIfIsKit(mtbAart)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<ServiceRESTResponse<MtbAart>> call, @NonNull Response<ServiceRESTResponse<MtbAart>> response) {
|
||||
analyzeAnswer(response, "findIfIsKit", (m) -> {
|
||||
onComplete.run(response.body().getDto());
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<ServiceRESTResponse<MtbAart>> call, Throwable t) {
|
||||
onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getByCodMarts(List<String> codMartToFind, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
getByCodMartsStatic(codMartToFind, onComplete, onFailed);
|
||||
|
||||
@ -31,6 +31,9 @@ public interface ArticoloRESTConsumerService {
|
||||
@POST("wms/articolo/searchByBarcode")
|
||||
Call<ServiceRESTResponse<SearchArticoloByBarcodeResponseDTO>> searchByBarcode(@Body() SearchArticoloByBarcodeRequestDTO searchArticoloByBarcodeRequest);
|
||||
|
||||
@POST("wms/articolo/findIfIsKit")
|
||||
Call<ServiceRESTResponse<MtbAart>> findIfIsKit(@Body MtbAart mtbAart);
|
||||
|
||||
@POST("wms/articolo/retrieveByCodMart")
|
||||
Call<ServiceRESTResponse<List<MtbAart>>> getByCodMart(@Body RetrieveArticoloByCodMartRequestDTO retrieveArticoloByCodMartRequest);
|
||||
|
||||
|
||||
@ -19,6 +19,9 @@ public class SitBollaAccettazioneDTO {
|
||||
private BigDecimal qtaDaAccettare;
|
||||
private BigDecimal numCnfDaAccettare;
|
||||
|
||||
private boolean kit;
|
||||
private boolean componente;
|
||||
|
||||
public int getNumDoc() {
|
||||
return numDoc;
|
||||
}
|
||||
@ -126,4 +129,20 @@ public class SitBollaAccettazioneDTO {
|
||||
this.numCnfDaAccettare = numCnfDaAccettare;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isKit() {
|
||||
return kit;
|
||||
}
|
||||
|
||||
public void setKit(boolean kit) {
|
||||
this.kit = kit;
|
||||
}
|
||||
|
||||
public boolean isComponente() {
|
||||
return componente;
|
||||
}
|
||||
|
||||
public void setComponente(boolean componente) {
|
||||
this.componente = componente;
|
||||
}
|
||||
}
|
||||
|
||||
@ -338,8 +338,14 @@ public class AccettazioneBollaPickingViewModel {
|
||||
}
|
||||
|
||||
private void loadMatchedRows(List<PickingObjectDTO> matchedRows, MtbAart mtbAart, PickDataDTO pickDataDTO) {
|
||||
if (matchedRows == null || matchedRows.size() == 0) {
|
||||
manageNoArtFound(mtbAart, pickDataDTO);
|
||||
if (matchedRows == null || matchedRows.isEmpty()) {
|
||||
this.mArticoloRESTConsumer.findIfIsKit(mtbAart, mtbAartFind -> {
|
||||
if (mtbAartFind == null){
|
||||
manageNoArtFound(mtbAart, pickDataDTO);
|
||||
} else {
|
||||
searchArtFromAnag(mtbAartFind, pickDataDTO, () -> {});
|
||||
}
|
||||
}, this::sendError);
|
||||
} else if (matchedRows.size() == 1) {
|
||||
this.manageDispatchBollaRow(matchedRows.get(0));
|
||||
} else {
|
||||
@ -662,8 +668,8 @@ public class AccettazioneBollaPickingViewModel {
|
||||
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
|
||||
.setMtbAart(pickingObjectDTO.getMtbAart());
|
||||
|
||||
pickingObjectDTO.getWithdrawMtbColrs().add(insertedMtbColr);
|
||||
mCurrentMtbColt.getMtbColr().add(insertedMtbColr);
|
||||
pickingObjectDTO.getWithdrawMtbColrs().add(0, insertedMtbColr);
|
||||
mCurrentMtbColt.getMtbColr().add(0, insertedMtbColr);
|
||||
|
||||
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
|
||||
resetMatchedRows();
|
||||
|
||||
@ -77,8 +77,8 @@ public class AccettazioneBollaPickingListAdapter extends SectionedRecyclerViewAd
|
||||
|
||||
Collections.sort(listaOrdinata, (a, b) -> {
|
||||
|
||||
boolean condA = a.getQtaEvasa().subtract(a.getQtaTot()).floatValue() == 0;
|
||||
boolean condB = b.getQtaEvasa().subtract(b.getQtaTot()).floatValue() == 0;
|
||||
boolean condA = a.getQtaEvasa().floatValue() > 0;
|
||||
boolean condB = b.getQtaEvasa().floatValue() > 0;
|
||||
|
||||
if (condA && !condB) {
|
||||
return -1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user