Implementato versamento in depositi diversi da quello dell'utente loggato
This commit is contained in:
parent
e1d1878131
commit
aa8a54547c
@ -549,7 +549,9 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
mtbColtToSaveClone.setMtbColr(new ObservableArrayList<>());
|
||||
|
||||
if (posizione == null) mtbColtToSaveClone.setPosizione(null);
|
||||
else mtbColtToSaveClone.setPosizione(posizione.getPosizione());
|
||||
else mtbColtToSaveClone
|
||||
.setPosizione(posizione.getPosizione())
|
||||
.setCodMdep(posizione.getCodMdep());
|
||||
|
||||
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColtToSaveClone, mtbColt -> {
|
||||
if (onComplete != null) onComplete.run();
|
||||
|
||||
@ -8,12 +8,11 @@ import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
@ -28,8 +27,30 @@ public class PosizioniRESTConsumer extends _BaseRESTConsumer{
|
||||
this.mSystemRESTConsumer = systemRESTConsumer;
|
||||
}
|
||||
|
||||
public void getPosizioneFromString(String posizione, RunnableArgs<MtbDepoPosizione> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
String sql = "SELECT TOP 1 mtb_depo_posizioni.*," +
|
||||
" CASE WHEN jtb_fasi.cod_jfas IS NULL THEN 'N' ELSE 'S' END AS flag_linea_produzione " +
|
||||
" FROM mtb_depo_posizioni " +
|
||||
" LEFT OUTER JOIN jtb_fasi " +
|
||||
" ON mtb_depo_posizioni.posizione = jtb_fasi.cod_jfas " +
|
||||
" WHERE posizione = " + UtilityDB.valueToString(posizione);
|
||||
|
||||
SystemRESTConsumer.processSqlStatic(sql, MtbDepoPosizione.class, new ISimpleOperationCallback<MtbDepoPosizione>() {
|
||||
@Override
|
||||
public void onSuccess(MtbDepoPosizione value) {
|
||||
if(onComplete != null) onComplete.run(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(Exception ex) {
|
||||
if(onFailed != null) onFailed.run(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getAvailablePosizioni(RunnableArgs<List<MtbDepoPosizione>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
// String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
String codMdep = null;
|
||||
|
||||
PosizioniRESTConsumerService posizioniRESTConsumerService = RESTBuilder.getService(PosizioniRESTConsumerService.class);
|
||||
posizioniRESTConsumerService.getAvailablePosizioni(codMdep).enqueue(new Callback<ServiceRESTResponse<List<MtbDepoPosizione>>>() {
|
||||
|
||||
@ -33,19 +33,24 @@ public class UtilityBarcode {
|
||||
}
|
||||
|
||||
public static boolean isEtichettaPosizione(BarcodeScanDTO barcodeScanDTO) {
|
||||
return isEtichettaPosizione(barcodeScanDTO, true);
|
||||
}
|
||||
|
||||
public static boolean isEtichettaPosizione(BarcodeScanDTO barcodeScanDTO, boolean enableCheckCodMdep) {
|
||||
String currentCodMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
|
||||
String barcode = barcodeScanDTO.getStringValue();
|
||||
boolean isPosizione = false;
|
||||
|
||||
if(SettingsManager.iDB().getAvailablePosizioni() != null) {
|
||||
Stream<MtbDepoPosizione> tmpStream = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
|
||||
.filter(x -> x.getPosizione().equalsIgnoreCase(barcode));
|
||||
.filter(x -> x.getPosizione().equalsIgnoreCase(barcode) && (!enableCheckCodMdep || currentCodMdep.equalsIgnoreCase(x.getCodMdep())));
|
||||
|
||||
if(tmpStream.count() > 0){
|
||||
isPosizione = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return isPosizione;
|
||||
}
|
||||
|
||||
|
||||
@ -97,7 +97,7 @@ public class VersamentoMerceViewModel {
|
||||
BarcodeManager.disable();
|
||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
if (UtilityBarcode.isEtichettaPosizione(data)) {
|
||||
if (UtilityBarcode.isEtichettaPosizione(data, false)) {
|
||||
progressDialog.show();
|
||||
this.executeEtichettaPosizione(data, progressDialog);
|
||||
} else if (data.getType() == BarcodeType.EAN8 || data.getType() == BarcodeType.EAN13 || data.getType() == BarcodeType.UPCA) {
|
||||
|
||||
@ -199,14 +199,17 @@ public class DialogSimpleMessageView extends BaseDialogFragment {
|
||||
}
|
||||
|
||||
public void onPositiveClick() {
|
||||
dismiss();
|
||||
if(mOnPositiveClick != null) mOnPositiveClick.run();
|
||||
}
|
||||
|
||||
public void onNeutralClick() {
|
||||
dismiss();
|
||||
if(mOnNeutralClick != null) mOnNeutralClick.run();
|
||||
}
|
||||
|
||||
public void onNegativeClick() {
|
||||
dismiss();
|
||||
if(mOnNegativeClick != null) mOnNegativeClick.run();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user