Finish v1_12_4(133)

This commit is contained in:
Giuseppe Scorrano 2020-03-03 12:15:07 +01:00
commit 161062b694
16 changed files with 224 additions and 217 deletions

View File

@ -17,8 +17,8 @@ apply plugin: 'com.google.gms.google-services'
android {
def appVersionCode = 132
def appVersionName = '1.12.3'
def appVersionCode = 133
def appVersionName = '1.12.4'
signingConfigs {
release {

View File

@ -54,6 +54,8 @@ public class MtbColr extends EntityBase {
private String serDoc;
private Integer numDoc;
private Integer idRigaDoc;
private BigDecimal pesoNettoKg;
private BigDecimal pesoLordoKg;
private MtbAart mtbAart;
@ -489,4 +491,22 @@ public class MtbColr extends EntityBase {
this.idRigaDoc = idRigaDoc;
return this;
}
public BigDecimal getPesoNettoKg() {
return pesoNettoKg;
}
public MtbColr setPesoNettoKg(BigDecimal pesoNettoKg) {
this.pesoNettoKg = pesoNettoKg;
return this;
}
public BigDecimal getPesoLordoKg() {
return pesoLordoKg;
}
public MtbColr setPesoLordoKg(BigDecimal pesoLordoKg) {
this.pesoLordoKg = pesoLordoKg;
return this;
}
}

View File

@ -61,6 +61,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
public static void saveCollo(MtbColt mtbColtToSave, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
MtbColt mtbColtToSaveClone = (MtbColt) mtbColtToSave.clone();
mtbColtToSave.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
mtbColtToSaveClone.setMtbColr(new ObservableArrayList<>());
@ -590,7 +591,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
public static void updateDataFine(Context context, Dialog progress, MtbColt mtbColt, Runnable onComplete) {
public static void updateDataFine(Context context, Dialog progress, MtbColt mtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
MtbColt cloneMtbColt = (MtbColt) mtbColt.clone();
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
@ -601,6 +602,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
onComplete.run();
}, ex -> {
UtilityExceptions.defaultException(context, ex, progress);
if(onFailed != null) onFailed.run(ex);
});
}

View File

@ -10,10 +10,12 @@ import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.model.EsitoType;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.model.EntityBase;
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
@ -22,6 +24,11 @@ public class EntityRESTConsumer {
public static <T extends EntityBase> void processEntity(T entityToSave, final ISimpleOperationCallback<T> callback, Class<T> type){
RunnableArgs<Exception> tmpFailed = ex -> {
// UtilityExceptions.defaultException(null, ex);
if(callback != null) callback.onFailed(ex);
};
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
Call<ServiceRESTResponse<JsonObject>> request = service.processEntity(entityToSave);
request.enqueue(new Callback<ServiceRESTResponse<JsonObject>>() {
@ -37,22 +44,22 @@ public class EntityRESTConsumer {
callback.onSuccess(object);
} else {
Log.e("EntityRESTConsumer", response.body().getErrorMessage());
callback.onFailed(new Exception(response.body().getErrorMessage()));
tmpFailed.run(new Exception(response.body().getErrorMessage()));
}
} else {
Log.e("EntityRESTConsumer", response.message());
callback.onFailed(new Exception(response.message()));
tmpFailed.run(new Exception(response.message()));
}
} else {
Log.e("EntityRESTConsumer", "Status " + response.code() + ": " + response.message());
callback.onFailed(new Exception("Status " + response.code() + ": " + response.message()));
tmpFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
}
}
@Override
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
Log.e("EntityRESTConsumer", t.toString());
callback.onFailed(new Exception(t));
tmpFailed.run(new Exception(t));
}
});
@ -60,6 +67,11 @@ public class EntityRESTConsumer {
public static <T extends EntityBase> void processEntityList(List<T> entitiesToSave, final ISimpleOperationCallback<List<T>> callback, boolean singleTransaction, Class<T> type){
RunnableArgs<Exception> tmpFailed = ex -> {
// UtilityExceptions.defaultException(null, ex);
if(callback != null) callback.onFailed(ex);
};
EntityRESTConsumerService service = RESTBuilder.getService(EntityRESTConsumerService.class);
Call<List<ServiceRESTResponse<JsonObject>>> request = service.processEntityList(singleTransaction, entitiesToSave);
request.enqueue(new Callback<List<ServiceRESTResponse<JsonObject>>>() {
@ -80,7 +92,7 @@ public class EntityRESTConsumer {
responseList.add(gson.fromJson(jsonText, type));
} else {
Log.e("EntityRESTConsumer", jsonSingleObject.getErrorMessage());
callback.onFailed(new Exception(jsonSingleObject.getErrorMessage()));
tmpFailed.run(new Exception(jsonSingleObject.getErrorMessage()));
return;
}
@ -89,18 +101,18 @@ public class EntityRESTConsumer {
callback.onSuccess(responseList);
} else {
Log.e("EntityRESTConsumer", response.message());
callback.onFailed(new Exception(response.message()));
tmpFailed.run(new Exception(response.message()));
}
} else {
Log.e("EntityRESTConsumer", "Status " + response.code() + ": " + response.message());
callback.onFailed(new Exception("Status " + response.code() + ": " + response.message()));
tmpFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
}
}
@Override
public void onFailure(Call<List<ServiceRESTResponse<JsonObject>>> call, Throwable t) {
Log.e("EntityRESTConsumer", t.toString());
callback.onFailed(new Exception(t));
tmpFailed.run(new Exception(t));
}
});

View File

@ -1,7 +1,6 @@
package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.viewmodel;
import android.app.Dialog;
import android.app.ProgressDialog;
import androidx.databinding.ObservableArrayList;
import androidx.databinding.ObservableField;
@ -10,7 +9,6 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import android.text.SpannableString;
import com.annimon.stream.Optional;
import com.annimon.stream.Stream;
import com.tfb.fbtoast.FBToast;
@ -39,7 +37,6 @@ import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.report.ReportManager;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
import it.integry.integrywmsnative.core.utility.UtilityDate;
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
import it.integry.integrywmsnative.core.utility.UtilityLogger;
@ -52,7 +49,7 @@ import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.core.IOnOrdi
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.core.MainListOrdineAccettazioneAdapter;
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.dto.AccettazioneOrdineInevasoOrderBy;
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.rest.OrdineAccettazioneInevasoRESTConsumerService;
import it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.views.NoteAggiuntiveNuovaULDialog;
import it.integry.integrywmsnative.view.dialogs.note_aggiuntive_lu.NoteAggiuntiveLUDialog;
import it.integry.integrywmsnative.view.bottomsheet.interfaces.IOnColloClosedCallback;
import it.integry.integrywmsnative.view.bottomsheet.viewmodel.ArticoliInColloBottomSheetViewModel;
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
@ -439,10 +436,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
}
Dialog finalProgress = progress;
NoteAggiuntiveNuovaULDialog.make(mActivity, new NoteAggiuntiveNuovaULDialog.Callback() {
@Override
public void onSuccess(String noteString) {
NoteAggiuntiveLUDialog.make(mActivity, noteString -> {
//Add loading dialog here
finalProgress.show();
@ -534,13 +528,6 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
});
}, ex -> UtilityExceptions.defaultException(mActivity, ex, finalProgress));
}
@Override
public void onAbort() {
BarcodeManager.enable();
finalProgress.dismiss();
}
}).show();
@ -588,7 +575,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
postCloseOperations(onComplete);
progress.dismiss();
}
});
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress));
} else {
deleteCollo(progress, onComplete);
}

View File

@ -1,57 +0,0 @@
package it.integry.integrywmsnative.gest.accettazione_ordine_inevaso.views;
import android.app.Dialog;
import android.content.Context;
import com.google.android.material.textfield.TextInputEditText;
import androidx.appcompat.app.AlertDialog;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import androidx.databinding.DataBindingUtil;
import it.integry.integrywmsnative.R;
import it.integry.integrywmsnative.core.utility.UtilityDimension;
import it.integry.integrywmsnative.databinding.DialogNoteAggiuntiveNuovaUlBinding;
public class NoteAggiuntiveNuovaULDialog {
private Dialog currentDialog;
public interface Callback {
void onSuccess(String noteString);
void onAbort();
}
public static Dialog make(Context context, final Callback callback) {
return new NoteAggiuntiveNuovaULDialog(context, callback).currentDialog;
}
private NoteAggiuntiveNuovaULDialog(Context context, final Callback callback){
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
DialogNoteAggiuntiveNuovaUlBinding bindings = DataBindingUtil.inflate(inflater, R.layout.dialog_note_aggiuntive_nuova_ul, null, false);
currentDialog = new Dialog(context);
currentDialog.setContentView(bindings.getRoot());
currentDialog.setCanceledOnTouchOutside(false);
currentDialog.setCancelable(false);
currentDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
bindings.buttonConfirm.setOnClickListener(v -> {
currentDialog.dismiss();
callback.onSuccess(bindings.additionalNotesText.getText().toString());
});
bindings.buttonAbort.setOnClickListener(v -> {
currentDialog.dismiss();
callback.onAbort();
});
}
}

View File

@ -170,7 +170,7 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
cyclicRecover(sessionsIterator, onComplete, onFailed);
});
});
}, onFailed);
} else {
ColliDataRecover.closeSession(recoveredMtbColtID);
cyclicRecover(sessionsIterator, onComplete, onFailed);

View File

@ -657,10 +657,10 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
if(thereIsAnyRowInUL.get()) {
updateDataFine(progress, () -> {
ColliMagazzinoRESTConsumer.updateDataFine(mContext, progress, this.mtbColt.get(), () -> {
progress.dismiss();
setULToCurrentContext(null);
}); //() -> distribuisciCollo(progress, () -> printCollo(progress)));
}, null);
} else {
deleteCollo(progress);
}
@ -668,27 +668,6 @@ public class PickingLiberoViewModel implements IRecyclerItemClicked<MtbColr> {
}
}
private void updateDataFine(Dialog progress, Runnable onComplete) {
MtbColt cloneMtbColt = (MtbColt) this.mtbColt.get().clone();
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
cloneMtbColt.setOraFinePrep(UtilityDate.getDateInstance());
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, new ISimpleOperationCallback<MtbColt>() {
@Override
public void onSuccess(MtbColt value) {
if(onComplete != null) onComplete.run();
}
@Override
public void onFailed(Exception ex) {
UtilityExceptions.defaultException(mContext, ex, progress);
}
});
}
private void deleteCollo(Dialog progress) {
//La delete è stata commentata poichè visto che nel WMS vengono sempre presi i RESIDUI,

View File

@ -50,6 +50,7 @@ import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
import it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity;
import it.integry.integrywmsnative.view.dialogs.input_quantity.QuantityDTO;
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
import it.integry.integrywmsnative.view.dialogs.note_aggiuntive_lu.NoteAggiuntiveLUDialog;
public class PickingResiActivity extends BaseActivity implements IOnColloClosedCallback {
@ -362,11 +363,29 @@ public class PickingResiActivity extends BaseActivity implements IOnColloClosedC
progress.show();
if(thereIsAnyRowInUL()) {
NoteAggiuntiveLUDialog.make(this, noteString -> {
MtbColt currentLU = currentMtbColt.get();
Runnable postNoteSave = () -> {
ColliMagazzinoRESTConsumer.updateDataFine(
this,
progress,
currentMtbColt.get(),
() -> printCollo(progress, currentMtbColt.get(), onComplete));
currentLU,
() -> printCollo(progress, currentMtbColt.get(), onComplete),
ex -> UtilityExceptions.defaultException(this, ex, progress));
};
if(!UtilityString.isNullOrEmpty(noteString)) {
currentLU.setAnnotazioni(noteString);
ColliMagazzinoRESTConsumer.saveCollo(currentLU, mtbColt -> {
postNoteSave.run();
}, ex -> UtilityExceptions.defaultException(this, ex, progress));
} else postNoteSave.run();
}).show();
} else {
deleteCollo(progress, onComplete);
}
@ -523,21 +542,7 @@ public class PickingResiActivity extends BaseActivity implements IOnColloClosedC
}
public void applyFilter(String descriptionText) {
// this.mBindings.filteredArtsInListExpandableLayout.expand(true);
//
// this.mBindings.descriptionFilterText.setText(descriptionText);
}
public void removeListFilter() {
// for(int i = 0; i < mPickingList.size(); i++) {
// mPickingList.get(i).setTempHidden(false);
// mPickingList.get(i).setTempPickData(null);
// }
//
// refreshOrderBy(false);
// this.mBindings.filteredArtsInListExpandableLayout.collapse(true);
}

View File

@ -879,7 +879,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
postCloseOperations(generatedMtbColts, onComplete);
progress.dismiss();
}
}));
}), ex -> UtilityExceptions.defaultException(mActivity, ex, progress));
};
if(SettingsManager.iDB().isFlagAskPesoColloSpedizione()) {

View File

@ -14,6 +14,7 @@ import it.integry.integrywmsnative.R;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
import it.integry.integrywmsnative.core.utility.UtilityDialog;
import it.integry.integrywmsnative.databinding.DialogBasketLuBinding;
import it.integry.integrywmsnative.databinding.DialogBasketLuPage1Binding;
import it.integry.integrywmsnative.view.dialogs.basket_lu.interfaces.DialogBasketLU_BaseViewModel;
@ -44,6 +45,10 @@ public class DialogBasketLU_Page1_ViewModel extends DialogBasketLU_BaseViewModel
@Override
public void onShow() {
mBinding.constraintLayout.setMaxHeight((int) (mContext.getResources().getDisplayMetrics().heightPixels * 0.75));
ColliMagazzinoRESTConsumer.retrieveBasketColli(mtbColts -> {
availableMtbColts = mtbColts;
if(mtbColts != null && mtbColts.size() > 0) initRecyclerView(availableMtbColts);

View File

@ -0,0 +1,48 @@
package it.integry.integrywmsnative.view.dialogs.note_aggiuntive_lu;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import androidx.databinding.DataBindingUtil;
import it.integry.integrywmsnative.R;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.databinding.DialogNoteAggiuntiveNuovaUlBinding;
public class NoteAggiuntiveLUDialog {
private Dialog mDialog;
public static Dialog make(Context context, final RunnableArgs<String> onComplete) {
return new NoteAggiuntiveLUDialog(context, onComplete).mDialog;
}
private NoteAggiuntiveLUDialog(Context context, final RunnableArgs<String> onComplete){
LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE );
DialogNoteAggiuntiveNuovaUlBinding bindings = DataBindingUtil.inflate(inflater, R.layout.dialog_note_aggiuntive_nuova_ul, null, false);
mDialog = new Dialog(context);
mDialog.setContentView(bindings.getRoot());
mDialog.setCanceledOnTouchOutside(false);
mDialog.setCancelable(false);
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
bindings.buttonConfirm.setOnClickListener(v -> {
mDialog.dismiss();
if(onComplete != null) onComplete.run(bindings.additionalNotesText.getText().toString());
});
bindings.buttonAbort.setOnClickListener(v -> {
mDialog.dismiss();
if(onComplete != null) onComplete.run(null);
});
}
}

View File

@ -1,14 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/constraint_layout"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/dialog_basket_lu__main_list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
@ -68,5 +73,5 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -50,7 +50,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextViewMaterial.DialogTitle"
android:text="@string/action_create_ul"
android:text="@string/lu_info"
android:gravity="center_horizontal"/>
<!--<TextView-->
@ -65,7 +65,6 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@ -34,6 +34,7 @@
<string name="scan_item">Scansiona il codice a barre di un <b>articolo</b></string>
<string name="please_open_lu">Prima di procedere apri una <b>nuova UL</b></string>
<string name="extra_item">Articolo extra</string>
<string name="lu_info">Info UL</string>
<string name="action_settings">Impostazioni</string>

View File

@ -75,6 +75,7 @@
<string name="action_insert_weight">Insert weight</string>
<string name="action_show_created_ul">Show already created LU</string>
<string name="dialog_input_peso_lu_description">Insert info about LU TYPE and NET / GROSS weight</string>
<string name="lu_info">LU\'s info</string>
<!-- SETTINGS -->