Impedito prelevamento merce posizionata su depositi diversi
This commit is contained in:
parent
648d908e95
commit
e62e5d11f0
@ -0,0 +1,10 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||||
|
|
||||||
|
public final class InvalidCodMdepException extends Exception {
|
||||||
|
public InvalidCodMdepException() {
|
||||||
|
super(UtilityResources.getString(R.string.invalid_codmdep));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -13,6 +13,7 @@ import java.util.List;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.core.exception.InvalidCodMdepException;
|
||||||
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||||
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||||
import it.integry.integrywmsnative.core.exception.ScannedPositionNotExistException;
|
import it.integry.integrywmsnative.core.exception.ScannedPositionNotExistException;
|
||||||
@ -211,7 +212,14 @@ public class PickingLiberoViewModel {
|
|||||||
}
|
}
|
||||||
} else if (mtbColtList.size() == 1) {
|
} else if (mtbColtList.size() == 1) {
|
||||||
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||||
|
|
||||||
|
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||||
|
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||||
|
|
||||||
|
if (codMdepIsValid) {
|
||||||
pickMerceULtoUL(mtbColt, articolo, onComplete);
|
pickMerceULtoUL(mtbColt, articolo, onComplete);
|
||||||
|
} else this.sendError(new InvalidCodMdepException());
|
||||||
|
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
} else {
|
} else {
|
||||||
this.sendError(new TooManyLUFoundInMonoLUPositionException());
|
this.sendError(new TooManyLUFoundInMonoLUPositionException());
|
||||||
@ -235,7 +243,14 @@ public class PickingLiberoViewModel {
|
|||||||
if (mtbColtScanned == null) {
|
if (mtbColtScanned == null) {
|
||||||
this.sendError(new NoLUFoundException());
|
this.sendError(new NoLUFoundException());
|
||||||
} else if ((mtbColtScanned.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColtScanned.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && mtbColtScanned.getSegno() > 0) {
|
} else if ((mtbColtScanned.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColtScanned.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && mtbColtScanned.getSegno() > 0) {
|
||||||
|
|
||||||
|
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||||
|
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColtScanned.getCodMdep()));
|
||||||
|
|
||||||
|
if (codMdepIsValid) {
|
||||||
pickMerceULtoUL(mtbColtScanned, onComplete);
|
pickMerceULtoUL(mtbColtScanned, onComplete);
|
||||||
|
} else this.sendError(new InvalidCodMdepException());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.sendError(new NoLUFoundException());
|
this.sendError(new NoLUFoundException());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -324,7 +324,7 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
|||||||
|
|
||||||
SpedizioneActivity.startActivity(getActivity(),
|
SpedizioneActivity.startActivity(getActivity(),
|
||||||
sitArtOrdDTOS,
|
sitArtOrdDTOS,
|
||||||
null,
|
new ArrayList<>(),
|
||||||
new ArrayList<>(),
|
new ArrayList<>(),
|
||||||
GestioneEnum.LAVORAZIONE,
|
GestioneEnum.LAVORAZIONE,
|
||||||
+1,
|
+1,
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import java.util.List;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.core.exception.InvalidCodMdepException;
|
||||||
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||||
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||||
import it.integry.integrywmsnative.core.exception.TooManyLUFoundInMonoLUPositionException;
|
import it.integry.integrywmsnative.core.exception.TooManyLUFoundInMonoLUPositionException;
|
||||||
@ -109,7 +110,14 @@ public class ProdVersamentoMaterialeViewModel {
|
|||||||
this.sendError(new NoLUFoundException());
|
this.sendError(new NoLUFoundException());
|
||||||
} else if (mtbColtList.size() == 1) {
|
} else if (mtbColtList.size() == 1) {
|
||||||
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||||
|
|
||||||
|
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||||
|
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||||
|
|
||||||
|
if (codMdepIsValid) {
|
||||||
this.onLUOpened(mtbColt);
|
this.onLUOpened(mtbColt);
|
||||||
|
} else this.sendError(new InvalidCodMdepException());
|
||||||
|
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
} else {
|
} else {
|
||||||
this.sendError(new TooManyLUFoundInMonoLUPositionException());
|
this.sendError(new TooManyLUFoundInMonoLUPositionException());
|
||||||
@ -122,7 +130,12 @@ public class ProdVersamentoMaterialeViewModel {
|
|||||||
private void executeEtichettaLU(String sscc) {
|
private void executeEtichettaLU(String sscc) {
|
||||||
this.mColliMagazzinoRESTConsumer.getBySSCC(sscc, true, false, mtbColt -> {
|
this.mColliMagazzinoRESTConsumer.getBySSCC(sscc, true, false, mtbColt -> {
|
||||||
|
|
||||||
|
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||||
|
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||||
|
|
||||||
|
if (codMdepIsValid) {
|
||||||
this.onLUOpened(mtbColt);
|
this.onLUOpened(mtbColt);
|
||||||
|
} else this.sendError(new InvalidCodMdepException());
|
||||||
|
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
|||||||
import it.integry.integrywmsnative.core.CommonConst;
|
import it.integry.integrywmsnative.core.CommonConst;
|
||||||
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
import it.integry.integrywmsnative.core.data_recover.ColliDataRecoverService;
|
||||||
import it.integry.integrywmsnative.core.exception.EmptyLUException;
|
import it.integry.integrywmsnative.core.exception.EmptyLUException;
|
||||||
|
import it.integry.integrywmsnative.core.exception.InvalidCodMdepException;
|
||||||
import it.integry.integrywmsnative.core.exception.InvalidLUException;
|
import it.integry.integrywmsnative.core.exception.InvalidLUException;
|
||||||
import it.integry.integrywmsnative.core.exception.NoArtsFoundException;
|
import it.integry.integrywmsnative.core.exception.NoArtsFoundException;
|
||||||
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||||
@ -158,7 +159,7 @@ public class SpedizioneViewModel {
|
|||||||
this.mEnableQuantityReset = enableQuantityReset;
|
this.mEnableQuantityReset = enableQuantityReset;
|
||||||
this.mUseQtaOrd = useQtaOrd;
|
this.mUseQtaOrd = useQtaOrd;
|
||||||
|
|
||||||
if (testateOrdini != null) {
|
if (testateOrdini != null && testateOrdini.size() > 0) {
|
||||||
this.mIsOrdTrasf = Stream.of(testateOrdini).map(OrdineUscitaInevasoDTO::isOrdTrasf).withoutNulls().distinctBy(x -> x).findFirst().get();
|
this.mIsOrdTrasf = Stream.of(testateOrdini).map(OrdineUscitaInevasoDTO::isOrdTrasf).withoutNulls().distinctBy(x -> x).findFirst().get();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,6 +239,7 @@ public class SpedizioneViewModel {
|
|||||||
mDefaultFiltroOrdine.add(filtro);
|
mDefaultFiltroOrdine.add(filtro);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (mDefaultGestioneOfUL == GestioneEnum.VENDITA) {
|
if (mDefaultGestioneOfUL == GestioneEnum.VENDITA) {
|
||||||
mColliScaricoRESTConsumer = mColliSpedizioneRESTConsumer;
|
mColliScaricoRESTConsumer = mColliSpedizioneRESTConsumer;
|
||||||
@ -250,8 +252,6 @@ public class SpedizioneViewModel {
|
|||||||
} else {
|
} else {
|
||||||
this.sendError(new NotImplementedException(String.format("Gestione %s e segno %d non gestito", mDefaultGestioneOfUL.getText(), mDefaultSegnoCol)));
|
this.sendError(new NotImplementedException(String.format("Gestione %s e segno %d non gestito", mDefaultGestioneOfUL.getText(), mDefaultSegnoCol)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onOrderClosedPrintingDone() {
|
private void onOrderClosedPrintingDone() {
|
||||||
@ -492,7 +492,13 @@ public class SpedizioneViewModel {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||||
|
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||||
|
|
||||||
|
if (codMdepIsValid) {
|
||||||
this.createNewLU(null, null, () -> searchArtFromUL(mtbColt, onComplete));
|
this.createNewLU(null, null, () -> searchArtFromUL(mtbColt, onComplete));
|
||||||
|
} else this.sendError(new InvalidCodMdepException());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
@ -530,7 +536,14 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||||
|
|
||||||
|
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||||
|
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||||
|
|
||||||
|
if (codMdepIsValid) {
|
||||||
this.searchArtFromUL(mtbColt, onComplete);
|
this.searchArtFromUL(mtbColt, onComplete);
|
||||||
|
} else this.sendError(new InvalidCodMdepException());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.sendError(new EmptyLUException());
|
this.sendError(new EmptyLUException());
|
||||||
}
|
}
|
||||||
@ -546,8 +559,17 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||||
if (mtbColt.getSegno() != -1) {
|
if (mtbColt.getSegno() != -1) {
|
||||||
|
|
||||||
|
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||||
|
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||||
|
|
||||||
|
if (codMdepIsValid) {
|
||||||
searchArtFromUL(mtbColt, onComplete);
|
searchArtFromUL(mtbColt, onComplete);
|
||||||
} else this.sendError(new InvalidLUException());
|
} else this.sendError(new InvalidCodMdepException());
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.sendError(new InvalidLUException());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.sendError(new EmptyLUException());
|
this.sendError(new EmptyLUException());
|
||||||
}
|
}
|
||||||
@ -862,8 +884,6 @@ public class SpedizioneViewModel {
|
|||||||
} else {
|
} else {
|
||||||
dispatchOrdineRowOnPostBatchLotSelection(pickingObjectDTO, refMtbColt, refMtbColr, null, canPartitaMagBeChanged);
|
dispatchOrdineRowOnPostBatchLotSelection(pickingObjectDTO, refMtbColt, refMtbColr, null, canPartitaMagBeChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dispatchOrdineRowOnPostBatchLotSelection(final PickingObjectDTO pickingObjectDTO, MtbColt refMtbColt, MtbColr refMtbColr, MtbColr scannedMtbColr, boolean canPartitaMagBeChanged) {
|
private void dispatchOrdineRowOnPostBatchLotSelection(final PickingObjectDTO pickingObjectDTO, MtbColt refMtbColt, MtbColr refMtbColr, MtbColr scannedMtbColr, boolean canPartitaMagBeChanged) {
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import java.util.List;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.core.exception.InvalidCodMdepException;
|
||||||
import it.integry.integrywmsnative.core.exception.InvalidLUGestioneException;
|
import it.integry.integrywmsnative.core.exception.InvalidLUGestioneException;
|
||||||
import it.integry.integrywmsnative.core.exception.NoArtsInLUException;
|
import it.integry.integrywmsnative.core.exception.NoArtsInLUException;
|
||||||
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||||
@ -135,7 +136,12 @@ public class VersamentoMerceViewModel {
|
|||||||
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||||
|
|
||||||
//TAKE HERE
|
//TAKE HERE
|
||||||
|
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||||
|
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||||
|
|
||||||
|
if (codMdepIsValid) {
|
||||||
pickMerceULtoUL(mtbColt, onComplete);
|
pickMerceULtoUL(mtbColt, onComplete);
|
||||||
|
} else this.sendError(new InvalidCodMdepException());
|
||||||
|
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
} else {
|
} else {
|
||||||
@ -184,11 +190,23 @@ public class VersamentoMerceViewModel {
|
|||||||
if (mtbColt == null) {
|
if (mtbColt == null) {
|
||||||
this.mColliMagazzinoRESTConsumer.createColloFromEtichettaAnonima(sscc, GestioneEnum.LAVORAZIONE, mtbColtAnonimo -> {
|
this.mColliMagazzinoRESTConsumer.createColloFromEtichettaAnonima(sscc, GestioneEnum.LAVORAZIONE, mtbColtAnonimo -> {
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
|
|
||||||
|
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||||
|
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||||
|
|
||||||
|
if (codMdepIsValid) {
|
||||||
pickMerceULtoUL(mtbColtAnonimo, onComplete);
|
pickMerceULtoUL(mtbColtAnonimo, onComplete);
|
||||||
|
} else this.sendError(new InvalidCodMdepException());
|
||||||
|
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
|
||||||
|
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
|
||||||
|
|
||||||
|
if (codMdepIsValid) {
|
||||||
pickMerceULtoUL(mtbColt, onComplete);
|
pickMerceULtoUL(mtbColt, onComplete);
|
||||||
|
} else this.sendError(new InvalidCodMdepException());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -143,6 +143,7 @@
|
|||||||
<string name="server_cod_azienda_not_valid"><![CDATA[Il codice azienda <b>%s</b> non è valido. Controllalo e riprova]]></string>
|
<string name="server_cod_azienda_not_valid"><![CDATA[Il codice azienda <b>%s</b> non è valido. Controllalo e riprova]]></string>
|
||||||
<string name="server_not_reachable"><![CDATA[L\'host <b>%s</b> sulla porta <b>%d</b> non è al momento raggiungibile. Riprova più tardi]]></string>
|
<string name="server_not_reachable"><![CDATA[L\'host <b>%s</b> sulla porta <b>%d</b> non è al momento raggiungibile. Riprova più tardi]]></string>
|
||||||
<string name="no_codmdep_available">Nessun deposito trovato per l\'utente corrente</string>
|
<string name="no_codmdep_available">Nessun deposito trovato per l\'utente corrente</string>
|
||||||
|
<string name="invalid_codmdep">Impossibile utilizzare unità logistiche di altri depositi</string>
|
||||||
<string name="action_choose_profile_db">Seleziona un database</string>
|
<string name="action_choose_profile_db">Seleziona un database</string>
|
||||||
|
|
||||||
<string name="empty_rows_in_mtbcolt">Nessuna riga presente nell\'Unità Logistica</string>
|
<string name="empty_rows_in_mtbcolt">Nessuna riga presente nell\'Unità Logistica</string>
|
||||||
|
|||||||
@ -141,6 +141,7 @@
|
|||||||
<string name="server_cod_azienda_not_valid"><![CDATA[Code <b>%s</b> is not valid. Check and retry later]]></string>
|
<string name="server_cod_azienda_not_valid"><![CDATA[Code <b>%s</b> is not valid. Check and retry later]]></string>
|
||||||
<string name="server_not_reachable"><![CDATA[The host <b>%s</b> on port <b>%d</b> is not reachable. Retry later]]></string>
|
<string name="server_not_reachable"><![CDATA[The host <b>%s</b> on port <b>%d</b> is not reachable. Retry later]]></string>
|
||||||
<string name="no_codmdep_available">No deposit available with current user</string>
|
<string name="no_codmdep_available">No deposit available with current user</string>
|
||||||
|
<string name="invalid_codmdep">Unable to use logistics units from other depots</string>
|
||||||
<string name="action_choose_profile_db">Choose a database</string>
|
<string name="action_choose_profile_db">Choose a database</string>
|
||||||
|
|
||||||
<string name="empty_rows_in_mtbcolt">No rows found in LU</string>
|
<string name="empty_rows_in_mtbcolt">No rows found in LU</string>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user