Implementato Assegna lotto su collo scarico
This commit is contained in:
parent
ec49384b58
commit
b4cf8f629c
@ -37,13 +37,17 @@ public class BaseFragment extends Fragment {
|
|||||||
|
|
||||||
|
|
||||||
public void onLoadingStarted() {
|
public void onLoadingStarted() {
|
||||||
|
new Thread(() -> {
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
this.openProgress();
|
this.openProgress();
|
||||||
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onLoadingEnded() {
|
public void onLoadingEnded() {
|
||||||
|
new Thread(() -> {
|
||||||
this.closeProgress();
|
this.closeProgress();
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
|
|||||||
@ -694,4 +694,30 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
MtbColt sourceMtbColtClone = (MtbColt) sourceMtbColt.clone();
|
||||||
|
|
||||||
|
for (int i = 0; i < sourceMtbColtClone.getMtbColr().size(); i++) {
|
||||||
|
sourceMtbColtClone.getMtbColr().get(i)
|
||||||
|
.setMtbAart(null)
|
||||||
|
.setMtbPartitaMag(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
|
colliMagazzinoRESTConsumerService.assegnaLottoSuColloScarico(sourceMtbColtClone).enqueue(new Callback<ServiceRESTResponse<MtbColt>>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<MtbColt>> call, Response<ServiceRESTResponse<MtbColt>> response) {
|
||||||
|
analyzeAnswer(response, "assegnaLottoSuColloScarico", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<MtbColt>> call, Throwable t) {
|
||||||
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import retrofit2.http.Query;
|
|||||||
|
|
||||||
public interface ColliMagazzinoRESTConsumerService {
|
public interface ColliMagazzinoRESTConsumerService {
|
||||||
|
|
||||||
@POST("SM2DistribuzioneRigheCollo")
|
@POST("wms/distribuzioneRigheCollo")
|
||||||
Call<ServiceRESTResponse<JsonObject>> distribuisciCollo(@Body DistribuzioneColloDTO distribuzioneCollo);
|
Call<ServiceRESTResponse<JsonObject>> distribuisciCollo(@Body DistribuzioneColloDTO distribuzioneCollo);
|
||||||
|
|
||||||
@POST("getColloByBarcode")
|
@POST("getColloByBarcode")
|
||||||
@ -39,4 +39,7 @@ public interface ColliMagazzinoRESTConsumerService {
|
|||||||
@POST("wms/spostaArtsTraUL")
|
@POST("wms/spostaArtsTraUL")
|
||||||
Call<ServiceRESTResponse<Object>> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO);
|
Call<ServiceRESTResponse<Object>> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO);
|
||||||
|
|
||||||
|
@POST("wms/assegnaLottoSuColloScarico")
|
||||||
|
Call<ServiceRESTResponse<MtbColt>> assegnaLottoSuColloScarico(@Body MtbColt mtbColt);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -190,19 +190,19 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
public void createNewLU() {
|
public void createNewLU() {
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.mViewModel.createNewLU(null, null, () -> {
|
this.mViewModel.createNewLU(null, null, () -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,16 +225,6 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUOpened(MtbColt mtbColt) {
|
public void onLUOpened(MtbColt mtbColt) {
|
||||||
getActivity().runOnUiThread(() -> {
|
getActivity().runOnUiThread(() -> {
|
||||||
|
|||||||
@ -477,7 +477,8 @@ public class PickingLiberoViewModel {
|
|||||||
|
|
||||||
|
|
||||||
public void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
public void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, Date dataScad, boolean shouldCloseLU) {
|
||||||
this.sendOnLoadingStarted();
|
new Thread(this::sendOnLoadingStarted).start();
|
||||||
|
|
||||||
|
|
||||||
final MtbColr mtbColr = new MtbColr()
|
final MtbColr mtbColr = new MtbColr()
|
||||||
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
|
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
|
||||||
@ -519,6 +520,7 @@ public class PickingLiberoViewModel {
|
|||||||
|
|
||||||
if (shouldCloseLU) closeLU(null);
|
if (shouldCloseLU) closeLU(null);
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -710,13 +712,16 @@ public class PickingLiberoViewModel {
|
|||||||
if (onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
mColliMagazzinoRESTConsumer.updateDataFine(mCurrentMtbColt, () -> {
|
|
||||||
|
this.mColliMagazzinoRESTConsumer.assegnaLottoSuColloScarico(mCurrentMtbColt, () -> {
|
||||||
|
this.mColliMagazzinoRESTConsumer.updateDataFine(mCurrentMtbColt, () -> {
|
||||||
this.sendLUClosed();
|
this.sendLUClosed();
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
this.mCurrentMtbColt = null;
|
this.mCurrentMtbColt = null;
|
||||||
if (onComplete != null) onComplete.run();
|
if (onComplete != null) onComplete.run();
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user