Fix su mtbPartitaMag in servizio spostaArtsTraUL

This commit is contained in:
Giuseppe Scorrano 2021-04-14 11:40:06 +02:00
parent f7253fd44c
commit 16099cdaf6

View File

@ -660,9 +660,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
).enqueue(new Callback<ServiceRESTResponse<MtbColr>>() { ).enqueue(new Callback<ServiceRESTResponse<MtbColr>>() {
@Override @Override
public void onResponse(Call<ServiceRESTResponse<MtbColr>> call, Response<ServiceRESTResponse<MtbColr>> response) { public void onResponse(Call<ServiceRESTResponse<MtbColr>> call, Response<ServiceRESTResponse<MtbColr>> response) {
analyzeAnswer(response, "creaRettificaCollo", data -> { analyzeAnswer(response, "creaRettificaCollo", onComplete, onFailed);
onComplete.run(data);
}, onFailed);
} }
@Override @Override
@ -674,6 +672,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) { public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone(); MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone();
MtbColt mtbColtDestClone = (MtbColt) destMtbColt.clone();
for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) { for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) {
mtbColtToMoveClone.getMtbColr().get(i) mtbColtToMoveClone.getMtbColr().get(i)
@ -681,9 +680,11 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
.setMtbPartitaMag(null); .setMtbPartitaMag(null);
} }
mtbColtDestClone.setMtbColr(null);
SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO = new SpostaArtsTraULRequestDTO() SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO = new SpostaArtsTraULRequestDTO()
.setSourceMtbColt(sourceMtbColt) .setSourceMtbColt(mtbColtToMoveClone)
.setDestinationMtbColt(destMtbColt); .setDestinationMtbColt(mtbColtDestClone);
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class); ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
colliMagazzinoRESTConsumerService.spostaArtsTraUL( colliMagazzinoRESTConsumerService.spostaArtsTraUL(