Rimossa domanda di cambio posizione per le rettifiche di spedizione. Cambiata response di save doc in rettifica di spedizione.
This commit is contained in:
parent
9cd0855dcf
commit
4445e9aff2
@ -101,6 +101,7 @@ public abstract class _BaseRESTConsumer {
|
||||
if (response.getEsito() == EsitoType.OK) {
|
||||
if (!UtilityString.isNullOrEmpty(response.getErrorMessage())) {
|
||||
onFailed.run(new Exception(response.getErrorMessage()));
|
||||
return;
|
||||
} else {
|
||||
T dataObj = response.getDto() != null ?
|
||||
response.getDto() :
|
||||
|
||||
@ -442,23 +442,14 @@ public class RettificaGiacenzeViewModel {
|
||||
Runnable saveAction = () -> {
|
||||
this.mColliMagazzinoRESTConsumer.updateDataFine(
|
||||
mCurrentMtbColt, () -> {
|
||||
this.sendLUPositionChangeRequest((shouldChangePosition, mtbDepoPosizione) -> {
|
||||
|
||||
if (shouldChangePosition) {
|
||||
this.savePosizione(mtbDepoPosizione, () -> {
|
||||
this.createDoc(() -> {
|
||||
this.mAnyEditDone = false;
|
||||
postSaveBehaviour(onComplete);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.createDoc(() -> {
|
||||
this.mAnyEditDone = false;
|
||||
postSaveBehaviour(onComplete);
|
||||
});
|
||||
}
|
||||
|
||||
this.askPostionChange(mCurrentMtbColt, () -> {
|
||||
this.createDoc(mCurrentMtbColt, () -> {
|
||||
this.mAnyEditDone = false;
|
||||
postSaveBehaviour(onComplete);
|
||||
});
|
||||
});
|
||||
|
||||
}, this::sendError);
|
||||
};
|
||||
|
||||
@ -474,7 +465,30 @@ public class RettificaGiacenzeViewModel {
|
||||
}
|
||||
|
||||
|
||||
private void createDoc(Runnable onComplete) {
|
||||
private void askPostionChange(MtbColt mtbColt, Runnable onComplete) {
|
||||
if (mtbColt.getGestioneEnum() == GestioneEnum.VENDITA || mtbColt.getSegno() == -1) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
this.sendLUPositionChangeRequest((shouldChangePosition, mtbDepoPosizione) -> {
|
||||
if (shouldChangePosition) {
|
||||
this.savePosizione(mtbDepoPosizione, () -> {
|
||||
onComplete.run();
|
||||
});
|
||||
} else {
|
||||
onComplete.run();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void createDoc(MtbColt mtbColt, Runnable onComplete) {
|
||||
if (mtbColt.getGestioneEnum() != GestioneEnum.VENDITA && mtbColt.getSegno() != -1) {
|
||||
onComplete.run();
|
||||
return;
|
||||
}
|
||||
|
||||
mRettificaGiacenzeRESTConsumer.saveDoc(this.mCurrentMtbColt, onComplete, this::sendError);
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,6 @@ import com.google.gson.reflect.TypeToken;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
@ -101,12 +100,12 @@ public class RettificaGiacenzeRESTConsumer extends _BaseRESTConsumer {
|
||||
service.saveDocFromPickingPvm(request)
|
||||
.enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<List<ServiceRESTResponse<Void>>> call, Response<List<ServiceRESTResponse<Void>>> response) {
|
||||
analyzeListOfAnswers(response, "saveDocFromPickingPvm", data -> onComplete.run(), onError);
|
||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||
analyzeAnswerList(response, "saveDocFromPickingPvm", data -> onComplete.run(), onError);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<List<ServiceRESTResponse<Void>>> call, Throwable t) {
|
||||
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
||||
onError.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package it.integry.integrywmsnative.gest.rettifica_giacenze.rest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.model.SaveDocFromPickingRequestDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import retrofit2.Call;
|
||||
@ -12,6 +10,6 @@ public interface RettificaGiacenzeRESTConsumerService {
|
||||
|
||||
|
||||
@POST("saveDocFromPickingPvm")
|
||||
Call<List<ServiceRESTResponse<Void>>> saveDocFromPickingPvm(@Body SaveDocFromPickingRequestDTO saveDocFromPickingRequestDTO);
|
||||
Call<ServiceRESTResponse<Void>> saveDocFromPickingPvm(@Body SaveDocFromPickingRequestDTO saveDocFromPickingRequestDTO);
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user