Finish v1_0_36(39)
This commit is contained in:
commit
6cfdbeb8e8
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
@ -17,8 +17,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 38
|
||||
def appVersionName = '1.0.35'
|
||||
def appVersionCode = 39
|
||||
def appVersionName = '1.0.36'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
@ -153,6 +153,8 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
else if(id == R.id.nav_logout){
|
||||
UtilitySettings.logout();
|
||||
ServerStatusChecker.dispose();
|
||||
|
||||
startLoginActivity();
|
||||
}
|
||||
|
||||
|
||||
@ -35,8 +35,6 @@ public class AppContext {
|
||||
|
||||
this.initCrashlytics();
|
||||
|
||||
this.initServerStatusChecker();
|
||||
|
||||
this.initBarcode();
|
||||
|
||||
this.initUtilities();
|
||||
@ -67,10 +65,6 @@ public class AppContext {
|
||||
}
|
||||
}
|
||||
|
||||
private void initServerStatusChecker() {
|
||||
ServerStatusChecker.init();
|
||||
}
|
||||
|
||||
private void initBarcode() {
|
||||
BarcodeManager.init(mContext);
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import android.text.SpannableString;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import it.integry.integrywmsnative.core.REST.watcher.ServerStatusChecker;
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
@ -26,9 +27,15 @@ public class MainContext {
|
||||
});
|
||||
|
||||
this.initReflections();
|
||||
|
||||
this.initServerStatusChecker();
|
||||
}
|
||||
|
||||
|
||||
private void initServerStatusChecker() {
|
||||
ServerStatusChecker.init();
|
||||
}
|
||||
|
||||
private void initDBData(Runnable onComplete) {
|
||||
SettingsManager.loadDBVariables(onComplete, ex -> {
|
||||
DialogSimpleMessageHelper.makeErrorDialog(mContext,
|
||||
|
||||
@ -4,6 +4,9 @@ import androidx.databinding.ObservableArrayList;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
@ -471,7 +474,7 @@ public class MtbColt extends EntityBase implements Parcelable {
|
||||
return posizione;
|
||||
}
|
||||
|
||||
public MtbColt setPosizione(String posizione) {
|
||||
public MtbColt setPosizione(@Nullable String posizione) {
|
||||
this.posizione = posizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -8,7 +8,9 @@ import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
public class UtilityFirebase {
|
||||
|
||||
public static Trace getNewPerformanceTrace(String traceName) {
|
||||
String username = SettingsManager.i().user.fullname ;
|
||||
String username = SettingsManager.i().user != null && !UtilityString.isNullOrEmpty(SettingsManager.i().user.fullname) ?
|
||||
SettingsManager.i().user.fullname :
|
||||
"N / A";
|
||||
|
||||
Trace newTrace = FirebasePerformance.getInstance().newTrace(traceName);
|
||||
|
||||
|
||||
@ -528,18 +528,20 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onColloClosed() {
|
||||
public void onColloClosed(Runnable onComplete) {
|
||||
if(thereIsAnOpenedUL()) {
|
||||
|
||||
final ProgressDialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||
progress.show();
|
||||
|
||||
if(thereIsAnyRowInUL()) {
|
||||
updateDataFine(progress, () -> printCollo(progress));
|
||||
updateDataFine(progress, () -> printCollo(progress, onComplete));
|
||||
} else {
|
||||
deleteCollo(progress);
|
||||
deleteCollo(progress, onComplete);
|
||||
}
|
||||
|
||||
} else {
|
||||
if(onComplete != null) onComplete.run();
|
||||
}
|
||||
|
||||
}
|
||||
@ -565,11 +567,11 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
|
||||
}
|
||||
|
||||
private void printCollo(ProgressDialog progress) {
|
||||
private void printCollo(ProgressDialog progress, Runnable onComplete) {
|
||||
MtbColt currentMtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
||||
|
||||
if(currentMtbColt.getDisablePrint() != null && currentMtbColt.getDisablePrint()){
|
||||
postCloseOperations();
|
||||
postCloseOperations(onComplete);
|
||||
progress.dismiss();
|
||||
return;
|
||||
}
|
||||
@ -589,7 +591,7 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
currentMtbColt,
|
||||
1, reportName, () -> {
|
||||
|
||||
postCloseOperations();
|
||||
postCloseOperations(onComplete);
|
||||
progress.dismiss();
|
||||
|
||||
}, ex -> {
|
||||
@ -602,7 +604,7 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
null,
|
||||
null,
|
||||
R.string.button_ignore_print,
|
||||
() -> postCloseOperations()).show();
|
||||
() -> postCloseOperations(onComplete)).show();
|
||||
});
|
||||
|
||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress)
|
||||
@ -629,7 +631,7 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
}
|
||||
|
||||
|
||||
private void deleteCollo(ProgressDialog progress) {
|
||||
private void deleteCollo(ProgressDialog progress, Runnable onComplete) {
|
||||
|
||||
ColliMagazzinoRESTConsumer.deleteCollo(mArticoliInColloBottomSheetViewModel.mtbColt.get(), () -> {
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
||||
@ -637,8 +639,8 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
isFabVisible.set(true);
|
||||
|
||||
progress.dismiss();
|
||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress)
|
||||
);
|
||||
if(onComplete != null) onComplete.run();
|
||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress));
|
||||
}
|
||||
|
||||
|
||||
@ -653,7 +655,7 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
|
||||
|
||||
|
||||
private void postCloseOperations() {
|
||||
private void postCloseOperations(Runnable onComplete) {
|
||||
|
||||
MtbColt mtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
||||
|
||||
@ -682,6 +684,8 @@ public class AccettazioneOnOrdineAccettazioneInevasoViewModel implements IOnColl
|
||||
removeListFilter();
|
||||
refreshOrderBy(true);
|
||||
|
||||
if(onComplete != null) onComplete.run();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -22,6 +22,7 @@ import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.MainActivity;
|
||||
import it.integry.integrywmsnative.R;
|
||||
@ -469,8 +470,8 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
|
||||
private void posizionaCollo(Runnable onComplete, Runnable onAbort, RunnableArgs<Exception> onFailed) {
|
||||
DialogAskPositionOfLU.makeBase(mContext, mtbColt.get(), mtbDepoPosizione -> {
|
||||
if(mtbDepoPosizione != null) {
|
||||
mtbColt.get().setPosizione(mtbDepoPosizione.getPosizione());
|
||||
if(mtbDepoPosizione != null && mtbColt.get() != null) {
|
||||
Objects.requireNonNull(mtbColt.get()).setPosizione(mtbDepoPosizione.getPosizione());
|
||||
onComplete.run();
|
||||
} else {
|
||||
onAbort.run();
|
||||
|
||||
@ -118,7 +118,7 @@ public class MainVenditaFragment extends Fragment implements ITitledFragment, IS
|
||||
|
||||
ButterKnife.bind(this, mBinding.getRoot());
|
||||
|
||||
mWaterfallToolbar.setRecyclerView(mBinding.venditaMainList);
|
||||
if(mWaterfallToolbar != null) mWaterfallToolbar.setRecyclerView(mBinding.venditaMainList);
|
||||
|
||||
return mBinding.getRoot();
|
||||
}
|
||||
|
||||
@ -72,10 +72,11 @@ public class VenditaOrdineInevasoActivity extends AppCompatActivity {
|
||||
if(mArticoliInColloBottomSheetViewModel.isExpanded()){
|
||||
mArticoliInColloBottomSheetViewModel.collapse();
|
||||
} else if(mVenditaOrdineInevasoViewModel.thereIsAnOpenedUL()) {
|
||||
mArticoliInColloBottomSheetViewModel.closeCurrentUL();
|
||||
|
||||
mArticoliInColloBottomSheetViewModel.closeCurrentUL(() -> {
|
||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||
super.onBackPressed();
|
||||
});
|
||||
|
||||
} else {
|
||||
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||
super.onBackPressed();
|
||||
|
||||
@ -800,21 +800,21 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onColloClosed() {
|
||||
public void onColloClosed(Runnable onComplete) {
|
||||
if(thereIsAnOpenedUL()) {
|
||||
final ProgressDialog progress = ProgressDialog.show(mActivity, mActivity.getText(R.string.waiting),
|
||||
mActivity.getText(R.string.loading) + " ...", true);
|
||||
|
||||
final ProgressDialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
|
||||
progress.show();
|
||||
|
||||
if(thereIsAnyRowInUL()) {
|
||||
updateDataFine(progress, () -> distribuisciCollo(progress, (generatedMtbColts) -> printCollo(progress, generatedMtbColts)));
|
||||
updateDataFine(progress, () -> distribuisciCollo(progress, (generatedMtbColts) -> printCollo(progress, generatedMtbColts, onComplete)));
|
||||
} else {
|
||||
if(mtbColtSessionID != null) ColliDataRecover.closeSession(mtbColtSessionID);
|
||||
deleteCollo(progress);
|
||||
|
||||
deleteCollo(progress, onComplete);
|
||||
}
|
||||
|
||||
} else {
|
||||
if(onComplete != null) onComplete.run();
|
||||
}
|
||||
}
|
||||
|
||||
@ -853,7 +853,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
});
|
||||
}
|
||||
|
||||
private void printCollo(ProgressDialog progress, List<MtbColt> mtbColtsToPrint) {
|
||||
private void printCollo(ProgressDialog progress, List<MtbColt> mtbColtsToPrint, Runnable onComplete) {
|
||||
DialogAskShouldPrint.make(mActivity, "Packing List", shouldPrint -> {
|
||||
|
||||
if(shouldPrint) {
|
||||
@ -864,7 +864,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
if (value.size() > 0) {
|
||||
try {
|
||||
cyclicPrint(mtbColtsToPrint.iterator(), value.get(0), () -> {
|
||||
postCloseOperations(mtbColtsToPrint);
|
||||
postCloseOperations(mtbColtsToPrint, onComplete);
|
||||
progress.dismiss();
|
||||
}, ex -> {
|
||||
progress.dismiss();
|
||||
@ -875,17 +875,17 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
null,
|
||||
null,
|
||||
R.string.button_ignore_print,
|
||||
() -> postCloseOperations(mtbColtsToPrint)).show();
|
||||
() -> postCloseOperations(mtbColtsToPrint, onComplete)).show();
|
||||
});
|
||||
|
||||
} catch (Exception ex) {
|
||||
UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||
postCloseOperations(mtbColtsToPrint);
|
||||
postCloseOperations(mtbColtsToPrint, onComplete);
|
||||
}
|
||||
} else {
|
||||
progress.dismiss();
|
||||
String errorMessage = "Nessuna stampante configurata";
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mActivity, new SpannableString(errorMessage), null, () -> postCloseOperations(mtbColtsToPrint)).show();
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mActivity, new SpannableString(errorMessage), null, () -> postCloseOperations(mtbColtsToPrint, onComplete)).show();
|
||||
}
|
||||
}
|
||||
|
||||
@ -895,7 +895,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
});
|
||||
} else {
|
||||
postCloseOperations(mtbColtsToPrint);
|
||||
postCloseOperations(mtbColtsToPrint, onComplete);
|
||||
progress.dismiss();
|
||||
}
|
||||
}).show();
|
||||
@ -925,7 +925,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
|
||||
|
||||
private void deleteCollo(ProgressDialog progress) {
|
||||
private void deleteCollo(ProgressDialog progress, Runnable onComplete) {
|
||||
|
||||
ColliMagazzinoRESTConsumer.deleteCollo(mArticoliInColloBottomSheetViewModel.mtbColt.get(), () -> {
|
||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
||||
@ -933,6 +933,9 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
isFabVisible.set(true);
|
||||
|
||||
progress.dismiss();
|
||||
|
||||
|
||||
if(onComplete != null) onComplete.run();
|
||||
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress)
|
||||
);
|
||||
}
|
||||
@ -948,7 +951,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
|
||||
|
||||
private void postCloseOperations(List<MtbColt> generatedMtbColt) {
|
||||
private void postCloseOperations(List<MtbColt> generatedMtbColt, Runnable onComplete) {
|
||||
|
||||
MtbColt mtbColt = mArticoliInColloBottomSheetViewModel.mtbColt.get();
|
||||
|
||||
@ -983,6 +986,8 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
removeListFilter();
|
||||
refreshOrderBy(true);
|
||||
|
||||
if(onComplete != null) onComplete.run();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,6 +2,6 @@ package it.integry.integrywmsnative.view.bottomsheet.interfaces;
|
||||
|
||||
public interface IOnColloClosedCallback {
|
||||
|
||||
void onColloClosed();
|
||||
void onColloClosed(Runnable onComplete);
|
||||
|
||||
}
|
||||
|
||||
@ -121,7 +121,11 @@ public class ArticoliInColloBottomSheetViewModel {
|
||||
|
||||
|
||||
public void closeCurrentUL(){
|
||||
if(onCloseColloCallback != null) onCloseColloCallback.onColloClosed();
|
||||
closeCurrentUL(null);
|
||||
}
|
||||
|
||||
public void closeCurrentUL(Runnable onComplete){
|
||||
if(onCloseColloCallback != null) onCloseColloCallback.onColloClosed(onComplete);
|
||||
}
|
||||
|
||||
public boolean isExpanded() {
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
package it.integry.wms.dynamic_customization;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.wms.dynamic_customization.extensions.FiltroOrdiniVendita;
|
||||
import it.integry.wms.dynamic_customization.extensions.OrdiniVendita;
|
||||
|
||||
public class DynamicContext {
|
||||
|
||||
public void init(Context context) {
|
||||
Log.d("DynamicContext", "Caricamento personalizzazioni per VGAlimenti");
|
||||
|
||||
try {
|
||||
ClassRouter.registerPath(ClassRouter.PATH.FILTRO_ORDINI_VENDITA, FiltroOrdiniVendita.class);
|
||||
ClassRouter.registerPath(ClassRouter.PATH.ORDINI_VENDITA, OrdiniVendita.class);
|
||||
} catch (Exception ex) {
|
||||
UtilityExceptions.defaultException(context, ex);
|
||||
}
|
||||
|
||||
Log.d("DynamicContext", "Caricamento personalizzazioni per VGAlimenti COMPLETATO");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
package it.integry.wms.dynamic_customization.extensions;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.IFiltroOrdiniVendita;
|
||||
|
||||
public class FiltroOrdiniVendita implements IFiltroOrdiniVendita {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shoudShowCodMdepFilter() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -1,45 +0,0 @@
|
||||
package it.integry.wms.dynamic_customization.extensions;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.REST.model.DistribuzioneColloDTO;
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.IOrdiniVendita;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.vendita.dto.OrdineVenditaGroupedInevasoDTO;
|
||||
|
||||
public class OrdiniVendita implements IOrdiniVendita {
|
||||
|
||||
@Override
|
||||
public void distribuisciCollo(ProgressDialog progress, MtbColt mtbColt, List<OrdineVenditaGroupedInevasoDTO> testateOrdini, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
|
||||
|
||||
String codMdepOrder = testateOrdini.get(0).ordini.get(0).getCodMdep();
|
||||
|
||||
//Se il deposito del collo è diverso dal deposito dell'utente allora sto "evadendo" la merce per una vendita presente
|
||||
//su un altro deposito
|
||||
if(!UtilityString.isNullOrEmpty(codMdepOrder) &&
|
||||
!codMdepOrder.equalsIgnoreCase(SettingsManager.i().userSession.depo.getCodMdep())) {
|
||||
|
||||
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt,
|
||||
DistribuzioneColloDTO.CriterioDistribuzione.UPDATE,
|
||||
onComplete,
|
||||
onFailed);
|
||||
|
||||
} else {
|
||||
|
||||
ColliMagazzinoRESTConsumer.distribuisciCollo(mtbColt,
|
||||
SettingsManager.iDB().getDefaultCriterioDistribuzione(),
|
||||
onComplete,
|
||||
onFailed);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -5,6 +5,8 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import device.common.DecodeResult;
|
||||
import device.common.ScanConst;
|
||||
import device.sdk.ScanManager;
|
||||
@ -91,9 +93,15 @@ public class PointMobileBarcodeReader implements BarcodeReaderInterface {
|
||||
}
|
||||
|
||||
if(mDecodeResult != null) {
|
||||
String stringValue = null;
|
||||
|
||||
if(mDecodeResult.decodeValue != null && mDecodeResult.decodeValue.length > 0) {
|
||||
stringValue = new String(mDecodeResult.decodeValue, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
BarcodeScanDTO barcodeScanDTO = new BarcodeScanDTO()
|
||||
.setByteValue(mDecodeResult.decodeValue)
|
||||
.setStringValue(mDecodeResult.toString().replaceAll("\n", "").replaceAll("\r", "").trim())
|
||||
.setStringValue(stringValue)
|
||||
.setType(BarcodeType.fromInt(mDecodeResult.symType))
|
||||
.setName(mDecodeResult.symName)
|
||||
.setDecodingTime(mDecodeResult.decodeTimeMillisecond);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user