Implementata gestione del magazzino automatico in posizionamento merce
This commit is contained in:
8
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
8
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,com.annimon.stream.Stream,of" />
|
||||||
|
</inspection_tool>
|
||||||
|
</profile>
|
||||||
|
</component>
|
||||||
@@ -3,9 +3,11 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPickItemsRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPickItemsRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPutItemsRequestDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
@@ -13,10 +15,9 @@ import retrofit2.Response;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public class MagazzinoAutomaticoRESTConsumer extends _BaseRESTConsumer {
|
public class MagazzinoAutomaticoRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
public void pickItems(String posizione, MagazzinoAutomaticoPickItemsRequestDTO magazzinoAutomaticoPickItemsRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void pickItems(MtbDepoPosizione posizione, MagazzinoAutomaticoPickItemsRequestDTO magazzinoAutomaticoPickItemsRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MagazzinoAutomaticoRESTConsumerService magazzinoAutomaticoRESTConsumerService = RESTBuilder.getService(MagazzinoAutomaticoRESTConsumerService.class);
|
MagazzinoAutomaticoRESTConsumerService magazzinoAutomaticoRESTConsumerService = RESTBuilder.getService(MagazzinoAutomaticoRESTConsumerService.class);
|
||||||
|
magazzinoAutomaticoRESTConsumerService.pickItems(posizione.getPosizione(), magazzinoAutomaticoPickItemsRequestDTO)
|
||||||
magazzinoAutomaticoRESTConsumerService.pickItems(posizione, magazzinoAutomaticoPickItemsRequestDTO)
|
|
||||||
.enqueue(new Callback<>() {
|
.enqueue(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
@@ -31,4 +32,21 @@ public class MagazzinoAutomaticoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void putItems(MtbDepoPosizione posizione, MagazzinoAutomaticoPutItemsRequestDTO magazzinoAutomaticoPutItemsRequestDTO, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
MagazzinoAutomaticoRESTConsumerService magazzinoAutomaticoRESTConsumerService = RESTBuilder.getService(MagazzinoAutomaticoRESTConsumerService.class);
|
||||||
|
magazzinoAutomaticoRESTConsumerService.putItems(posizione.getPosizione(), magazzinoAutomaticoPutItemsRequestDTO)
|
||||||
|
.enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<Void>> call, Response<ServiceRESTResponse<Void>> response) {
|
||||||
|
analyzeAnswer(response, "magazzino-automatico/putItems", data -> onComplete.run(), onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Void>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPickItemsRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPickItemsRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPutItemsRequestDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
@@ -13,4 +14,9 @@ public interface MagazzinoAutomaticoRESTConsumerService {
|
|||||||
Call<ServiceRESTResponse<Void>> pickItems(
|
Call<ServiceRESTResponse<Void>> pickItems(
|
||||||
@Path("posizione") String posizione,
|
@Path("posizione") String posizione,
|
||||||
@Body MagazzinoAutomaticoPickItemsRequestDTO magazzinoAutomaticoPickItemsRequestDTO);
|
@Body MagazzinoAutomaticoPickItemsRequestDTO magazzinoAutomaticoPickItemsRequestDTO);
|
||||||
|
|
||||||
|
@POST("wms/magazzino-automatico/{posizione}/putItems")
|
||||||
|
Call<ServiceRESTResponse<Void>> putItems(
|
||||||
|
@Path("posizione") String posizione,
|
||||||
|
@Body MagazzinoAutomaticoPutItemsRequestDTO magazzinoAutomaticoPutItemsRequestDTO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model.magazzino_automatico;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
|
||||||
|
public class MagazzinoAutomaticoPutItemsRequestDTO {
|
||||||
|
|
||||||
|
private MtbColt inputMtbColt;
|
||||||
|
|
||||||
|
|
||||||
|
public MtbColt getInputMtbColt() {
|
||||||
|
return inputMtbColt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MagazzinoAutomaticoPutItemsRequestDTO setInputMtbColt(MtbColt inputMtbColt) {
|
||||||
|
this.inputMtbColt = inputMtbColt;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -171,7 +171,7 @@ public class PickingLiberoViewModel {
|
|||||||
.setDefaultGestioneOfNewUDS(mDefaultGestione.getText())
|
.setDefaultGestioneOfNewUDS(mDefaultGestione.getText())
|
||||||
.setItemsToPick(magazzinoAutomaticoPickItemRequestDTOList);
|
.setItemsToPick(magazzinoAutomaticoPickItemRequestDTOList);
|
||||||
|
|
||||||
mMagazzinoAutomaticoRESTConsumer.pickItems(mtbDepoPosizione.getPosizione(),
|
mMagazzinoAutomaticoRESTConsumer.pickItems(mtbDepoPosizione,
|
||||||
magazzinoAutomaticoPickRequest, onComplete, this::sendError);
|
magazzinoAutomaticoPickRequest, onComplete, this::sendError);
|
||||||
}, this::sendOnLoadingEnded);
|
}, this::sendOnLoadingEnded);
|
||||||
|
|
||||||
|
|||||||
@@ -632,7 +632,7 @@ public class SpedizioneViewModel {
|
|||||||
.setOrdersOfNewUDS(orders)
|
.setOrdersOfNewUDS(orders)
|
||||||
.setItemsToPick(magazzinoAutomaticoPickItemRequestDTOList);
|
.setItemsToPick(magazzinoAutomaticoPickItemRequestDTOList);
|
||||||
|
|
||||||
mMagazzinoAutomaticoRESTConsumer.pickItems(mtbDepoPosizione.getPosizione(),
|
mMagazzinoAutomaticoRESTConsumer.pickItems(mtbDepoPosizione,
|
||||||
magazzinoAutomaticoPickRequest, onComplete, this::sendError);
|
magazzinoAutomaticoPickRequest, onComplete, this::sendError);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,14 +4,18 @@ import dagger.Module;
|
|||||||
import dagger.Provides;
|
import dagger.Provides;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoAutomaticoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||||
|
|
||||||
@Module(subcomponents = VersamentoMerceComponent.class)
|
@Module(subcomponents = VersamentoMerceComponent.class)
|
||||||
public class VersamentoMerceModule {
|
public class VersamentoMerceModule {
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
VersamentoMerceViewModel providesVersamentoMerceViewModel(ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, PosizioniRESTConsumer posizioniRESTConsumer) {
|
VersamentoMerceViewModel providesVersamentoMerceViewModel(ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||||
return new VersamentoMerceViewModel(colliMagazzinoRESTConsumer, barcodeRESTConsumer, posizioniRESTConsumer);
|
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||||
|
PosizioniRESTConsumer posizioniRESTConsumer,
|
||||||
|
MagazzinoAutomaticoRESTConsumer magazzinoAutomaticoRESTConsumer) {
|
||||||
|
return new VersamentoMerceViewModel(colliMagazzinoRESTConsumer, barcodeRESTConsumer, posizioniRESTConsumer, magazzinoAutomaticoRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
|||||||
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;
|
||||||
|
import it.integry.integrywmsnative.core.exception.ScannedPositionNotExistException;
|
||||||
import it.integry.integrywmsnative.core.exception.TooManyLUFoundInMonoLUPositionException;
|
import it.integry.integrywmsnative.core.exception.TooManyLUFoundInMonoLUPositionException;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
@@ -27,7 +28,9 @@ import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
|||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoAutomaticoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPutItemsRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
@@ -44,12 +47,14 @@ public class VersamentoMerceViewModel {
|
|||||||
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||||
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
|
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
|
||||||
private final PosizioniRESTConsumer mPosizioniRESTConsumer;
|
private final PosizioniRESTConsumer mPosizioniRESTConsumer;
|
||||||
|
private final MagazzinoAutomaticoRESTConsumer mMagazzinoAutomaticoRESTConsumer;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public VersamentoMerceViewModel(ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, PosizioniRESTConsumer posizioniRESTConsumer) {
|
public VersamentoMerceViewModel(ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer, PosizioniRESTConsumer posizioniRESTConsumer, MagazzinoAutomaticoRESTConsumer mMagazzinoAutomaticoRESTConsumer) {
|
||||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||||
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||||
this.mPosizioniRESTConsumer = posizioniRESTConsumer;
|
this.mPosizioniRESTConsumer = posizioniRESTConsumer;
|
||||||
|
this.mMagazzinoAutomaticoRESTConsumer = mMagazzinoAutomaticoRESTConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -71,22 +76,19 @@ public class VersamentoMerceViewModel {
|
|||||||
.filter(x -> x.getPosizione().equalsIgnoreCase(barcodeScanDTO.getStringValue()))
|
.filter(x -> x.getPosizione().equalsIgnoreCase(barcodeScanDTO.getStringValue()))
|
||||||
.single();
|
.single();
|
||||||
|
|
||||||
if (foundPosizione.isFlagMonoCollo()) {
|
|
||||||
this.mPosizioniRESTConsumer.getBancaliInPosizione(foundPosizione, mtbColtList -> {
|
|
||||||
|
|
||||||
if (mtbColtList == null || mtbColtList.size() == 0) {
|
if (foundPosizione == null) {
|
||||||
this.sendError(new NoLUFoundException());
|
//Nessuna posizione trovata con questo barcode
|
||||||
} else if (mtbColtList.size() == 1) {
|
this.sendError(new ScannedPositionNotExistException());
|
||||||
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//TAKE HERE
|
if (foundPosizione.isMagazzinoAutomatico()) {
|
||||||
pickMerceULtoUL(mtbColt, onComplete);
|
//La posizione è di un magazzino automatico
|
||||||
|
this.executePosizioneMagazzinoAutomatico(foundPosizione, onComplete);
|
||||||
|
|
||||||
}, this::sendError);
|
} else if (foundPosizione.isFlagMonoCollo()) {
|
||||||
} else {
|
this.executePosizioneMonocollo(onComplete, foundPosizione);
|
||||||
this.sendError(new TooManyLUFoundInMonoLUPositionException());
|
|
||||||
}
|
|
||||||
}, this::sendError);
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (!UtilityString.equalsIgnoreCase(mCurrentMtbColt.getValue().getCodMdep(), foundPosizione.getCodMdep())) {
|
if (!UtilityString.equalsIgnoreCase(mCurrentMtbColt.getValue().getCodMdep(), foundPosizione.getCodMdep())) {
|
||||||
@@ -113,6 +115,36 @@ public class VersamentoMerceViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void executePosizioneMagazzinoAutomatico(MtbDepoPosizione mtbDepoPosizione, Runnable onComplete) {
|
||||||
|
var magazzinoAutomaticoPickRequest = new MagazzinoAutomaticoPutItemsRequestDTO()
|
||||||
|
.setInputMtbColt(this.mCurrentMtbColt.getValue());
|
||||||
|
|
||||||
|
mMagazzinoAutomaticoRESTConsumer.putItems(mtbDepoPosizione,
|
||||||
|
magazzinoAutomaticoPickRequest, () -> {
|
||||||
|
onComplete.run();
|
||||||
|
this.sendOnDataSaved();
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void executePosizioneMonocollo(Runnable onComplete, MtbDepoPosizione foundPosizione) {
|
||||||
|
this.mPosizioniRESTConsumer.getBancaliInPosizione(foundPosizione, mtbColtList -> {
|
||||||
|
|
||||||
|
if (mtbColtList == null || mtbColtList.size() == 0) {
|
||||||
|
this.sendError(new NoLUFoundException());
|
||||||
|
} else if (mtbColtList.size() == 1) {
|
||||||
|
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||||
|
|
||||||
|
//TAKE HERE
|
||||||
|
pickMerceULtoUL(mtbColt, onComplete);
|
||||||
|
|
||||||
|
}, this::sendError);
|
||||||
|
} else {
|
||||||
|
this.sendError(new TooManyLUFoundInMonoLUPositionException());
|
||||||
|
}
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO, Runnable onBarcodeScanComplete) {
|
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO, Runnable onBarcodeScanComplete) {
|
||||||
this.mBarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
this.mBarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user