v1_0_5(8)
This commit is contained in:
commit
d9ac99a700
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
@ -9,8 +9,8 @@ android {
|
||||
applicationId "it.integry.integrywmsnative"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 28
|
||||
versionCode 7
|
||||
versionName "1.0.4"
|
||||
versionCode 8
|
||||
versionName "1.0.5"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
|
||||
@ -52,8 +52,8 @@ public class MainActivity extends AppCompatActivity
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
new ExceptionsHandler(this);
|
||||
|
||||
ExceptionsHandler.init(this);
|
||||
|
||||
PermissionsHelper.askPermissions(this);
|
||||
|
||||
|
||||
@ -23,8 +23,12 @@ public class CommonConst {
|
||||
|
||||
public static class Mail {
|
||||
|
||||
public static String[] forErrorsDebug = {
|
||||
"g.scorrano@integry.it"
|
||||
};
|
||||
|
||||
public static String[] forErrors = {
|
||||
// "syslogs@integry.it",
|
||||
"syslogs@integry.it",
|
||||
"g.scorrano@integry.it"
|
||||
};
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.BuildConfig;
|
||||
import it.integry.integrywmsnative.core.CommonConst;
|
||||
import it.integry.integrywmsnative.core.REST.RESTBuilder;
|
||||
import it.integry.integrywmsnative.core.REST.model.AvailableCodMdepsDTO;
|
||||
@ -124,11 +125,18 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
String currentAzienda = UtilityString.isNullOrEmpty(SettingsManager.i().userSession.profileDB) ? "" : " [" + SettingsManager.i().userSession.profileDB + "]";
|
||||
|
||||
String dest = "";
|
||||
if(BuildConfig.DEBUG) {
|
||||
dest = TextUtils.join(";", CommonConst.Mail.forErrorsDebug);
|
||||
} else {
|
||||
dest = TextUtils.join(";", CommonConst.Mail.forErrors);
|
||||
}
|
||||
|
||||
|
||||
MailRequestDTO mailDTO = new MailRequestDTO()
|
||||
.setFrom("sender@integry.it")
|
||||
.setFromName("WMS Android")
|
||||
.setTo(TextUtils.join(";", CommonConst.Mail.forErrors))
|
||||
.setFromName((BuildConfig.DEBUG ? "[DEBUG] " : "") + "WMS Android")
|
||||
.setTo(dest)
|
||||
.setSubject("Bug notification" + currentAzienda)
|
||||
.setMsgText(message)
|
||||
.setHtml(true);
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Environment;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
@ -11,7 +10,7 @@ import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.BuildConfig;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.view.dialogs.exception.DialogException;
|
||||
|
||||
@ -20,16 +19,22 @@ public class ExceptionsHandler implements Thread.UncaughtExceptionHandler {
|
||||
private final static String TAG = ExceptionsHandler.class.getSimpleName();
|
||||
|
||||
private final Activity context;
|
||||
private final Thread.UncaughtExceptionHandler rootHandler;
|
||||
//private final Thread.UncaughtExceptionHandler rootHandler;
|
||||
|
||||
public ExceptionsHandler(Activity context) {
|
||||
public static void init(Activity context) {
|
||||
new ExceptionsHandler(context);
|
||||
}
|
||||
|
||||
private ExceptionsHandler(Activity context) {
|
||||
this.context = context;
|
||||
// we should store the current exception handler -- to invoke it for all not handled exceptions ...
|
||||
rootHandler = Thread.getDefaultUncaughtExceptionHandler();
|
||||
// we replace the exception handler now with us -- we will properly dispatch the exceptions ...
|
||||
|
||||
if (!BuildConfig.DEBUG) {
|
||||
//rootHandler = Thread.getDefaultUncaughtExceptionHandler();
|
||||
Thread.setDefaultUncaughtExceptionHandler(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uncaughtException(final Thread thread, final Throwable ex) {
|
||||
try {
|
||||
|
||||
@ -428,8 +428,9 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
progress.dismiss();
|
||||
resetMtbColt(openNewOne);
|
||||
}
|
||||
})
|
||||
, ex ->
|
||||
}), () -> {
|
||||
progress.dismiss();
|
||||
}, ex ->
|
||||
UtilityExceptions.defaultException(mContext, ex, progress)
|
||||
);
|
||||
|
||||
@ -440,6 +441,8 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
} else {
|
||||
resetMtbColt(openNewOne);
|
||||
}
|
||||
}, () -> {
|
||||
progress.dismiss();
|
||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
||||
}
|
||||
} else {
|
||||
@ -478,13 +481,13 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
});
|
||||
}
|
||||
|
||||
private void posizionaCollo(Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
private void posizionaCollo(Runnable onComplete, Runnable onAbort, RunnableArgs<Exception> onFailed) {
|
||||
DialogAskPositionOfLU.makeBase(mContext, mtbColt.get(), mtbDepoPosizione -> {
|
||||
if(mtbDepoPosizione != null) {
|
||||
mtbColt.get().setPosizione(mtbDepoPosizione.getPosizione());
|
||||
onComplete.run();
|
||||
} else {
|
||||
onFailed.run(null);
|
||||
onAbort.run();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@ 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;
|
||||
|
||||
@ -230,7 +231,7 @@ public class VersamentoMerceViewModel {
|
||||
progressDialog.dismiss();
|
||||
BarcodeManager.enable();
|
||||
|
||||
resetMtbColt();
|
||||
showDataSavedDialog();
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||
BarcodeManager.enable();
|
||||
@ -323,7 +324,13 @@ public class VersamentoMerceViewModel {
|
||||
.setCanDataScadBeChanged(false)
|
||||
.setMaxQta(mtbColr.getQtaCol());
|
||||
|
||||
DialogInputQuantity.makeBase(mContext, dto, false, value -> {
|
||||
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();
|
||||
}
|
||||
@ -358,7 +365,7 @@ public class VersamentoMerceViewModel {
|
||||
|
||||
|
||||
ColliMagazzinoRESTConsumer.saveCollo(mtbColt, value -> {
|
||||
resetMtbColt();
|
||||
showDataSavedDialog();
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex);
|
||||
});
|
||||
@ -374,7 +381,6 @@ public class VersamentoMerceViewModel {
|
||||
new SpannableString(mContext.getResources().getString(R.string.data_saved)),
|
||||
null, () -> {
|
||||
resetMtbColt();
|
||||
openLU();
|
||||
}).show();
|
||||
|
||||
}
|
||||
|
||||
@ -44,6 +44,8 @@ public class DialogAskPositionOfLU {
|
||||
|
||||
private TextInputLayout livelloTextInputLayout;
|
||||
|
||||
private boolean completedFlow = false;
|
||||
|
||||
public static Dialog makeBase(final Context context, MtbColt mtbColtToUpdate, RunnableArgs<MtbDepoPosizione> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
return new DialogAskPositionOfLU(context, mtbColtToUpdate, onComplete, onFailed).mDialog;
|
||||
}
|
||||
@ -124,6 +126,7 @@ public class DialogAskPositionOfLU {
|
||||
|
||||
mDialog.setOnDismissListener(dialog -> {
|
||||
BarcodeManager.removeCallback(barcodeIstanceID);
|
||||
if(!completedFlow) onComplete.run(null);
|
||||
});
|
||||
|
||||
}
|
||||
@ -145,10 +148,16 @@ public class DialogAskPositionOfLU {
|
||||
askLivello();
|
||||
} else {
|
||||
updatePosizione(foundPosizione, () -> {
|
||||
completedFlow = true;
|
||||
if(onComplete != null) onComplete.run(foundPosizione);
|
||||
}, onFailed);
|
||||
}, ex -> {
|
||||
completedFlow = true;
|
||||
onFailed.run(ex);
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
} else {
|
||||
BarcodeManager.enable();
|
||||
@ -169,10 +178,12 @@ public class DialogAskPositionOfLU {
|
||||
|
||||
ColliMagazzinoRESTConsumer.changePosizione(mtbColt, foundPosizione, () -> {
|
||||
progressDialog.dismiss();
|
||||
completedFlow = true;
|
||||
onComplete.run(foundPosizione);
|
||||
mDialog.dismiss();
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||
completedFlow = true;
|
||||
onFailed.run(ex);
|
||||
mDialog.dismiss();
|
||||
});
|
||||
@ -202,6 +213,7 @@ public class DialogAskPositionOfLU {
|
||||
|
||||
|
||||
private void onLevelAbort() {
|
||||
completedFlow = true;
|
||||
onComplete.run(null);
|
||||
mDialog.dismiss();
|
||||
}
|
||||
|
||||
@ -287,7 +287,7 @@ public class DialogInputQuantity {
|
||||
|
||||
private void setupQuantities(DTO dto, QuantityDTO quantityDTO){
|
||||
if(dto.getQtaTot() != null) quantityDTO.qtaTot.set(dto.getQtaTot().floatValue());
|
||||
if(dto.getMaxQta() != null) quantityDTO.maxQta = dto.getMaxQta().floatValue();
|
||||
if(dto.getMaxQta() != null) quantityDTO.maxQta.set(dto.getMaxQta().floatValue());
|
||||
|
||||
float qtaDisponibile = dto.getQtaDisponibile() != null ? dto.getQtaDisponibile().floatValue() : 0f;
|
||||
if (qtaDisponibile < 0) {
|
||||
@ -616,7 +616,7 @@ public class DialogInputQuantity {
|
||||
|
||||
showExpireDateErrorPrompt(context);
|
||||
|
||||
} else if(!quantityDTO.canOverflowQuantity && quantityDTO.qtaTot.get() > quantityDTO.maxQta) {
|
||||
} else if(!quantityDTO.canOverflowQuantity && quantityDTO.qtaTot.get() > quantityDTO.maxQta.get()) {
|
||||
|
||||
showQuantityOverflowErrorPrompt(context);
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ public class QuantityDTO {
|
||||
public boolean qtaCnfNotificationEnabled = true;
|
||||
public boolean qtaTotNotificationEnabled = true;
|
||||
public boolean canOverflowQuantity = false;
|
||||
public Float maxQta = 0f;
|
||||
public BindableFloat maxQta = new BindableFloat();
|
||||
|
||||
|
||||
public BindableBoolean canPartitaMagBeChanged = new BindableBoolean(true);
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_horizontal"
|
||||
style="@style/TextViewMaterial"
|
||||
android:text="Scansiona il codice a barre di una UL"/>
|
||||
android:text="Scansiona il codice a barre di uno Scaffale"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
Loading…
x
Reference in New Issue
Block a user