Rimossa domanda di posizionamento nel caso si apre una UL e non viene creata da 0.

This commit is contained in:
Giuseppe Scorrano 2021-02-17 12:46:13 +01:00
parent 91f4658fe3
commit 3663b2bf4e

View File

@ -93,6 +93,7 @@ public class SpedizioneViewModel {
private boolean mCanOverflowOrderQuantity;
private boolean mShouldAskPesoLU;
private String mReportNameSpedizioneChiudiOrdine;
private boolean mIsNewLU;
private MtbColt mCurrentMtbColt = null;
@ -435,6 +436,7 @@ public class SpedizioneViewModel {
} else {
this.mCurrentMtbColt = mtbColt;
mMtbColtSessionID = this.mColliDataRecoverService.startNewSession(mtbColt, mTestateOrdini);
this.mIsNewLU = false;
this.sendLUOpened(mtbColt);
@ -1236,8 +1238,8 @@ public class SpedizioneViewModel {
.setMtbColr(new ObservableArrayList<>());
this.mCurrentMtbColt = mtbColt;
mMtbColtSessionID = this.mColliDataRecoverService.startNewSession(mtbColt, mTestateOrdini);
this.mIsNewLU = true;
if (onComplete != null) onComplete.run();
this.sendLUOpened(mtbColt);
@ -1476,6 +1478,7 @@ public class SpedizioneViewModel {
if (canBeDeleted) {
deleteLU(() -> {
this.mIsNewLU = false;
this.sendLUClosed();
this.sendOnLoadingEnded();
});
@ -1510,42 +1513,45 @@ public class SpedizioneViewModel {
} else {
distribuisciLU(mtbColts -> {
this.sendLUPositionChangeRequest((shouldChangePosition, mtbDepoPosizione) -> {
if(this.mIsNewLU) {
this.sendLUPositionChangeRequest((shouldChangePosition, mtbDepoPosizione) -> {
if (shouldChangePosition) {
if (shouldChangePosition) {
if (mtbDepoPosizione != null) {
if (mtbDepoPosizione.isFlagMonoCollo()) {
this.mPosizioneRESTConsumer.getBancaliInPosizione(mtbDepoPosizione, destMtbColtList -> {
if (destMtbColtList == null || destMtbColtList.size() != 1) {
//Nessuna UL trovata oppure più UL nella stessa posizione
this.sendError(new NoLUFoundException());
} else {
if (destMtbColtList.get(0).getSegno() != mDefaultSegnoCol) {
this.sendError(new InvalidLUException());
if (mtbDepoPosizione != null) {
if (mtbDepoPosizione.isFlagMonoCollo()) {
this.mPosizioneRESTConsumer.getBancaliInPosizione(mtbDepoPosizione, destMtbColtList -> {
if (destMtbColtList == null || destMtbColtList.size() != 1) {
//Nessuna UL trovata oppure più UL nella stessa posizione
this.sendError(new NoLUFoundException());
} else {
moveLUtoLU(mtbColts, destMtbColtList.get(0), savedMtbColt -> {
ArrayList<MtbColt> savedMtbColtList = new ArrayList<>();
savedMtbColtList.add(savedMtbColt);
postCloseOperations(savedMtbColtList);
});
}
if (destMtbColtList.get(0).getSegno() != mDefaultSegnoCol) {
this.sendError(new InvalidLUException());
} else {
moveLUtoLU(mtbColts, destMtbColtList.get(0), savedMtbColt -> {
ArrayList<MtbColt> savedMtbColtList = new ArrayList<>();
savedMtbColtList.add(savedMtbColt);
postCloseOperations(savedMtbColtList);
});
}
}
}, this::sendError);
}
}, this::sendError);
} else {
//La posizione non è Mono-UL
this.sendError(new CurrentMonoLUPositionIsNotCorrectException());
}
} else {
//La posizione non è Mono-UL
this.sendError(new CurrentMonoLUPositionIsNotCorrectException());
//Nessuna posizione trovata con questo barcode
this.sendError(new ScannedPositionNotExistException());
}
} else {
//Nessuna posizione trovata con questo barcode
this.sendError(new ScannedPositionNotExistException());
postCloseOperations(mtbColts);
}
} else {
postCloseOperations(mtbColts);
}
});
});
} else {
postCloseOperations(mtbColts);
}
});
}
@ -1723,6 +1729,8 @@ public class SpedizioneViewModel {
pickingObjectDTO.setWithdrawMtbColrs(new ArrayList<>());
}
this.mIsNewLU = false;
this.resetMatchedRows();
this.sendLUClosed();
this.sendOnLoadingEnded();