Finish v1.40.25(442)
This commit is contained in:
commit
2b981b6c40
@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 441
|
def appVersionCode = 442
|
||||||
def appVersionName = '1.40.24'
|
def appVersionName = '1.40.25'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
|
|||||||
@ -114,4 +114,21 @@ public class ColliAccettazioneRESTConsumer extends _BaseRESTConsumer implements
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void checkBarcodeUl(String barcodeUl, RunnableArgs<Boolean> onComplete, RunnableArgs<Exception> onFailed){
|
||||||
|
ColliAccettazioneRESTConsumerService colliAccettazioneRESTConsumerService = RESTBuilder.getService(ColliAccettazioneRESTConsumerService.class);
|
||||||
|
|
||||||
|
colliAccettazioneRESTConsumerService.checkIfBarcodeUlAlreadyRegistered(barcodeUl)
|
||||||
|
.enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<Boolean>> call, Response<ServiceRESTResponse<Boolean>> response) {
|
||||||
|
analyzeAnswer(response, "accettazione/checkIfBarcodeUlAlreadyRegistered", onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Boolean>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,9 @@ import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowRequestDTO;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDCRowResponseDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
|
import retrofit2.http.GET;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
public interface ColliAccettazioneRESTConsumerService {
|
public interface ColliAccettazioneRESTConsumerService {
|
||||||
|
|
||||||
@ -31,4 +33,7 @@ public interface ColliAccettazioneRESTConsumerService {
|
|||||||
@POST("wms/accettazione/deleteUDCRow")
|
@POST("wms/accettazione/deleteUDCRow")
|
||||||
Call<ServiceRESTResponse<Void>> deleteUDCRow(@Body DeleteUDCRowRequestDTO deleteUDCRowRequestDTO);
|
Call<ServiceRESTResponse<Void>> deleteUDCRow(@Body DeleteUDCRowRequestDTO deleteUDCRowRequestDTO);
|
||||||
|
|
||||||
|
@GET("wms/accettazione/checkIfBarcodeUlAlreadyRegistered")
|
||||||
|
Call<ServiceRESTResponse<Boolean>> checkIfBarcodeUlAlreadyRegistered(@Query("barcodeUl") String barcodeUl);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
@ -13,6 +15,8 @@ import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
||||||
@ -113,4 +117,21 @@ public class ColliSpedizioneRESTConsumer extends _BaseRESTConsumer implements Co
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void duplicateUDSRow(DuplicateUDSRequestDTO duplicateUDSRequestDTO, RunnableArgs<DuplicateUDSResponseDTO> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ColliSpedizioneRESTConsumerService colliSpedizioneRESTConsumerService = RESTBuilder.getService(ColliSpedizioneRESTConsumerService.class);
|
||||||
|
|
||||||
|
colliSpedizioneRESTConsumerService.duplicateUDSRow(duplicateUDSRequestDTO)
|
||||||
|
.enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(@NonNull Call<ServiceRESTResponse<DuplicateUDSResponseDTO>> call, @NonNull Response<ServiceRESTResponse<DuplicateUDSResponseDTO>> response) {
|
||||||
|
analyzeAnswer(response, "spedizione/duplicateUDSRow", onComplete, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(@NonNull Call<ServiceRESTResponse<DuplicateUDSResponseDTO>> call, @NonNull Throwable t) {
|
||||||
|
onFailed.run(new Exception());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,8 @@ import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSResponseDTO;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
||||||
@ -35,4 +37,7 @@ public interface ColliSpedizioneRESTConsumerService {
|
|||||||
@POST("wms/spedizione/deleteUDSRow")
|
@POST("wms/spedizione/deleteUDSRow")
|
||||||
Call<ServiceRESTResponse<Void>> deleteUDSRow(@Body DeleteUDSRowRequestDTO deleteUDSRowRequestDTO);
|
Call<ServiceRESTResponse<Void>> deleteUDSRow(@Body DeleteUDSRowRequestDTO deleteUDSRowRequestDTO);
|
||||||
|
|
||||||
|
@POST("wms/spedizione/duplicateUDSRow")
|
||||||
|
Call<ServiceRESTResponse<DuplicateUDSResponseDTO>> duplicateUDSRow(@Body DuplicateUDSRequestDTO duplicateUDSRequestDTO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,28 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model.uds;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
|
||||||
|
public class DuplicateUDSRequestDTO {
|
||||||
|
|
||||||
|
private MtbColt mtbColt;
|
||||||
|
|
||||||
|
private int numOfDuplicates;
|
||||||
|
|
||||||
|
public MtbColt getMtbColt() {
|
||||||
|
return mtbColt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DuplicateUDSRequestDTO setMtbColt(MtbColt mtbColt) {
|
||||||
|
this.mtbColt = mtbColt;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNumOfDuplicates() {
|
||||||
|
return numOfDuplicates;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DuplicateUDSRequestDTO setNumOfDuplicates(int numOfDuplicates) {
|
||||||
|
this.numOfDuplicates = numOfDuplicates;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model.uds;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
|
||||||
|
public class DuplicateUDSResponseDTO {
|
||||||
|
|
||||||
|
private List<MtbColt> mtbColtList;
|
||||||
|
|
||||||
|
public List<MtbColt> getMtbColtList() {
|
||||||
|
return mtbColtList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DuplicateUDSResponseDTO setMtbColtList(List<MtbColt> mtbColtList) {
|
||||||
|
this.mtbColtList = mtbColtList;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -79,6 +79,7 @@ public class DBSettingsModel {
|
|||||||
private boolean flagTracciamentoImballiCaricoEnabled = false;
|
private boolean flagTracciamentoImballiCaricoEnabled = false;
|
||||||
private boolean flagTracciamentoImballiScaricoEnabled = false;
|
private boolean flagTracciamentoImballiScaricoEnabled = false;
|
||||||
private boolean flagPickingLiberoEnableScanArt = false;
|
private boolean flagPickingLiberoEnableScanArt = false;
|
||||||
|
private boolean flagAskDuplicateUDSSpedizione = false;
|
||||||
|
|
||||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||||
return flagSpedizioneEnableFakeGiacenza;
|
return flagSpedizioneEnableFakeGiacenza;
|
||||||
@ -664,4 +665,13 @@ public class DBSettingsModel {
|
|||||||
this.flagPickingLiberoEnableScanArt = flagPickingLiberoEnableScanArt;
|
this.flagPickingLiberoEnableScanArt = flagPickingLiberoEnableScanArt;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFlagAskDuplicateUDSSpedizione() {
|
||||||
|
return flagAskDuplicateUDSSpedizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setFlagAskDuplicateUDSSpedizione(boolean flagAskDuplicateUDSSpedizione) {
|
||||||
|
this.flagAskDuplicateUDSSpedizione = flagAskDuplicateUDSSpedizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -388,6 +388,11 @@ public class SettingsManager {
|
|||||||
.setSection("SPEDIZIONE")
|
.setSection("SPEDIZIONE")
|
||||||
.setKeySection("FLAG_ASK_INFO_AGGIUNTIVE")
|
.setKeySection("FLAG_ASK_INFO_AGGIUNTIVE")
|
||||||
.setSetter(dbSettingsModelIstance::setFlagAskInfoAggiuntiveSpedizione));
|
.setSetter(dbSettingsModelIstance::setFlagAskInfoAggiuntiveSpedizione));
|
||||||
|
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("SPEDIZIONE")
|
||||||
|
.setKeySection("FLAG_ASK_DUPLICATE_UDS")
|
||||||
|
.setSetter(dbSettingsModelIstance::setFlagAskDuplicateUDSSpedizione));
|
||||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
|
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
|
||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("SPEDIZIONE")
|
.setSection("SPEDIZIONE")
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import android.content.Intent;
|
|||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.Html;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
@ -741,6 +742,16 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
|
|||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onWarning(String warningText, Runnable action) {
|
||||||
|
this.runOnUiThread(() -> {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
DialogSimpleMessageView
|
||||||
|
.makeWarningDialog(new SpannableString(Html.fromHtml(warningText)), null, action)
|
||||||
|
.show(getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemDispatched(PickingObjectDTO pickingObjectDTO, MtbAart mtbAart, BigDecimal initialNumCnf, BigDecimal initialQtaCnf, BigDecimal initialQtaTot, BigDecimal totalQtaOrd, BigDecimal totalNumCnfOrd, BigDecimal qtaCnfOrd, BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, BigDecimal totalQtaAvailable, BigDecimal totalNumCnfAvailable, BigDecimal qtaCnfAvailable, String partitaMag, LocalDate dataScad, boolean canPartitaMagBeChanged, boolean canOverflowQuantity, String customArtDescription, RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
public void onItemDispatched(PickingObjectDTO pickingObjectDTO, MtbAart mtbAart, BigDecimal initialNumCnf, BigDecimal initialQtaCnf, BigDecimal initialQtaTot, BigDecimal totalQtaOrd, BigDecimal totalNumCnfOrd, BigDecimal qtaCnfOrd, BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, BigDecimal totalQtaAvailable, BigDecimal totalNumCnfAvailable, BigDecimal qtaCnfAvailable, String partitaMag, LocalDate dataScad, boolean canPartitaMagBeChanged, boolean canOverflowQuantity, String customArtDescription, RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
||||||
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO().setMtbAart(mtbAart).setInitialNumCnf(initialNumCnf).setInitialQtaCnf(initialQtaCnf).setInitialQtaTot(initialQtaTot).setTotalQtaOrd(totalQtaOrd).setTotalNumCnfOrd(totalNumCnfOrd).setQtaCnfOrd(qtaCnfOrd).setTotalQtaToBeTaken(totalQtaToBeTaken).setTotalNumCnfToBeTaken(totalNumCnfToBeTaken).setQtaCnfToBeTaken(qtaCnfToBeTaken).setTotalQtaAvailable(totalQtaAvailable).setTotalNumCnfAvailable(totalNumCnfAvailable).setQtaCnfAvailable(qtaCnfAvailable).setPartitaMag(partitaMag).setDataScad(dataScad).setCanPartitaMagBeChanged(canPartitaMagBeChanged).setCanLUBeClosed(true).setCanOverflowOrderQuantity(canOverflowQuantity).setCustomArtDescription(customArtDescription);
|
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO().setMtbAart(mtbAart).setInitialNumCnf(initialNumCnf).setInitialQtaCnf(initialQtaCnf).setInitialQtaTot(initialQtaTot).setTotalQtaOrd(totalQtaOrd).setTotalNumCnfOrd(totalNumCnfOrd).setQtaCnfOrd(qtaCnfOrd).setTotalQtaToBeTaken(totalQtaToBeTaken).setTotalNumCnfToBeTaken(totalNumCnfToBeTaken).setQtaCnfToBeTaken(qtaCnfToBeTaken).setTotalQtaAvailable(totalQtaAvailable).setTotalNumCnfAvailable(totalNumCnfAvailable).setQtaCnfAvailable(qtaCnfAvailable).setPartitaMag(partitaMag).setDataScad(dataScad).setCanPartitaMagBeChanged(canPartitaMagBeChanged).setCanLUBeClosed(true).setCanOverflowOrderQuantity(canOverflowQuantity).setCustomArtDescription(customArtDescription);
|
||||||
|
|||||||
@ -247,8 +247,14 @@ public class AccettazioneOrdiniPickingViewModel {
|
|||||||
try {
|
try {
|
||||||
Ean128Model ean128Model = mEan128Service.decode(barcodeScanDTO);
|
Ean128Model ean128Model = mEan128Service.decode(barcodeScanDTO);
|
||||||
|
|
||||||
//Nel caso trovo un SSCC lo aggiungo
|
mColliAccettazioneRESTConsumer.checkBarcodeUl(ean128Model.Sscc, result -> {
|
||||||
this.processBarcodeNotOpenedLU(barcodeScanDTO, ean128Model.Sscc, onComplete);
|
if (result){
|
||||||
|
this.sendWarning("Barcode ul già registrato!", onComplete);
|
||||||
|
} else {
|
||||||
|
//Nel caso trovo un SSCC lo aggiungo
|
||||||
|
this.processBarcodeNotOpenedLU(barcodeScanDTO, ean128Model.Sscc, onComplete);
|
||||||
|
}
|
||||||
|
}, this::sendError);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
this.sendError(e);
|
this.sendError(e);
|
||||||
@ -933,6 +939,10 @@ public class AccettazioneOrdiniPickingViewModel {
|
|||||||
if (this.mListener != null) mListener.onError(ex);
|
if (this.mListener != null) mListener.onError(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendWarning(String warningText, Runnable action) {
|
||||||
|
if (this.mListener != null) mListener.onWarning(warningText, action);
|
||||||
|
}
|
||||||
|
|
||||||
private void sendLUOpened(MtbColt mtbColt) {
|
private void sendLUOpened(MtbColt mtbColt) {
|
||||||
if (this.mListener != null) mListener.onLUOpened(mtbColt);
|
if (this.mListener != null) mListener.onLUOpened(mtbColt);
|
||||||
}
|
}
|
||||||
@ -1050,6 +1060,8 @@ public class AccettazioneOrdiniPickingViewModel {
|
|||||||
|
|
||||||
void onFilterPosizioneApplied(String posizioneToFilter);
|
void onFilterPosizioneApplied(String posizioneToFilter);
|
||||||
|
|
||||||
|
void onWarning(String warningText, Runnable action);
|
||||||
|
|
||||||
void onULVersata(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete);
|
void onULVersata(VersamentoAutomaticoULResponseDTO versamentoAutomaticoULResponseDTO, Runnable onComplete);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1072,4 +1072,16 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
DialogInfoAggiuntiveLUView.newInstance(mtbColt, onComplete, this::onLoadingEnded)
|
DialogInfoAggiuntiveLUView.newInstance(mtbColt, onComplete, this::onLoadingEnded)
|
||||||
.show(getSupportFragmentManager(), DialogInfoAggiuntiveLUView.class.getName());
|
.show(getSupportFragmentManager(), DialogInfoAggiuntiveLUView.class.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInputDuplicate(RunnableArgs<Integer> onComplete){
|
||||||
|
DialogSimpleInputHelper.makeInputDialog(this, "Numero pedane da duplicare", inputValue -> {
|
||||||
|
try {
|
||||||
|
Integer num = Integer.parseInt(inputValue);
|
||||||
|
onComplete.run(num);
|
||||||
|
} catch (NumberFormatException ex) {
|
||||||
|
this.onError(new Exception("Inserire un numero di risorse valido"));
|
||||||
|
}
|
||||||
|
}, () -> {}).show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.gest.spedizione;
|
package it.integry.integrywmsnative.gest.spedizione;
|
||||||
|
|
||||||
|
import androidx.annotation.IntegerRes;
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
@ -13,6 +14,7 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@ -72,6 +74,7 @@ import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestOrderDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestOrderDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.uds.DuplicateUDSRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.uds.PrintULRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.uds.PrintULRequestDTO;
|
||||||
@ -1549,31 +1552,35 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
this.closeLU(generatedMtbColts -> {
|
this.closeLU(generatedMtbColts -> {
|
||||||
|
|
||||||
this.mColliMagazzinoRESTConsumer.fillMtbAartsOfMtbColts(generatedMtbColts, filledMtbColts -> {
|
this.duplicateUDS(generatedMtbColts, duplicatedMtbColts -> {
|
||||||
|
|
||||||
this.askPositionChange(
|
generatedMtbColts.addAll(duplicatedMtbColts);
|
||||||
filledMtbColts,
|
|
||||||
positionedMtbColts -> {
|
|
||||||
|
|
||||||
this.askPrint((shouldPrint && SettingsManager.iDB().isFlagPrintEtichetteOnLUClose()), positionedMtbColts, () -> {
|
this.mColliMagazzinoRESTConsumer.fillMtbAartsOfMtbColts(generatedMtbColts, filledMtbColts -> {
|
||||||
positionedMtbColts.stream()
|
|
||||||
.filter(x -> !this.mColliRegistrati.contains(x))
|
|
||||||
.forEach(x -> this.mColliRegistrati.add(x));
|
|
||||||
|
|
||||||
postCloseOperations(positionedMtbColts);
|
this.askPositionChange(
|
||||||
|
filledMtbColts,
|
||||||
|
positionedMtbColts -> {
|
||||||
|
|
||||||
this.mIsNewLU = false;
|
this.askPrint((shouldPrint && SettingsManager.iDB().isFlagPrintEtichetteOnLUClose()), positionedMtbColts, () -> {
|
||||||
|
positionedMtbColts.stream()
|
||||||
|
.filter(x -> !this.mColliRegistrati.contains(x))
|
||||||
|
.forEach(x -> this.mColliRegistrati.add(x));
|
||||||
|
|
||||||
|
postCloseOperations(positionedMtbColts);
|
||||||
|
|
||||||
|
this.mIsNewLU = false;
|
||||||
|
|
||||||
|
this.resetMatchedRows();
|
||||||
|
this.sendLUClosed();
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
});
|
||||||
|
|
||||||
this.resetMatchedRows();
|
|
||||||
this.sendLUClosed();
|
|
||||||
this.sendOnLoadingEnded();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
}, this::sendError);
|
||||||
|
});
|
||||||
}, this::sendError);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -1596,8 +1603,35 @@ public class SpedizioneViewModel {
|
|||||||
this.mColliScaricoRESTConsumer.closeUDS(closeUDSRequestDto, closeResponse -> {
|
this.mColliScaricoRESTConsumer.closeUDS(closeUDSRequestDto, closeResponse -> {
|
||||||
onComplete.run(closeResponse.getGeneratedMtbColts());
|
onComplete.run(closeResponse.getGeneratedMtbColts());
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void duplicateUDS(List<MtbColt> mtbColtList, RunnableArgs<List<MtbColt>> onComplete) {
|
||||||
|
var clonedLu = (MtbColt) this.mCurrentMtbColt.clone();
|
||||||
|
|
||||||
|
boolean noReference = clonedLu.getMtbColr().stream()
|
||||||
|
.allMatch(
|
||||||
|
x -> x.getGestioneRif() == null &&
|
||||||
|
x.getDataColloRifD() == null &&
|
||||||
|
x.getSerColloRif() == null &&
|
||||||
|
x.getNumColloRif() == null
|
||||||
|
);
|
||||||
|
|
||||||
|
if (mtbColtList.size() > 1 || !noReference || !SettingsManager.iDB().isFlagAskDuplicateUDSSpedizione()) {
|
||||||
|
onComplete.run(new ArrayList<>());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var savedMtbColt = mtbColtList.get(0);
|
||||||
|
|
||||||
|
sendInputDuplicate(inputNumber -> {
|
||||||
|
var duplicateUDSRequestDTO = new DuplicateUDSRequestDTO()
|
||||||
|
.setMtbColt(savedMtbColt)
|
||||||
|
.setNumOfDuplicates(inputNumber);
|
||||||
|
|
||||||
|
this.mColliSpedizioneRESTConsumer.duplicateUDSRow(duplicateUDSRequestDTO, data -> {
|
||||||
|
onComplete.run(data.getMtbColtList());
|
||||||
|
}, this::sendError);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkIfShouldBeDeleted(Runnable onDeleted, Runnable onContinue) {
|
private void checkIfShouldBeDeleted(Runnable onDeleted, Runnable onContinue) {
|
||||||
@ -1938,6 +1972,10 @@ public class SpedizioneViewModel {
|
|||||||
this.mDocumentRESTConsumer.createDocFromColli(loadCollidto, doc -> this.sendOnOrderClosed(), this::sendError);
|
this.mDocumentRESTConsumer.createDocFromColli(loadCollidto, doc -> this.sendOnOrderClosed(), this::sendError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendInputDuplicate(RunnableArgs<Integer> onComplete) {
|
||||||
|
if (this.mListener != null) mListener.onInputDuplicate(onComplete);
|
||||||
|
}
|
||||||
|
|
||||||
public SpedizioneViewModel setListeners(Listener listener) {
|
public SpedizioneViewModel setListeners(Listener listener) {
|
||||||
this.mListener = listener;
|
this.mListener = listener;
|
||||||
return this;
|
return this;
|
||||||
@ -1970,6 +2008,8 @@ public class SpedizioneViewModel {
|
|||||||
void onChooseArtsRequest(List<MtbAart> artsList, RunnableArgs<List<MtbAart>> onComplete);
|
void onChooseArtsRequest(List<MtbAart> artsList, RunnableArgs<List<MtbAart>> onComplete);
|
||||||
|
|
||||||
void onOrderClosed();
|
void onOrderClosed();
|
||||||
|
|
||||||
|
void onInputDuplicate(RunnableArgs<Integer> onComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user