Fix ricerca per codMart e partitaMag in Spedizione
This commit is contained in:
parent
8908ada740
commit
df91f0e33c
@ -206,7 +206,6 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
public RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||
|
||||
ProgressDialog progressDialog = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||
progressDialog.show();
|
||||
|
||||
BarcodeManager.disable();
|
||||
|
||||
|
||||
@ -3,6 +3,9 @@ package it.integry.integrywmsnative.gest.picking_libero;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.databinding.ActivityPickingLiberoBinding;
|
||||
import it.integry.integrywmsnative.gest.picking_libero.core.PickingLiberoHelper;
|
||||
import it.integry.integrywmsnative.gest.picking_libero.viewmodel.PickingLiberoViewModel;
|
||||
@ -16,6 +19,8 @@ public class PickingLiberoActivity extends AppCompatActivity {
|
||||
private PickingLiberoHelper mHelper;
|
||||
private PickingLiberoViewModel mViewModel;
|
||||
|
||||
private int barcodeScannerIstanceID = -1;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@ -30,6 +35,10 @@ public class PickingLiberoActivity extends AppCompatActivity {
|
||||
|
||||
setSupportActionBar(this.mBindings.toolbar);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessfull(mViewModel.onScanSuccessfull)
|
||||
.setOnScanFailed(ex -> UtilityExceptions.defaultException(this, ex, false)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -37,4 +46,12 @@ public class PickingLiberoActivity extends AppCompatActivity {
|
||||
onBackPressed();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
mViewModel.onBackPressed();
|
||||
|
||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,25 +2,48 @@ package it.integry.integrywmsnative.gest.picking_libero.viewmodel;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.text.SpannableString;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.databinding.Observable;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.databinding.ObservableField;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.REST.model.Ean13PesoModel;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.ActivityPickingLiberoBinding;
|
||||
import it.integry.integrywmsnative.gest.picking_libero.core.PickingLiberoHelper;
|
||||
import it.integry.integrywmsnative.gest.vendita.dto.PickingObjectDTO;
|
||||
import it.integry.integrywmsnative.ui.StatusBarAlert;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogSimpleMessageHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArts;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity.QuantityDTO;
|
||||
import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
|
||||
|
||||
public class PickingLiberoViewModel {
|
||||
|
||||
@ -68,6 +91,238 @@ public class PickingLiberoViewModel {
|
||||
(mtbColt.get().getMtbColr() == null || mtbColt.get().getMtbColr().size() == 0));
|
||||
}
|
||||
|
||||
|
||||
public void onBackPressed() {
|
||||
if(thereIsAnOpenedUL.get()) {
|
||||
this.closeLU();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||
|
||||
ProgressDialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
BarcodeManager.disable();
|
||||
|
||||
|
||||
if(UtilityBarcode.isEtichettaAnonima(data)){
|
||||
//Cerco gli articoli presenti nell'ul dell'etichetta anonima
|
||||
this.executeEtichettaLU(data.getStringValue(), progressDialog);
|
||||
} else if(UtilityBarcode.isEtichetta128(data)) {
|
||||
|
||||
//Cerco tramite etichetta ean 128 (che può indicarmi una UL)
|
||||
this.executeEtichettaEan128(data, progressDialog);
|
||||
} else {
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
private void executeEtichettaLU(String sscc, ProgressDialog progressDialog) {
|
||||
ColliMagazzinoRESTConsumer.getBySSCC(sscc, true, false, mtbColtScanned -> {
|
||||
|
||||
if(mtbColtScanned == null) {
|
||||
showNoULFound(() -> {
|
||||
BarcodeManager.enable();
|
||||
progressDialog.dismiss();
|
||||
});
|
||||
} else if((mtbColtScanned.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColtScanned.getGestioneEnum() == GestioneEnum.LAVORAZIONE) && mtbColtScanned.getSegno() > 0) {
|
||||
pickMerceULtoUL(mtbColtScanned, mtbColt.get(), progressDialog);
|
||||
} else {
|
||||
showNoULFound(() -> {
|
||||
BarcodeManager.enable();
|
||||
progressDialog.dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
}, ex -> {
|
||||
showNoULFound(() -> {
|
||||
BarcodeManager.enable();
|
||||
progressDialog.dismiss();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO, ProgressDialog progressDialog) {
|
||||
BarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
||||
|
||||
String barcodeProd = null;
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Content)) barcodeProd = ean128Model.Content;
|
||||
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)){
|
||||
this.executeEtichettaLU(ean128Model.Sscc, progressDialog);
|
||||
} else {
|
||||
showNoULFound(() -> {
|
||||
BarcodeManager.enable();
|
||||
progressDialog.dismiss();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
|
||||
showNoULFound(() -> {
|
||||
BarcodeManager.enable();
|
||||
progressDialog.dismiss();
|
||||
});
|
||||
}
|
||||
}, ex-> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void pickMerceULtoUL(MtbColt sourceMtbColt, MtbColt destMtbColt, ProgressDialog progressDialog) {
|
||||
List<MtbColr> mtbColrsToPick = Stream.of(sourceMtbColt.getMtbColr())
|
||||
.filter(x -> x.getQtaCol().floatValue() > 0)
|
||||
.toList();
|
||||
|
||||
DialogChooseArtsFromListaArts.make(mContext, mtbColrsToPick, pickedAarts -> {
|
||||
|
||||
progressDialog.dismiss();
|
||||
|
||||
List<MtbColr> destNewMtbColr = new ArrayList<>();
|
||||
|
||||
askQuantities(pickedAarts.iterator(), destNewMtbColr, () -> {
|
||||
|
||||
if(destNewMtbColr != null && destNewMtbColr.size() > 0){
|
||||
MtbColt clonedTestata = (MtbColt) destMtbColt.clone();
|
||||
ObservableArrayList<MtbColr> mtbColrObservableField = new ObservableArrayList<>();
|
||||
|
||||
for(int i = 0; i < destNewMtbColr.size(); i++) {
|
||||
MtbColr cloneMtbColr = (MtbColr) destNewMtbColr.get(i).clone();
|
||||
|
||||
cloneMtbColr
|
||||
.setGestioneRif(cloneMtbColr.getGestione())
|
||||
.setGestione(null);
|
||||
|
||||
cloneMtbColr
|
||||
.setSerColloRif(cloneMtbColr.getSerCollo())
|
||||
.setSerCollo(null);
|
||||
|
||||
cloneMtbColr
|
||||
.setNumColloRif(cloneMtbColr.getNumCollo())
|
||||
.setNumCollo(null);
|
||||
|
||||
cloneMtbColr
|
||||
.setDataColloRif(cloneMtbColr.getDataColloS())
|
||||
.setDataCollo(null);
|
||||
|
||||
mtbColrObservableField.add(cloneMtbColr);
|
||||
}
|
||||
|
||||
clonedTestata.setMtbColr(mtbColrObservableField);
|
||||
|
||||
saveLU(clonedTestata);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}, () -> {
|
||||
progressDialog.dismiss();
|
||||
BarcodeManager.enable();
|
||||
}).show();
|
||||
}
|
||||
|
||||
|
||||
private void askQuantities(Iterator<MtbColr> sourceMtbColrs, List<MtbColr> destMtbColr, Runnable onComplete){
|
||||
|
||||
if(sourceMtbColrs.hasNext()){
|
||||
|
||||
askSingleQuantity(sourceMtbColrs.next(), mtbColr -> {
|
||||
destMtbColr.add(mtbColr);
|
||||
askQuantities(sourceMtbColrs, destMtbColr, onComplete);
|
||||
});
|
||||
} else {
|
||||
onComplete.run();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void askSingleQuantity(MtbColr mtbColr, RunnableArgs<MtbColr> onComplete) {
|
||||
DialogInputQuantity.DTO dto = new DialogInputQuantity.DTO()
|
||||
.setBatchLot(mtbColr.getPartitaMag())
|
||||
.setDataScad(mtbColr.getDataScadPartitaD())
|
||||
.setMtbAart(mtbColr.getMtbAart())
|
||||
.setQtaTot(mtbColr.getQtaCol())
|
||||
.setQtaOrd(mtbColr.getQtaCol())
|
||||
.setQtaDaEvadere(new BigDecimal(-1))
|
||||
.setQtaEvasa(BigDecimal.ZERO)
|
||||
.setCanPartitaMagBeChanged(false)
|
||||
.setCanDataScadBeChanged(false)
|
||||
.setMaxQta(mtbColr.getQtaCol());
|
||||
|
||||
DialogInputQuantity.makeBase(mContext, dto, false, quantityDTO -> {
|
||||
mtbColr
|
||||
.setQtaCol(new BigDecimal(quantityDTO.qtaTot.get()))
|
||||
.setQtaCnf(new BigDecimal(quantityDTO.qtaCnf.get()))
|
||||
.setNumCnf(new BigDecimal(quantityDTO.numCnf.get()))
|
||||
.setDatetimeRow(new Date());
|
||||
|
||||
onComplete.run(mtbColr);
|
||||
}).show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void saveLU(MtbColt mtbColtToSave) {
|
||||
mtbColtToSave.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
for(int i = 0; i < mtbColtToSave.getMtbColr().size(); i++) {
|
||||
mtbColtToSave.getMtbColr().get(i).setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
}
|
||||
|
||||
ProgressDialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColtToSave, value -> {
|
||||
mtbColt.get().getMtbColr().addAll(mtbColtToSave.getMtbColr());
|
||||
|
||||
for(int i = 0; i < mtbColt.get().getMtbColr().size(); i++) {
|
||||
mtbColt.get().getMtbColr().get(i).setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||
}
|
||||
|
||||
progressDialog.dismiss();
|
||||
BarcodeManager.enable();
|
||||
}, ex -> {
|
||||
BarcodeManager.enable();
|
||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void showDataSavedDialog() {
|
||||
|
||||
DialogSimpleMessageHelper.makeSuccessDialog(
|
||||
mContext,
|
||||
mContext.getResources().getString(R.string.completed),
|
||||
new SpannableString(mContext.getResources().getString(R.string.data_saved)),
|
||||
null, null).show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void showNoULFound(Runnable onComplete) {
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mContext,
|
||||
new SpannableString(mContext.getResources().getText(R.string.no_lu_found_message)),
|
||||
null, onComplete).show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void createNewLU() {
|
||||
createNewLU(null, null, null);
|
||||
}
|
||||
@ -79,7 +334,6 @@ public class PickingLiberoViewModel {
|
||||
MtbColt mtbColt = new MtbColt();
|
||||
mtbColt .setGestione(GestioneEnum.VENDITA)
|
||||
.setSegno(-1)
|
||||
//.setCodAnag(defaultCodAnagOfUL)
|
||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
if(customNumCollo != null) {
|
||||
@ -159,17 +413,4 @@ public class PickingLiberoViewModel {
|
||||
);
|
||||
}
|
||||
|
||||
/*public boolean thereIsAnOpenedUL() {
|
||||
return this.mtbColt.get() != null;
|
||||
}
|
||||
public boolean thereIsAnyRowInUL() {
|
||||
return this.mtbColt.get() != null &&
|
||||
this.mtbColt.get().getMtbColr() != null &&
|
||||
this.mtbColt.get().getMtbColr().size() > 0;
|
||||
}
|
||||
|
||||
public boolean thereIsAnULWithoutRows() {
|
||||
return thereIsAnOpenedUL() && !thereIsAnyRowInUL();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
@ -6,10 +6,14 @@ import android.os.Parcelable;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
@ -43,6 +47,8 @@ public class PickingObjectDTO implements Parcelable {
|
||||
private Boolean tempHidden = null;
|
||||
private PickData tempPickData = null;
|
||||
|
||||
private List<MtbColr> withdrawRows = new ArrayList<>();
|
||||
|
||||
protected PickingObjectDTO(Parcel in) {
|
||||
if (in.readByte() == 0) {
|
||||
numCollo = null;
|
||||
@ -417,12 +423,22 @@ public class PickingObjectDTO implements Parcelable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbColr> getWithdrawRows() {
|
||||
return withdrawRows;
|
||||
}
|
||||
|
||||
public PickingObjectDTO setWithdrawRows(List<MtbColr> withdrawRows) {
|
||||
this.withdrawRows = withdrawRows;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static class PickData {
|
||||
private String batchLot;
|
||||
private BigDecimal qtaTot;
|
||||
private BigDecimal qtaCnf;
|
||||
private BigDecimal numCnf;
|
||||
private Date dataScad;
|
||||
private MtbColt sourceMtbColt;
|
||||
|
||||
|
||||
public String getBatchLot() {
|
||||
@ -470,7 +486,14 @@ public class PickingObjectDTO implements Parcelable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbColt getSourceMtbColt() {
|
||||
return sourceMtbColt;
|
||||
}
|
||||
|
||||
public PickData setSourceMtbColt(MtbColt sourceMtbColt) {
|
||||
this.sourceMtbColt = sourceMtbColt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static PickData fromEan128(Ean128Model ean128Model) {
|
||||
PickingObjectDTO.PickData pickData = null;
|
||||
|
||||
@ -133,13 +133,14 @@ public class VenditaOrdineInevasoHelper {
|
||||
|
||||
if(mtbColrs != null) {
|
||||
|
||||
List<MtbColr> filteredMtbColrs = Stream.of(mtbColrs).filter(
|
||||
x -> x.getCodMart().equalsIgnoreCase(item.getCodMart()) &&
|
||||
((x.getCodJcom() == null && item.getCodJcom() == null) || (x.getCodJcom() != null && x.getCodJcom().equalsIgnoreCase(item.getCodJcom()))) &&
|
||||
(!SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV() || (SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV() && ((x.getPartitaMag() == null && item.getPartitaMag() == null) || (x.getPartitaMag() != null && x.getPartitaMag().equalsIgnoreCase(item.getPartitaMag()))))) &&
|
||||
((x.getNumColloRif() == null && item.getNumCollo() == null) || (x.getNumColloRif() != null && x.getNumColloRif().equals(item.getNumCollo())))).toList();
|
||||
|
||||
for (MtbColr mtbColr : filteredMtbColrs) {
|
||||
// List<MtbColr> filteredMtbColrs = Stream.of(mtbColrs).filter(
|
||||
// x -> x.getCodMart().equalsIgnoreCase(item.getCodMart()) &&
|
||||
// ((x.getCodJcom() == null && item.getCodJcom() == null) || (x.getCodJcom() != null && x.getCodJcom().equalsIgnoreCase(item.getCodJcom()))) &&
|
||||
// (!SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV() || (SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV() && ((x.getPartitaMag() == null && item.getPartitaMag() == null) || (x.getPartitaMag() != null && x.getPartitaMag().equalsIgnoreCase(item.getPartitaMag()))))) &&
|
||||
// ((x.getNumColloRif() == null && item.getNumCollo() == null) || (x.getNumColloRif() != null && x.getNumColloRif().equals(item.getNumCollo())))).toList();
|
||||
|
||||
for (MtbColr mtbColr : item.getWithdrawRows()) {
|
||||
currentQtaEvasa = currentQtaEvasa.add(mtbColr.getQtaCol());
|
||||
}
|
||||
}
|
||||
|
||||
@ -235,7 +235,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
for(int i = 0; i < recoveredMtbColt.getMtbColr().size(); i++){
|
||||
|
||||
MtbColr currentMtbColr = recoveredMtbColt.getMtbColr().get(i);
|
||||
// MtbColr currentMtbColr = recoveredMtbColt.getMtbColr().get(i);
|
||||
|
||||
// List<OrdineAccettazioneDTO.Riga> foundRows = Stream.of(groupedOrdini)
|
||||
// .filter(x -> x.getNumOrd() == currentMtbColr.getNumOrd() &&
|
||||
@ -438,20 +438,21 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
|
||||
//Cerco se devo fare pick dell'articolo tramite codMart perché forse non risulta in nessun collo
|
||||
if(matchPickingObject != null && matchPickingObject.size() == 0 && scannedUL.getMtbColr() != null && scannedUL.getMtbColr().size() > 0) {
|
||||
//if(matchPickingObject != null && matchPickingObject.size() == 0 && scannedUL.getMtbColr() != null && scannedUL.getMtbColr().size() > 0) {
|
||||
List<String> listOfCodMartsInRowCollo = Stream.of(scannedUL.getMtbColr())
|
||||
.map(MtbColr::getCodMart)
|
||||
.withoutNulls()
|
||||
.toList();
|
||||
|
||||
matchPickingObject = Stream.of(pickingList)
|
||||
.filter(x -> x.getNumCollo() == null &&
|
||||
List<PickingObjectDTO> matchPickingObjectByArt = Stream.of(pickingList)
|
||||
.filter(x -> //x.getNumCollo() == null &&
|
||||
(listOfCodMartsInRowCollo.contains(x.getCodMart())))
|
||||
.toList();
|
||||
|
||||
|
||||
if(SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV()) {
|
||||
for (int i = 0; i < matchPickingObject.size(); i++) {
|
||||
PickingObjectDTO tmpPickObj = matchPickingObject.get(i);
|
||||
for (int i = 0; i < matchPickingObjectByArt.size(); i++) {
|
||||
PickingObjectDTO tmpPickObj = matchPickingObjectByArt.get(i);
|
||||
|
||||
|
||||
|
||||
@ -462,7 +463,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
boolean anyMatch = matchWithPartitaMag.size() > 0;
|
||||
|
||||
if(!anyMatch) {
|
||||
matchPickingObject.remove(i);
|
||||
matchPickingObjectByArt.remove(i);
|
||||
i--;
|
||||
} else if(matchWithPartitaMag.size() == 1){
|
||||
MtbColr matchRow = matchWithPartitaMag.get(0);
|
||||
@ -472,15 +473,17 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.setDataScad(matchRow.getDataScadPartitaD())
|
||||
.setNumCnf(matchRow.getNumCnf())
|
||||
.setQtaCnf(matchRow.getQtaCnf())
|
||||
.setQtaTot(matchRow.getQtaCol());
|
||||
.setQtaTot(matchRow.getQtaCol())
|
||||
.setSourceMtbColt(scannedUL);
|
||||
|
||||
tmpPickObj.setTempPickData(pickData);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < matchPickingObject.size(); i++) {
|
||||
|
||||
PickingObjectDTO tmpPickObj = matchPickingObject.get(i);
|
||||
} else {
|
||||
for (int i = 0; i < matchPickingObjectByArt.size(); i++) {
|
||||
|
||||
PickingObjectDTO tmpPickObj = matchPickingObjectByArt.get(i);
|
||||
List<MtbColr> matchWithColloRow = Stream.of(scannedUL.getMtbColr())
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(tmpPickObj.getCodMart())).toList();
|
||||
|
||||
@ -492,7 +495,8 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.setDataScad(matchRow.getDataScadPartitaD())
|
||||
.setNumCnf(matchRow.getNumCnf())
|
||||
.setQtaCnf(matchRow.getQtaCnf())
|
||||
.setQtaTot(matchRow.getQtaCol());
|
||||
.setQtaTot(matchRow.getQtaCol())
|
||||
.setSourceMtbColt(scannedUL);
|
||||
|
||||
tmpPickObj.setTempPickData(pickData);
|
||||
}
|
||||
@ -501,7 +505,10 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//}
|
||||
matchPickingObject.addAll(matchPickingObjectByArt);
|
||||
|
||||
this.loadMatchedRows(matchPickingObject);
|
||||
|
||||
@ -913,7 +920,16 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.setDescrizione(item.getDescrizioneEstesa())
|
||||
.setDatetimeRow(new Date());
|
||||
|
||||
if(item.getNumCollo() != null) {
|
||||
if(item.getTempPickData() != null && item.getTempPickData().getSourceMtbColt() != null) {
|
||||
MtbColt sourceMtbColt = item.getTempPickData().getSourceMtbColt();
|
||||
|
||||
mtbColr
|
||||
.setCodJcom(UtilityString.empty2null(item.getCodJcom()))
|
||||
.setSerColloRif(UtilityString.empty2null(sourceMtbColt.getSerCollo()))
|
||||
.setNumColloRif(sourceMtbColt.getNumCollo())
|
||||
.setGestioneRif(UtilityString.empty2null(sourceMtbColt.getGestione()))
|
||||
.setDataColloRif(UtilityString.empty2null(sourceMtbColt.getDataColloS()));
|
||||
} else if(item.getNumCollo() != null) {
|
||||
mtbColr
|
||||
.setCodJcom(UtilityString.empty2null(item.getCodJcom()))
|
||||
.setSerColloRif(UtilityString.empty2null(item.getSerCollo()))
|
||||
@ -945,6 +961,8 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
.setUntMis(item.getMtbAart().getUntMis())
|
||||
.setMtbAart(item.getMtbAart());
|
||||
|
||||
item.getWithdrawRows().add(mtbColr);
|
||||
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.get().getMtbColr().add(mtbColr);
|
||||
|
||||
//Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei
|
||||
|
||||
@ -109,6 +109,7 @@ public class DialogSimpleMessageHelper {
|
||||
.setCustomTitle(titleView)
|
||||
.setView(contentView)
|
||||
// .setMessage(messageText)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(mContext.getText(R.string.ok), (dialog, which) -> {
|
||||
if(onPositiveClick != null) onPositiveClick.run();
|
||||
});
|
||||
|
||||
@ -7,6 +7,8 @@
|
||||
|
||||
<import type="android.view.View"/>
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
|
||||
<variable
|
||||
name="viewmodel"
|
||||
type="it.integry.integrywmsnative.gest.picking_libero.viewmodel.PickingLiberoViewModel" />
|
||||
@ -38,6 +40,49 @@
|
||||
|
||||
</it.integry.plugins.waterfalltoolbar.WaterfallToolbar>
|
||||
|
||||
<net.cachapa.expandablelayout.ExpandableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
app:el_expanded_bind="@{viewmodel.thereIsAnOpenedUL}">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
android:background="@drawable/badge1_round_corner"
|
||||
android:text="@{viewmodel.mtbColt.get().numCollo.toString()}"
|
||||
tools:text="2156"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold"
|
||||
android:visibility="@{!UtilityString.isNullOrEmpty(viewmodel.mtbColt.get().posizione) ? View.VISIBLE : View.GONE}"
|
||||
android:text="@{viewmodel.mtbColt.get().posizione}"
|
||||
tools:text="ME1FS032"/>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</net.cachapa.expandablelayout.ExpandableLayout>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
android:textColor="@color/red_600"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(mtbAart.diacod) ? View.INVISIBLE : View.VISIBLE}"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(mtbAart.diacod) ? View.GONE : View.VISIBLE}"
|
||||
android:layout_alignParentEnd="true"
|
||||
tools:text="DIACOD"/>
|
||||
</RelativeLayout>
|
||||
|
||||
@ -53,7 +53,18 @@
|
||||
tools:text="COD MART" />
|
||||
|
||||
|
||||
<TextView
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{checkableMtbColr.mtbColr.mtbAart.getDiacod()}"
|
||||
android:textColor="@color/red_600"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(checkableMtbColr.mtbColr.mtbAart.diacod) ? View.GONE : View.VISIBLE}"
|
||||
tools:text="DIACOD" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
|
||||
@ -132,6 +132,7 @@
|
||||
|
||||
<string name="already_used_anonymous_barcode"><![CDATA[L\'etichetta scansionata è stata già utilizzata]]></string>
|
||||
<string name="no_result_from_barcode">Il barcode scansionato non ha fornito alcun risultato</string>
|
||||
<string name="multiple_results_from_barcode">Il barcode scansionato ha fornito multipli risultati</string>
|
||||
|
||||
<string name="filtered_arts_in_list">Filtro articoli applicato</string>
|
||||
<string name="remove_filter_button">Rimuovi filtro</string>
|
||||
|
||||
@ -142,6 +142,7 @@
|
||||
|
||||
<string name="already_used_anonymous_barcode">The scanned label has already been used</string>
|
||||
<string name="no_result_from_barcode">The scanned barcode did not produce any results</string>
|
||||
<string name="multiple_results_from_barcode">The scanned barcode produced multiple results</string>
|
||||
|
||||
<string name="filtered_arts_in_list">Item filter applied</string>
|
||||
<string name="remove_filter_button">Remove filter</string>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user