Documento perdite (wms). La possibilità di scaricare l'intera anagrafica puo' essere effettuata soltanto una volta (a cache vuota)

Inserire il campo 'Annotazioni' quando si crea un collo  che sia editabile dall'utente (picking Vendita)
This commit is contained in:
Valerio Castellana 2022-07-13 17:29:26 +02:00
parent 9faf4123ef
commit 4842a6091b
9 changed files with 104 additions and 33 deletions

View File

@ -27,7 +27,6 @@ public class BaseDialogFragment extends DialogFragment {
private boolean mBarcodeListener = false;
@Override
public void show(FragmentManager manager, String tag) {
try {

View File

@ -78,9 +78,9 @@ public class GestSetupRESTConsumer extends _BaseRESTConsumer {
}
public static void getValues(List<StbGestSetup> stbGestSetupList, RunnableArgs<List<StbGestSetup>> onComplete, RunnableArgs<Exception> onFailed) {
public static void getValues(String codMdep, List<StbGestSetup> stbGestSetupList, RunnableArgs<List<StbGestSetup>> onComplete, RunnableArgs<Exception> onFailed) {
GestSetupRESTConsumerService service = RESTBuilder.getService(GestSetupRESTConsumerService.class);
service.getGestSetupValues(stbGestSetupList).enqueue(new Callback<>() {
service.getGestSetupValues(codMdep, stbGestSetupList).enqueue(new Callback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<List<StbGestSetup>>> call, Response<ServiceRESTResponse<List<StbGestSetup>>> response) {
analyzeAnswer(response, "GestSetup", onComplete, onFailed);

View File

@ -28,6 +28,7 @@ public interface GestSetupRESTConsumerService {
@POST("gestSetupList")
Call<ServiceRESTResponse<List<StbGestSetup>>> getGestSetupValues(
@Query("codMdep") String codMdep,
@Body List<StbGestSetup> stbGestSetupList);
}

View File

@ -48,6 +48,7 @@ public class DBSettingsModel {
private int onQtaTotInputChanged = 1;
private boolean flagAccettazioneUseQtaOrd = false;
private boolean flagPickLiberoAllowEmptyDest = false;
private boolean flagAskInfoAggiuntiveSpedizione = false;
public boolean isFlagSpedizioneEnableFakeGiacenza() {
return flagSpedizioneEnableFakeGiacenza;
@ -364,4 +365,13 @@ public class DBSettingsModel {
this.flagOrdinaArticoliOnScan = flagOrdinaArticoliOnScan;
return this;
}
public boolean isFlagAskInfoAggiuntiveSpedizione() {
return flagAskInfoAggiuntiveSpedizione;
}
public DBSettingsModel setFlagAskInfoAggiuntiveSpedizione(boolean flagAskInfoAggiuntiveSpedizione) {
this.flagAskInfoAggiuntiveSpedizione = flagAskInfoAggiuntiveSpedizione;
return this;
}
}

View File

@ -306,9 +306,21 @@ public class SettingsManager {
.setGestName("PICKING")
.setSection("PICKING_LIBERO")
.setKeySection("FLAG_ALLOW_EMPTY_DEST"));
stbGestSetupList.add(new StbGestSetup()
.setGestName("PICKING")
.setSection("SPEDIZIONE")
.setKeySection("FLAG_PRINT_PACKING_LIST_ON_CLOSE"));
stbGestSetupList.add(new StbGestSetup()
.setGestName("PICKING")
.setSection("SPEDIZIONE")
.setKeySection("FLAG_ALLOW_EMPTY_DEST"));
stbGestSetupList.add(new StbGestSetup()
.setGestName("PICKING")
.setSection("SPEDIZIONE")
.setKeySection("FLAG_ASK_INFO_AGGIUNTIVE"));
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
GestSetupRESTConsumer.getValues(stbGestSetupList, list -> {
GestSetupRESTConsumer.getValues(codMdep, stbGestSetupList, list -> {
dbSettingsModelIstance.setDefaultCausaleRettificaGiacenze(getValueFromList(list, "SETUP", "DEFAULT_CAUSALE_RETTIFICA_GIACENZE", String.class));
dbSettingsModelIstance.setEnableCheckPartitaMagCheckPickingV(getValueFromList(list, "SETUP", "ENABLE_CHECK_PARTITA_MAG_PICKING_V", Boolean.class));
dbSettingsModelIstance.setFlagMultiClienteOrdV(getValueFromList(list, "SETUP", "FLAG_MULTI_CLIENTE_ORD_VENDITA", Boolean.class));
@ -333,30 +345,24 @@ public class SettingsManager {
dbSettingsModelIstance.setFlagAccettazioneUseQtaOrd(getValueFromList(list, "ACCETTAZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
dbSettingsModelIstance.setFlagPickLiberoAllowEmptyDest(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_DEST", Boolean.class));
dbSettingsModelIstance.setFlagOrdinaArticoliOnScan(getValueFromList(list, "ORDINI_A", "ORDINA_ARTICOLI_ON_SCAN", Boolean.class));
dbSettingsModelIstance.setFlagPrintPackingListOnOrderClose(getValueFromList(list, "SPEDIZIONE", "FLAG_PRINT_PACKING_LIST_ON_CLOSE", Boolean.class));
dbSettingsModelIstance.setFlagPrintEtichetteOnOrderClose(getValueFromList(list, "SPEDIZIONE", "FLAG_PRINT_ETICHETTE_ON_CLOSE", Boolean.class));
dbSettingsModelIstance.setFlagAskInfoAggiuntiveSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_ASK_INFO_AGGIUNTIVE", Boolean.class));
String notePerdita = getValueFromList(list, "DOC_INTERNI", "NOTE_PERDITA", String.class);
if (notePerdita != null) {
if (notePerdita != null)
dbSettingsModelIstance.setNotePerditaDocInterni(Arrays.asList(notePerdita.split("\\|")));
}
Integer onNumCnfInputChanged = getValueFromList(list, "SETUP", "ON_NUM_CNF_INPUT_CHANGED", Integer.class);
if (onNumCnfInputChanged != null) {
if (onNumCnfInputChanged != null)
dbSettingsModelIstance.setOnNumCnfInputChanged(onNumCnfInputChanged);
}
Integer onQtaTotInputChanged = getValueFromList(list, "SETUP", "ON_QTA_TOT_INPUT_CHANGED", Integer.class);
if (onQtaTotInputChanged != null) {
if (onQtaTotInputChanged != null)
dbSettingsModelIstance.setOnQtaTotInputChanged(onQtaTotInputChanged);
}
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
GestSetupRESTConsumer.getBooleanValue("PICKING", "SPEDIZIONE", "FLAG_PRINT_PACKING_LIST_ON_CLOSE", codMdep, (value) -> {
dbSettingsModelIstance.setFlagPrintPackingListOnOrderClose(value);
GestSetupRESTConsumer.getBooleanValue("PICKING", "SPEDIZIONE", "FLAG_PRINT_ETICHETTE_ON_CLOSE", codMdep, (setupValue) -> {
dbSettingsModelIstance.setFlagPrintEtichetteOnOrderClose(setupValue);
if (onComplete != null) onComplete.run();
}, onFailed);
}, onFailed);
}, onFailed);
}
@ -365,7 +371,7 @@ public class SettingsManager {
StbGestSetup value = Stream.of(stbGestSetupList)
.filter(x -> x.getSection().equalsIgnoreCase(section) && x.getKeySection().equalsIgnoreCase(keySectionName))
.findFirst().get();
.findFirstOrElse(new StbGestSetup());
if (clazz == String.class) {
return clazz.cast(value.getValue());

View File

@ -35,6 +35,13 @@ public class DialogSelectDocInfoViewModel {
public void init(DocInterniSetupDTO initialList) {
this.mDocInterniSetupDTO = initialList;
this.mTipoDoc = null;
this.mGruppoArt = null;
this.mFornitore = null;
this.mDataDoc = null;
this.mNumDoc = null;
this.mNote = null;
this.mListener = null;
}
public String getCodDtip() {

View File

@ -44,6 +44,7 @@ import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
import it.integry.integrywmsnative.core.model.MtbTCol;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
@ -72,6 +73,7 @@ import it.integry.integrywmsnative.view.dialogs.ask_should_print.DialogAskShould
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleInputHelper;
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
import it.integry.integrywmsnative.view.dialogs.choose_batch_lot.DialogChooseBatchLotView;
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.InfoAggiuntiveLUDialog;
import it.integry.integrywmsnative.view.dialogs.input_peso_lu.DialogInputPeso;
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
@ -938,4 +940,9 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
}
}
}
@Override
public void onInfoAggiuntiveRequired(MtbColt mtbColt, RunnableArgss<String, MtbTCol> onComplete) {
InfoAggiuntiveLUDialog.newInstance(mtbColt, onComplete).show(getSupportFragmentManager(), "InfoAggiuntiveLUDialog");
}
}

View File

@ -43,6 +43,7 @@ import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
import it.integry.integrywmsnative.core.model.MtbTCol;
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.report.ReportType;
@ -1617,6 +1618,16 @@ public class SpedizioneViewModel {
} else {
if (mDefaultSegnoCol == -1) {
Runnable saveAction = () -> {
if (SettingsManager.iDB().isFlagAskInfoAggiuntiveSpedizione()) {
this.mListener.onInfoAggiuntiveRequired(mCurrentMtbColt, (note, mtbTcol) -> {
mCurrentMtbColt.setAnnotazioni(note);
if (mtbTcol != null) {
mCurrentMtbColt.setMtbTCol(mtbTcol);
mCurrentMtbColt.setCodTcol(mtbTcol.getCodTcol());
} else {
mCurrentMtbColt.setMtbTCol(null);
mCurrentMtbColt.setCodTcol(null);
}
mColliMagazzinoRESTConsumer.updateDataFine(
mCurrentMtbColt, () -> distribuisciLU((generatedMtbColts) -> {
if (shouldPrint)
@ -1625,6 +1636,18 @@ public class SpedizioneViewModel {
postCloseOperations(generatedMtbColts);
}
}), this::sendError);
});
} else {
mColliMagazzinoRESTConsumer.updateDataFine(
mCurrentMtbColt, () -> distribuisciLU((generatedMtbColts) -> {
if (shouldPrint)
printCollo(generatedMtbColts, () -> this.postCloseOperations(generatedMtbColts));
else {
postCloseOperations(generatedMtbColts);
}
}), this::sendError);
}
};
if (mShouldAskPesoLU) {
@ -1992,6 +2015,7 @@ public class SpedizioneViewModel {
boolean canBatchLotBeChanged,
RunnableArgss<PickedQuantityDTO, Boolean> onComplete);
void onInfoAggiuntiveRequired(MtbColt currentMtbColt, RunnableArgss<String, MtbTCol> onComplete);
void onLUPositionChangeRequest(RunnableArgss<Boolean, MtbDepoPosizione> onComplete);

View File

@ -26,9 +26,11 @@ import it.integry.integrywmsnative.MainApplication;
import it.integry.integrywmsnative.R;
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.model.MtbTCol;
import it.integry.integrywmsnative.core.utility.UtilityDialog;
import it.integry.integrywmsnative.core.utility.UtilityObservable;
import it.integry.integrywmsnative.core.utility.UtilityString;
import it.integry.integrywmsnative.databinding.DialogNoteAggiuntiveNuovaUlBinding;
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.adapter.DialogInputLUProdTipoColloAdapter;
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.adapter.DialogInputLUProdTipoColloListModel;
@ -40,20 +42,24 @@ public class InfoAggiuntiveLUDialog extends BaseDialogFragment implements InfoAg
private DialogNoteAggiuntiveNuovaUlBinding mBindings;
private final RunnableArgss<String, MtbTCol> mOnComplete;
private MtbColt currentMtbColt;
private DialogInputLUProdTipoColloAdapter codTcolArrayAdapter = null;
public ObservableField<String> additionalNotes = new ObservableField<>();
public ObservableField<String> selectedMtbTcol = new ObservableField<>();
public ObservableField<DialogInputLUProdTipoColloListModel> currentMtbTCol = new ObservableField<>();
public static InfoAggiuntiveLUDialog newInstance(@NotNull RunnableArgss<String, MtbTCol> onComplete) {
return new InfoAggiuntiveLUDialog(onComplete);
return new InfoAggiuntiveLUDialog(null, onComplete);
}
private InfoAggiuntiveLUDialog(@NotNull RunnableArgss<String, MtbTCol> onComplete) {
public static InfoAggiuntiveLUDialog newInstance(MtbColt mtbColt, @NotNull RunnableArgss<String, MtbTCol> onComplete) {
return new InfoAggiuntiveLUDialog(mtbColt, onComplete);
}
private InfoAggiuntiveLUDialog(MtbColt mtbColt, @NotNull RunnableArgss<String, MtbTCol> onComplete) {
super();
this.mOnComplete = onComplete;
this.currentMtbColt = mtbColt;
}
@ -121,9 +127,17 @@ public class InfoAggiuntiveLUDialog extends BaseDialogFragment implements InfoAg
this.mViewModel.getTipiCollo().observe(getViewLifecycleOwner(), tipiCollo -> {
codTcolArrayAdapter = new DialogInputLUProdTipoColloAdapter(getActivity(), R.layout.array_adapter_single_item, tipiCollo);
mBindings.filledExposedDropdownCodTcol.setAdapter(codTcolArrayAdapter);
if (currentMtbTCol != null && !UtilityString.isNullOrEmpty(currentMtbColt.getCodTcol()) && UtilityString.isNullOrEmpty(this.selectedMtbTcol.get())) {
MtbTCol tipoPedana = Stream.of(tipiCollo).filter(x -> x.getCodTcol().equalsIgnoreCase(currentMtbColt.getCodTcol())).findFirstOrElse(null);
if (tipoPedana != null) {
this.selectedMtbTcol.set(tipoPedana.getCodTcol() + " - " + tipoPedana.getDescrizione());
}
}
});
this.mBindings.filledExposedDropdownCodTcol.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@ -141,6 +155,9 @@ public class InfoAggiuntiveLUDialog extends BaseDialogFragment implements InfoAg
mBindings.buttonConfirm.setOnClickListener(v -> {
dismiss();
});
}
if (this.currentMtbColt != null) {
this.additionalNotes.set(currentMtbColt.getAnnotazioni());
}
}
}