Fix warning partita scaduta e blocco per partita inattiva

This commit is contained in:
2023-12-13 10:13:16 +01:00
parent 143a6c9e9c
commit 6541f17555
13 changed files with 121 additions and 40 deletions

View File

@@ -65,33 +65,31 @@ public class OrdiniUscitaElencoViewModel {
this.sendOnLoadingStarted();
new Thread(() -> {
Date loadingStartDate = new Date();
Date loadingStartDate = new Date();
this.mOrdiniRESTConsumer.getOrdiniInevasi(this.mCurrentCodMdep, mCurrentGestioneOrd,
ordiniLavorazione -> {
this.mOrderList.postValue(Stream.of(ordiniLavorazione)
.map(x -> {
try {
return OrdiniUscitaElencoDTO.fromParent(x);
} catch (Exception ex) {
return null;
}
})
.toList());
this.mOrdiniRESTConsumer.getOrdiniInevasi(this.mCurrentCodMdep, mCurrentGestioneOrd,
ordiniLavorazione -> {
this.mOrderList.postValue(Stream.of(ordiniLavorazione)
.map(x -> {
try {
return OrdiniUscitaElencoDTO.fromParent(x);
} catch (Exception ex) {
return null;
}
})
.toList());
long forcedDelaySecs = (new Date().getTime() - loadingStartDate.getTime()) / 1000;
long forcedDelaySecs = (new Date().getTime() - loadingStartDate.getTime()) / 1000;
if (2 - forcedDelaySecs > 0) {
try {
Thread.sleep((2 - forcedDelaySecs) * 1000);
} catch (Exception ignored) {
}
if (2 - forcedDelaySecs > 0) {
try {
Thread.sleep((2 - forcedDelaySecs) * 1000);
} catch (Exception ignored) {
}
}
this.sendOnLoadingEnded();
}, this::sendError);
}).start();
this.sendOnLoadingEnded();
}, this::sendError);
}

View File

@@ -773,6 +773,8 @@ public class SpedizioneViewModel {
MtbColt refMtbColt = matchedItem.getRefMtbColt();
if (matchedItem.getMtbColts() != null && matchedItem.getMtbColts().size() == 1) {
refMtbColt = matchedItem.getMtbColts().get(0);
} else if(matchedItem.getTempPickData().getSourceMtbColt() != null){
refMtbColt = matchedItem.getTempPickData().getSourceMtbColt();
}
MtbColr refMtbColr = refMtbColt != null ? refMtbColt.getMtbColr().get(0) : null;
this.dispatchOrdineRow(matchedItem, refMtbColt, refMtbColr, refMtbColr == null);