Compare commits
34 Commits
v1.24.3(27
...
v1.25.1(27
| Author | SHA1 | Date | |
|---|---|---|---|
| 37a16f6292 | |||
| d2249e031a | |||
| 2522e67705 | |||
| 371514157c | |||
| de889045e6 | |||
| 6225ba8207 | |||
| 36c9319bce | |||
| d4d494218b | |||
| a3d6b11c69 | |||
| 852edf1b13 | |||
| 6806290d98 | |||
| 66f7a51462 | |||
| 0e1e69dc9a | |||
| 2ef24fe6e9 | |||
| 54c2d90334 | |||
| 577f2041a1 | |||
| 2f3e74fbfe | |||
| b0fa911322 | |||
| 473b9f22fb | |||
| cc1e1bf221 | |||
| a0c85b3fcb | |||
| 0f41bd99aa | |||
| 7a3a207462 | |||
| 7206b3c37e | |||
| 4cf8b6167f | |||
| b19b438489 | |||
| d3ee6d9ea3 | |||
| dd9789c4f3 | |||
| 67571e3d7a | |||
| a0e17f557d | |||
| 684946bb14 | |||
| 4aab6b1688 | |||
| 310a79f41d | |||
| f8164ca1eb |
@@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 271
|
||||
def appVersionName = '1.24.3'
|
||||
def appVersionCode = 278
|
||||
def appVersionName = '1.25.1'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -78,11 +78,11 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
dynamicFeatures = [":dynamic__base", ":dynamic_vgalimenti"]
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -113,6 +113,7 @@ dependencies {
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||
implementation 'androidx.preference:preference-ktx:1.2.0'
|
||||
implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0"
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||
@@ -164,6 +165,14 @@ dependencies {
|
||||
// testImplementation "org.junit.jupiter:junit-jupiter-api:5.8.1"
|
||||
// androidTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
|
||||
// androidTestImplementation 'org.testng:testng:7.4.0'
|
||||
|
||||
|
||||
//Bluetooth device manager
|
||||
implementation 'com.github.harry1453:android-bluetooth-serial:v1.1'
|
||||
|
||||
// RxJava is also required.
|
||||
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
|
||||
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
|
||||
<application
|
||||
android:name=".MainApplication"
|
||||
|
||||
@@ -7,6 +7,8 @@ import it.integry.integrywmsnative.core.context.AppContext;
|
||||
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivityComponent;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivityModule;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragmentComponent;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragmentModule;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragmentComponent;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragmentModule;
|
||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
||||
@@ -91,6 +93,7 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
MainApplicationModule.class,
|
||||
BaseActivityModule.class,
|
||||
BaseFragmentModule.class,
|
||||
BaseDialogFragmentModule.class,
|
||||
LoginModule.class,
|
||||
MainActivityModule.class,
|
||||
MainFragmentModule.class,
|
||||
@@ -133,6 +136,8 @@ public interface MainApplicationComponent {
|
||||
|
||||
BaseFragmentComponent.Factory baseFragmentComponent();
|
||||
|
||||
BaseDialogFragmentComponent.Factory baseDialogFragmentComponent();
|
||||
|
||||
SplashActivityComponent.Factory splashActivityComponent();
|
||||
|
||||
LoginComponent.Factory loginActivityComponent();
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package it.integry.integrywmsnative.core.exception;
|
||||
|
||||
public class BluetoothConnectionException extends Exception {
|
||||
|
||||
public BluetoothConnectionException(String btDeviceName, String btDeviceMac, Throwable th) {
|
||||
super("Impossibile collegarsi al dispositivo bluetooth: " + btDeviceName + " [" + btDeviceMac + "]. Riprovare.");
|
||||
initCause(th);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -36,6 +36,45 @@ public class BaseActivity extends AppCompatActivity {
|
||||
return v;
|
||||
}
|
||||
|
||||
public void onLoadingStarted() {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
}
|
||||
|
||||
public void onLoadingEnded() {
|
||||
this.closeProgress();
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
public void onError(Exception ex) {
|
||||
this.runOnUiThread(() -> {
|
||||
this.closeProgress();
|
||||
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void openProgress() {
|
||||
BarcodeManager.disable();
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||
this.progressOpened = true;
|
||||
runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
BarcodeManager.enable();
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
runOnUiThread(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
||||
@@ -56,47 +95,4 @@ public class BaseActivity extends AppCompatActivity {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
protected void openProgress() {
|
||||
BarcodeManager.disable();
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||
this.progressOpened = true;
|
||||
runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected void closeProgress() {
|
||||
BarcodeManager.enable();
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
runOnUiThread(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void onLoadingStarted() {
|
||||
// new Thread(() -> {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
// }).start();
|
||||
}
|
||||
|
||||
public void onLoadingEnded() {
|
||||
// new Thread(() -> {
|
||||
this.closeProgress();
|
||||
BarcodeManager.enable();
|
||||
// }).start();
|
||||
}
|
||||
|
||||
public void onError(Exception ex) {
|
||||
this.runOnUiThread(() -> {
|
||||
this.closeProgress();
|
||||
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,19 +11,21 @@ import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||
|
||||
public class BaseDialogFragment extends DialogFragment {
|
||||
|
||||
private boolean mBarcodeListener = false;
|
||||
private DialogProgressView mCurrentProgress;
|
||||
@Inject
|
||||
public DialogProgressView mCurrentProgress;
|
||||
private boolean progressOpened;
|
||||
|
||||
private boolean mBarcodeListener = false;
|
||||
|
||||
public BaseDialogFragment() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@@ -41,6 +43,11 @@ public class BaseDialogFragment extends DialogFragment {
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
MainApplication.appComponent
|
||||
.baseDialogFragmentComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
||||
getDialog().setOnKeyListener((dialog, keyCode, event) -> {
|
||||
if (mBarcodeListener && (event.getAction() == KeyEvent.ACTION_DOWN || event.getAction() == KeyEvent.ACTION_MULTIPLE) && !isControlKey(event)) {
|
||||
@@ -51,6 +58,42 @@ public class BaseDialogFragment extends DialogFragment {
|
||||
}
|
||||
}
|
||||
|
||||
public void onLoadingStarted() {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
}
|
||||
|
||||
public void onLoadingEnded() {
|
||||
this.closeProgress();
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
private void openProgress() {
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||
this.progressOpened = true;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void onError(Exception ex) {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.onLoadingEnded();
|
||||
UtilityExceptions.defaultException(requireActivity(), ex);
|
||||
});
|
||||
}
|
||||
|
||||
private boolean isControlKey(KeyEvent keyEvent) {
|
||||
int keyCode = keyEvent.getKeyCode();
|
||||
return (
|
||||
@@ -65,45 +108,4 @@ public class BaseDialogFragment extends DialogFragment {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void onLoadingStarted() {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
}
|
||||
|
||||
public void onLoadingEnded() {
|
||||
this.closeProgress();
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
protected void openProgress() {
|
||||
|
||||
// new Thread(() -> {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
if (this.mCurrentProgress == null) {
|
||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(requireActivity());
|
||||
}
|
||||
});
|
||||
// }).start();
|
||||
}
|
||||
|
||||
protected void closeProgress() {
|
||||
// new Thread(() -> {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
if (mCurrentProgress != null) {
|
||||
mCurrentProgress.dismiss();
|
||||
mCurrentProgress = null;
|
||||
}
|
||||
});
|
||||
// }).start();
|
||||
}
|
||||
|
||||
|
||||
public void onError(Exception ex) {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.closeProgress();
|
||||
UtilityExceptions.defaultException(requireActivity(), ex);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package it.integry.integrywmsnative.core.expansion;
|
||||
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface BaseDialogFragmentComponent {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
BaseDialogFragmentComponent create();
|
||||
}
|
||||
|
||||
void inject(BaseDialogFragment baseDialogFragment);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.expansion;
|
||||
|
||||
import dagger.Module;
|
||||
|
||||
@Module(subcomponents = BaseDialogFragmentComponent.class)
|
||||
public class BaseDialogFragmentModule {
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.expansion;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -63,6 +64,30 @@ public abstract class BaseFragment extends Fragment {
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
private void openProgress() {
|
||||
Log.d("PROGRESS DIALOG", "OPENED");
|
||||
new Thread(() -> {
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||
this.progressOpened = true;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
Log.d("PROGRESS DIALOG", "CLOSED");
|
||||
new Thread(() -> {
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
public void onError(Exception ex) {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.closeProgress();
|
||||
@@ -81,24 +106,6 @@ public abstract class BaseFragment extends Fragment {
|
||||
}
|
||||
}
|
||||
|
||||
protected void openProgress() {
|
||||
if (!progressOpened) {
|
||||
this.progressOpened = true;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected void closeProgress() {
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected void popMe() {
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
((IPoppableActivity) requireActivity()).pop();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
|
||||
import com.annimon.stream.Optional;
|
||||
@@ -8,6 +10,7 @@ import com.annimon.stream.Stream;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -120,24 +123,24 @@ public class MtbColt extends EntityBase {
|
||||
case ACQUISTO:
|
||||
case LAVORAZIONE:
|
||||
case PRODUZIONE:
|
||||
if(SettingsManager.iDB().getInternalCodAnags() == null) break;
|
||||
if (SettingsManager.iDB().getInternalCodAnags() == null) break;
|
||||
|
||||
Optional<InternalCodAnagsDTO> optCodAnagForn = Stream.of(SettingsManager.iDB().getInternalCodAnags())
|
||||
.filter(InternalCodAnagsDTO::isFornitore)
|
||||
.findFirst();
|
||||
|
||||
if(optCodAnagForn.isEmpty()) break;
|
||||
if (optCodAnagForn.isEmpty()) break;
|
||||
|
||||
codAnagToUse = optCodAnagForn.get().getCodAnag();
|
||||
break;
|
||||
case VENDITA:
|
||||
if(SettingsManager.iDB().getInternalCodAnags() == null) break;
|
||||
if (SettingsManager.iDB().getInternalCodAnags() == null) break;
|
||||
|
||||
Optional<InternalCodAnagsDTO> optCodAnagClie = Stream.of(SettingsManager.iDB().getInternalCodAnags())
|
||||
.filter(InternalCodAnagsDTO::isCliente)
|
||||
.findFirst();
|
||||
|
||||
if(optCodAnagClie.isEmpty()) break;
|
||||
if (optCodAnagClie.isEmpty()) break;
|
||||
|
||||
codAnagToUse = optCodAnagClie.get().getCodAnag();
|
||||
break;
|
||||
@@ -574,9 +577,41 @@ public class MtbColt extends EntityBase {
|
||||
String xmlPrefix = "{\"whereCond\": \"";
|
||||
String xmlSuffix = "\"}";
|
||||
|
||||
StringBuilder whereCond = new StringBuilder();
|
||||
// StringBuilder whereCond = new StringBuilder();
|
||||
String whereCond;
|
||||
List<String> conditions = new ArrayList<>();
|
||||
String existingFilter;
|
||||
if (this.filtroOrdini != null) {
|
||||
existingFilter = this.filtroOrdini;
|
||||
existingFilter = existingFilter.replace(xmlPrefix, "").replace(xmlSuffix, "");
|
||||
conditions.add(existingFilter);
|
||||
} else {
|
||||
existingFilter = "";
|
||||
}
|
||||
|
||||
if (filtroOrdineDtos != null && filtroOrdineDtos.size() > 0) {
|
||||
|
||||
for (FiltroOrdineDTO filtroOrdineDTO : filtroOrdineDtos) {
|
||||
try {
|
||||
String condition = (String.format("(d.g = %s AND d.d = %s and d.n = %s",
|
||||
UtilityDB.valueToString(filtroOrdineDTO.getGestioneOrd()),
|
||||
UtilityDB.valueToString(UtilityDate.formatDate(filtroOrdineDTO.getDataOrdD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH)),
|
||||
UtilityDB.valueToString(filtroOrdineDTO.getNumOrd())));
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(filtroOrdineDTO.getDataConsS())) {
|
||||
condition += (String.format(" AND dr.dc = %s",
|
||||
UtilityDB.valueToString(UtilityDate.formatDate(filtroOrdineDTO.getDataConsD(), UtilityDate.COMMONS_DATE_FORMATS.YMD_SLASH))));
|
||||
}
|
||||
|
||||
condition += ")";
|
||||
if (!existingFilter.contains(condition)) {
|
||||
conditions.add(condition);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/*if (filtroOrdineDtos != null && filtroOrdineDtos.size() > 0) {
|
||||
|
||||
for (int i = 0; i < filtroOrdineDtos.size(); i++) {
|
||||
FiltroOrdineDTO x = filtroOrdineDtos.get(i);
|
||||
@@ -602,7 +637,8 @@ public class MtbColt extends EntityBase {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
||||
whereCond = TextUtils.join(" OR ", conditions);
|
||||
|
||||
this.filtroOrdini = xmlPrefix + whereCond + xmlSuffix;
|
||||
}
|
||||
|
||||
@@ -582,6 +582,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
new Thread(() -> {
|
||||
MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone();
|
||||
MtbColt mtbColtDestClone = (MtbColt) destMtbColt.clone();
|
||||
|
||||
@@ -611,6 +612,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
||||
if (onFailed != null) onFailed.run(new Exception(t));
|
||||
}
|
||||
});
|
||||
}).start();
|
||||
}
|
||||
|
||||
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
@@ -93,7 +93,8 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
||||
&& (!UtilityString.isNullOrEmpty(x.getPartitaMag()) && x.getPartitaMag().equalsIgnoreCase(mtbColr.getPartitaMag())))
|
||||
.findFirst();
|
||||
|
||||
if (optionalMtbPartitaMag.isPresent()) mtbColr.setMtbPartitaMag(optionalMtbPartitaMag.get());
|
||||
if (optionalMtbPartitaMag.isPresent())
|
||||
mtbColr.setMtbPartitaMag(optionalMtbPartitaMag.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -160,7 +161,15 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
||||
service.getArticoliFromOrdini(codMdep, getPickingListDTOs).enqueue(new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<SitArtOrdDTO>>> call, Response<ServiceRESTResponse<List<SitArtOrdDTO>>> response) {
|
||||
analyzeAnswer(response, "retrieveListaArticoliFromOrdiniUscita", onComplete, onFailed);
|
||||
analyzeAnswer(response, "retrieveListaArticoliFromOrdiniUscita", sitArtOrds -> {
|
||||
if (sitArtOrds != null) {
|
||||
for (SitArtOrdDTO sitArtOrd : sitArtOrds) {
|
||||
sitArtOrd.setCodMart(sitArtOrd.getCodMart().trim());
|
||||
}
|
||||
}
|
||||
|
||||
onComplete.run(sitArtOrds);
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -182,13 +191,13 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
|
||||
}
|
||||
|
||||
String baseSql = "SELECT DISTINCT mtb_colt.* " +
|
||||
"FROM mtb_colt, " +
|
||||
" mtb_colr " +
|
||||
"WHERE mtb_colt.gestione = mtb_colr.gestione " +
|
||||
"FROM mtb_colt " +
|
||||
" INNER JOIN mtb_colr ON " +
|
||||
" mtb_colt.gestione = mtb_colr.gestione " +
|
||||
" AND mtb_colt.ser_collo = mtb_colr.ser_collo " +
|
||||
" AND mtb_colt.data_collo = mtb_colr.data_collo " +
|
||||
" AND mtb_colt.num_collo = mtb_colr.num_collo " +
|
||||
" AND " + whereCondGestione +
|
||||
" WHERE " + whereCondGestione +
|
||||
" AND mtb_colt.segno = " + UtilityDB.valueToString(segno) + " " +
|
||||
" AND mtb_colt.data_doc IS NULL AND ";
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import java.util.List;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.BuildConfig;
|
||||
import it.integry.integrywmsnative.core.exception.NoPrintersFoundException;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
@@ -55,7 +54,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
});
|
||||
}
|
||||
|
||||
public void printCollo(Type printerType, MtbColt testataColloToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
public void printCollo(MtbColt testataColloToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
// if (BuildConfig.DEBUG) {
|
||||
// onComplete.run();
|
||||
@@ -64,9 +63,6 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||
Call<ServiceRESTResponse<Object>> callable = null;
|
||||
if (printerType != null)
|
||||
callable = printerService.printCollo(printerType.toString(), testataColloToPrint);
|
||||
else
|
||||
callable = printerService.printCollo(testataColloToPrint);
|
||||
|
||||
callable.enqueue(new Callback<>() {
|
||||
|
||||
@@ -26,13 +26,6 @@ public interface PrinterRESTConsumerService {
|
||||
@Body JasperDTO jasperDTO
|
||||
);
|
||||
|
||||
|
||||
@POST("wms/printEtichettaSSCC")
|
||||
Call<ServiceRESTResponse<Object>> printCollo(
|
||||
@Query("printerType") String printerType,
|
||||
@Body MtbColt mtbColtToPrint
|
||||
);
|
||||
|
||||
@POST("wms/printEtichettaSSCC")
|
||||
Call<ServiceRESTResponse<Object>> printCollo(
|
||||
@Body MtbColt mtbColtToPrint
|
||||
|
||||
@@ -336,7 +336,7 @@ public class DBSettingsModel {
|
||||
}
|
||||
|
||||
|
||||
public boolean getFlagOrdinaArticoliOnScan() {
|
||||
public boolean isFlagOrdinaArticoliOnScan() {
|
||||
return flagOrdinaArticoliOnScan;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,16 +3,15 @@ package it.integry.integrywmsnative.core.utility;
|
||||
import android.Manifest;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import it.integry.integrywmsnative.SplashActivity;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
@@ -31,6 +30,11 @@ public class PermissionsHelper {
|
||||
if(Build.VERSION.SDK_INT >= 23) {
|
||||
//permissionsToAsk.add(Manifest.permission.REQUEST_INSTALL_PACKAGES);
|
||||
}
|
||||
if(Build.VERSION.SDK_INT >= 31) {
|
||||
permissionsToAsk.add(Manifest.permission.BLUETOOTH_CONNECT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
String[] permissionArray = new String[permissionsToAsk.size()];
|
||||
permissionsToAsk.toArray(permissionArray);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package it.integry.integrywmsnative.core.utility;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||
@@ -13,10 +12,5 @@ public class UtilityProgress {
|
||||
return progress;
|
||||
}
|
||||
|
||||
public static DialogProgressView createDefaultProgressDialog(AppCompatActivity mContext, String title, String subtitle) {
|
||||
DialogProgressView progress = DialogProgressView.newInstance(title, subtitle, true);
|
||||
progress.show(mContext.getSupportFragmentManager(), "tag");
|
||||
return progress;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
@@ -76,10 +77,23 @@ public class MainAccettazioneFragment extends BaseFragment implements ISearchabl
|
||||
mAppBarTitle.setText(context.getText(R.string.accettazione_title_fragment).toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
onLoadingEnded();
|
||||
outState.putString("mToolbar", DataCache.addItem(mToolbar));
|
||||
|
||||
super.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
|
||||
if(savedInstanceState != null && savedInstanceState.containsKey("mToolbar"))
|
||||
mToolbar = DataCache.retrieveItem(savedInstanceState.getString("mToolbar"));
|
||||
|
||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_main_accettazione, container, false);
|
||||
|
||||
MainApplication.appComponent
|
||||
|
||||
@@ -44,7 +44,6 @@ import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
@@ -688,13 +687,10 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
}
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
BarcodeManager.disable();
|
||||
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||
BarcodeManager.enable();
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
};
|
||||
|
||||
@@ -705,11 +701,10 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
|
||||
public void createNewLU() {
|
||||
this.mBindings.accettazioneOrdineInevasoFab.close(true);
|
||||
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.createNewLU(null, null, false, () -> {
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -736,7 +731,6 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
Intent myIntent = ListaBancaliActivity.createIntent(this,
|
||||
Stream.of(mtbColts).map(x -> (MtbColt) x).toList(),
|
||||
input -> ((RecoverMtbColt) input).isFlagCanBeRecovered(),
|
||||
PrinterRESTConsumer.Type.SECONDARIA,
|
||||
ReportManager.getReportNameLUFromGestione(GestioneEnum.ACQUISTO));
|
||||
this.startActivityForResult(myIntent, PICK_UL_REQUEST);
|
||||
}
|
||||
@@ -756,7 +750,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
|
||||
@Override
|
||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
DialogSimpleMessageView.makeErrorDialog(
|
||||
new SpannableString(ex.getMessage()),
|
||||
null,
|
||||
@@ -766,16 +760,6 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingStarted() {
|
||||
this.openProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingEnded() {
|
||||
this.closeProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMtbColrEdit(MtbColr mtbColr) {
|
||||
this.mViewModel.dispatchRowEdit(mtbColr);
|
||||
@@ -808,7 +792,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
UtilityToast.showToast(ex.getMessage());
|
||||
|
||||
@@ -837,7 +837,6 @@ public class AccettazionePickingViewModel {
|
||||
cloneMtbColt.setGestione(cloneMtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE ? GestioneEnum.PRODUZIONE : cloneMtbColt.getGestioneEnum());
|
||||
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
PrinterRESTConsumer.Type.SECONDARIA,
|
||||
cloneMtbColt,
|
||||
() -> {
|
||||
this.sendLUSuccessfullyPrinted();
|
||||
|
||||
@@ -45,16 +45,14 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
||||
public ObservableField<Boolean> recoverFabMenuVisible = new ObservableField<>(false);
|
||||
|
||||
private String mReportName;
|
||||
private PrinterRESTConsumer.Type mPrinterType;
|
||||
|
||||
private static class Key {
|
||||
private static final String MtbColtKey = "mtbColtKey";
|
||||
private static final String CanRecoverUL = "canRecoverUL";
|
||||
private static final String PrinterType = "printerType";
|
||||
private static final String ReportName = "reportName";
|
||||
}
|
||||
|
||||
public static Intent createIntent(Context context, MtbColt item, boolean canRecoverUl, PrinterRESTConsumer.Type printerType, String reportName) {
|
||||
public static Intent createIntent(Context context, MtbColt item, boolean canRecoverUl, String reportName) {
|
||||
Intent myIntent = new Intent(context, ContenutoBancaleActivity.class);
|
||||
|
||||
String keyMtbColt = DataCache.addItem(item);
|
||||
@@ -63,9 +61,6 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
||||
String keyCanRecoverUL = DataCache.addItem(canRecoverUl);
|
||||
myIntent.putExtra(Key.CanRecoverUL, keyCanRecoverUL);
|
||||
|
||||
String keyPrinterType = DataCache.addItem(printerType);
|
||||
myIntent.putExtra(Key.PrinterType, keyPrinterType);
|
||||
|
||||
String keyReportName = DataCache.addItem(reportName);
|
||||
myIntent.putExtra(Key.ReportName, keyReportName);
|
||||
|
||||
@@ -79,7 +74,6 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
||||
boolean canRecoverUL = DataCache.retrieveItem(getIntent().getStringExtra(Key.CanRecoverUL));
|
||||
mtbColt.set(DataCache.retrieveItem(getIntent().getStringExtra(Key.MtbColtKey)));
|
||||
mReportName = DataCache.retrieveItem(getIntent().getStringExtra(Key.ReportName));
|
||||
mPrinterType = DataCache.retrieveItem(getIntent().getStringExtra(Key.PrinterType));
|
||||
|
||||
bindings = DataBindingUtil.setContentView(this, R.layout.activity_contenuto_bancale);
|
||||
|
||||
@@ -97,7 +91,7 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
mViewModel.setListener(this);
|
||||
mViewModel.init(mtbColt.get(), mPrinterType, mReportName);
|
||||
mViewModel.init(mtbColt.get(), mReportName);
|
||||
|
||||
recoverFabMenuVisible.set(canRecoverUL);
|
||||
|
||||
@@ -143,7 +137,7 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
|
||||
this.bindings.contenutoBancaleFab.close(true);
|
||||
this.onLoadingStarted();
|
||||
try {
|
||||
this.mPrinterRESTConsumer.printCollo(mPrinterType, mtbColt.get(),
|
||||
this.mPrinterRESTConsumer.printCollo(mtbColt.get(),
|
||||
() -> {
|
||||
this.onLoadingEnded();
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import javax.inject.Inject;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
|
||||
public class ContenutoBancaleViewModel {
|
||||
|
||||
@@ -19,7 +18,7 @@ public class ContenutoBancaleViewModel {
|
||||
this.mDepositoRESTConsumer = depositoRESTConsumer;
|
||||
}
|
||||
|
||||
public void init(MtbColt mtbColt, PrinterRESTConsumer.Type printerType, String defaultReportName) {
|
||||
public void init(MtbColt mtbColt, String defaultReportName) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgsWithReturn;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.databinding.ActivityListaBancaliBinding;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleActivity;
|
||||
import it.integry.integrywmsnative.gest.lista_bancali.ui.ListaColliMainListAdapter;
|
||||
@@ -30,7 +29,6 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
||||
private static class Key {
|
||||
private static final String MtbColtsKey = "mtbColtsKey";
|
||||
private static final String CanRecoverUL = "canRecoverUL";
|
||||
private static final String PrinterType = "printerType";
|
||||
private static final String ReportName = "reportName";
|
||||
private static final String FlagOnlyResiduo = "flagOnlyResiduo";
|
||||
}
|
||||
@@ -43,7 +41,6 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
||||
private final ObservableArrayList<MtbColt> mtbColts = new ObservableArrayList<>();
|
||||
|
||||
private RunnableArgsWithReturn<MtbColt, Boolean> mCanRecoverUl;
|
||||
private PrinterRESTConsumer.Type mPrinterType;
|
||||
private String mReportName;
|
||||
private boolean mFlagOnlyResiduo;
|
||||
|
||||
@@ -51,19 +48,19 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
||||
|
||||
|
||||
|
||||
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, PrinterRESTConsumer.Type printerType, String reportName) {
|
||||
return createIntent(context, items, canRecoverUlAction, printerType, true, reportName);
|
||||
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, String reportName) {
|
||||
return createIntent(context, items, canRecoverUlAction, true, reportName);
|
||||
}
|
||||
|
||||
public static Intent createIntent(Context context, List<MtbColt> items, boolean canRecoverUl, PrinterRESTConsumer.Type printerType, boolean onlyResiduo) {
|
||||
return createIntent(context, items, input -> canRecoverUl, printerType, onlyResiduo);
|
||||
public static Intent createIntent(Context context, List<MtbColt> items, boolean canRecoverUl, boolean onlyResiduo) {
|
||||
return createIntent(context, items, input -> canRecoverUl, onlyResiduo);
|
||||
}
|
||||
|
||||
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, PrinterRESTConsumer.Type printerType, boolean onlyResiduo) {
|
||||
return createIntent(context, items, canRecoverUlAction, printerType, onlyResiduo, null);
|
||||
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, boolean onlyResiduo) {
|
||||
return createIntent(context, items, canRecoverUlAction, onlyResiduo, null);
|
||||
}
|
||||
|
||||
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, PrinterRESTConsumer.Type printerType, boolean onlyResiduo, String reportName) {
|
||||
public static Intent createIntent(Context context, List<MtbColt> items, RunnableArgsWithReturn<MtbColt, Boolean> canRecoverUlAction, boolean onlyResiduo, String reportName) {
|
||||
Intent myIntent = new Intent(context, ListaBancaliActivity.class);
|
||||
|
||||
String mtbColtsKey = DataCache.addItem(items);
|
||||
@@ -72,9 +69,6 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
||||
String canRecoverULKey = DataCache.addItem(canRecoverUlAction);
|
||||
myIntent.putExtra(Key.CanRecoverUL, canRecoverULKey);
|
||||
|
||||
String printerTypeKey = DataCache.addItem(printerType);
|
||||
myIntent.putExtra(Key.PrinterType, printerTypeKey);
|
||||
|
||||
String flagOnlyResiduoKey = DataCache.addItem(onlyResiduo);
|
||||
myIntent.putExtra(Key.FlagOnlyResiduo, flagOnlyResiduoKey);
|
||||
|
||||
@@ -97,7 +91,6 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
||||
|
||||
|
||||
mCanRecoverUl = DataCache.retrieveItem(getIntent().getStringExtra(Key.CanRecoverUL));
|
||||
mPrinterType = DataCache.retrieveItem(getIntent().getStringExtra(Key.PrinterType));
|
||||
mReportName = DataCache.retrieveItem(getIntent().getStringExtra(Key.ReportName));
|
||||
mFlagOnlyResiduo = DataCache.retrieveItem(getIntent().getStringExtra(Key.FlagOnlyResiduo));
|
||||
|
||||
@@ -138,7 +131,7 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
||||
}
|
||||
|
||||
public void startContenutoBancaleActivity(MtbColt item){
|
||||
Intent myIntent = ContenutoBancaleActivity.createIntent(this, item, mCanRecoverUl.run(item), mPrinterType, mReportName);
|
||||
Intent myIntent = ContenutoBancaleActivity.createIntent(this, item, mCanRecoverUl.run(item), mReportName);
|
||||
startActivityForResult(myIntent, PICK_UL_REQUEST);
|
||||
}
|
||||
|
||||
|
||||
@@ -687,21 +687,14 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||
BarcodeManager.enable();
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
};
|
||||
|
||||
private void refreshList(List<OrdiniUscitaElencoDTO> filteredList) {
|
||||
|
||||
// new Thread(() -> {
|
||||
|
||||
// requireActivity().runOnUiThread(() -> {
|
||||
// this.onLoadingStarted();
|
||||
List<OrdiniUscitaElencoDTO> tmpList;
|
||||
|
||||
if (filteredList != null) {
|
||||
@@ -720,12 +713,6 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
|
||||
fabVisible.set(Stream.of(mOrdiniInevasiMutableData)
|
||||
.anyMatch(y -> y.getSelectedObservable().get()));
|
||||
|
||||
// this.onLoadingEnded();
|
||||
// });
|
||||
|
||||
// }).start();
|
||||
|
||||
}
|
||||
|
||||
private List<OrdiniUscitaElencoListModel> convertDataModelToListModel(List<OrdiniUscitaElencoDTO> dataList) {
|
||||
|
||||
@@ -266,13 +266,13 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
null,
|
||||
() -> onComplete.run(true),
|
||||
() -> onComplete.run(false)
|
||||
).show(getActivity().getSupportFragmentManager(), "tag");
|
||||
).show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
this.closeProgress();
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.onLoadingEnded();
|
||||
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
UtilityToast.showToast(ex.getMessage());
|
||||
@@ -287,7 +287,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
@Override
|
||||
public void onLUClienteRequired(RunnableArgss<VtbDest, String> onComplete, Runnable onAbort) {
|
||||
DialogAskClienteView.newInstance(onComplete, onAbort)
|
||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -346,10 +346,10 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
.setPartitaMag(resultDTO.getPartitaMag())
|
||||
.setDataScad(resultDTO.getDataScad());
|
||||
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||
})
|
||||
.setOnAbort(this::closeProgress)
|
||||
.setOnAbort(this::onLoadingEnded)
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
|
||||
@@ -239,24 +239,20 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
||||
return pickingResiListModels;
|
||||
}
|
||||
|
||||
private RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
BarcodeManager.disable();
|
||||
|
||||
this.openProgress();
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewmodel.processBarcodeDTO(data, () -> {
|
||||
BarcodeManager.enable();
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
};
|
||||
|
||||
public void createNewLU() {
|
||||
this.mBindings.mainFab.close(true);
|
||||
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewmodel.createNewLU(null, null, () -> {
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -286,7 +282,7 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
UtilityToast.showToast(ex.getMessage());
|
||||
@@ -332,7 +328,7 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
||||
.setPartitaMag(resultDTO.getPartitaMag())
|
||||
.setDataScad(resultDTO.getDataScad());
|
||||
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||
})
|
||||
.setOnAbort(() -> {
|
||||
@@ -400,7 +396,7 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
||||
|
||||
@Override
|
||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
DialogSimpleMessageView.makeErrorDialog(
|
||||
new SpannableString(ex.getMessage()),
|
||||
null,
|
||||
@@ -409,14 +405,4 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
||||
onComplete)
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingStarted() {
|
||||
this.openProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingEnded() {
|
||||
this.closeProgress();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,7 +218,6 @@ public class PickingResiViewModel {
|
||||
private void singlePrint(MtbColt mtbColtToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
PrinterRESTConsumer.Type.PRIMARIA,
|
||||
mtbColtToPrint,
|
||||
onComplete, onFailed);
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.databinding.FragmentProdFabbisognoLineeProdBinding;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaView;
|
||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.ProdFabbisognoLineeProdDTO;
|
||||
@@ -112,24 +111,6 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
||||
titleText.setText(context.getText(R.string.prod_fabbisogno_linee_prod_title).toString());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
this.closeProgress();
|
||||
UtilityExceptions.defaultException(getActivity(), ex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingStarted() {
|
||||
this.openProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingEnded() {
|
||||
this.closeProgress();
|
||||
}
|
||||
|
||||
|
||||
private void startPickingActivity(List<ProdFabbisognoLineeProdDTO> fabbisognoList) {
|
||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||
|
||||
|
||||
@@ -22,14 +22,12 @@ import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgsss;
|
||||
import it.integry.integrywmsnative.core.model.JtbFasi;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.databinding.DialogAskMagazzinoProssimitaBinding;
|
||||
|
||||
public class DialogAskMagazzinoProssimitaView extends BaseDialogFragment implements DialogAskMagazzinoProssimitaViewModel.Listener {
|
||||
@@ -178,20 +176,4 @@ public class DialogAskMagazzinoProssimitaView extends BaseDialogFragment impleme
|
||||
// });
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
this.closeProgress();
|
||||
UtilityExceptions.defaultException(mContext, ex);
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingStarted() {
|
||||
this.openProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingEnded() {
|
||||
this.closeProgress();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,9 +116,7 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
}
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
BarcodeManager.disable();
|
||||
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.processBarcodeDTO(data);
|
||||
};
|
||||
@@ -228,7 +226,7 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
||||
|
||||
@Override
|
||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
DialogSimpleMessageView.makeErrorDialog(
|
||||
new SpannableString(ex.getMessage()),
|
||||
null,
|
||||
|
||||
@@ -291,7 +291,6 @@ public class ProdRecuperoMaterialeViewModel {
|
||||
|
||||
private void singlePrint(MtbColt mtbColtToPrint, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
PrinterRESTConsumer.Type.PRIMARIA,
|
||||
mtbColtToPrint,
|
||||
onComplete, onAbort);
|
||||
|
||||
|
||||
@@ -117,10 +117,12 @@ public class ProdRientroMerceFragment extends BaseFragment implements ITitledFra
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
for (Runnable onPreDestroy :
|
||||
mOnPreDestroyList) {
|
||||
for (Runnable onPreDestroy : mOnPreDestroyList) {
|
||||
onPreDestroy.run();
|
||||
}
|
||||
|
||||
mProdRientroMerceOrderDetailFragment.onDetach();
|
||||
mProdRientroMerceOrderListFragment.onDetach();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,8 +8,8 @@ import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.picking_resi.exceptions.DocumentsLoadException;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.OrdersLoadException;
|
||||
|
||||
public class ProdRientroMerceViewModel {
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ProdRientroMerceViewModel {
|
||||
this.mMesRESTConsumer.getOrdiniLavorazione("I", null, ordiniLavorazioneList -> {
|
||||
this.mOrdiniLavorazioneAperti.postValue(ordiniLavorazioneList);
|
||||
this.sendOnLoadingEnded();
|
||||
}, ex -> this.sendError(new DocumentsLoadException(ex)));
|
||||
}, ex -> this.sendError(new OrdersLoadException(ex)));
|
||||
}
|
||||
|
||||
public MutableLiveData<List<OrdineLavorazioneDTO>> getOrdiniLavorazioneAperti() {
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package it.integry.integrywmsnative.gest.prod_rientro_merce.order_detail;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
@@ -12,10 +15,13 @@ import androidx.databinding.ObservableArrayList;
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.harrysoft.androidbluetoothserial.BluetoothManager;
|
||||
import com.harrysoft.androidbluetoothserial.BluetoothSerialDevice;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
@@ -23,8 +29,11 @@ import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.exception.BluetoothConnectionException;
|
||||
import it.integry.integrywmsnative.core.expansion.AtomicBigDecimal;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
@@ -36,6 +45,7 @@ import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||
import it.integry.integrywmsnative.databinding.FragmentProdRientroMerceOrderDetailBinding;
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||
import it.integry.integrywmsnative.gest.settings.MainSettingsFragment;
|
||||
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdDTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_lu_prod.DialogInputLUProdView;
|
||||
@@ -64,6 +74,9 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
|
||||
private RunnableArgs<MtbColt> onMtbColtClicked;
|
||||
|
||||
private BluetoothManager bluetoothManager;
|
||||
private BluetoothSerialDevice mConnectedBluetoothDevice;
|
||||
|
||||
|
||||
public ObservableField<BigDecimal> sumLUNumber = new ObservableField<>(BigDecimal.ZERO);
|
||||
public ObservableField<BigDecimal> sumColliNumber = new ObservableField<>(BigDecimal.ZERO);
|
||||
@@ -103,6 +116,7 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
this.mViewModel.mtbColtsOfOrder.observe(getViewLifecycleOwner(), this::refreshList);
|
||||
|
||||
this.initRecyclerView();
|
||||
this.initULScaleBluetoothConnection();
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
@@ -110,10 +124,10 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
private void initRecyclerView() {
|
||||
mBindings.mainList.setNestedScrollingEnabled(false);
|
||||
mBindings.mainList.setHasFixedSize(true);
|
||||
mBindings.mainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
mBindings.mainList.setLayoutManager(new LinearLayoutManager(requireActivity()));
|
||||
|
||||
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(getActivity(), SimpleDividerItemDecoration.VERTICAL);
|
||||
itemDecorator.setDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.divider));
|
||||
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(requireActivity(), SimpleDividerItemDecoration.VERTICAL);
|
||||
itemDecorator.setDrawable(ContextCompat.getDrawable(requireActivity(), R.drawable.divider));
|
||||
mBindings.mainList.addItemDecoration(itemDecorator);
|
||||
|
||||
mAdapter = new ProdRientroMerceOrderDetailMtbColtListAdapter(new ObservableArrayList<>());
|
||||
@@ -121,10 +135,52 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
|
||||
mBindings.mainList.setAdapter(mAdapter);
|
||||
mAdapter.setOnItemClickListener(item -> {
|
||||
if(this.onMtbColtClicked != null) this.onMtbColtClicked.run(item);
|
||||
if (this.onMtbColtClicked != null) this.onMtbColtClicked.run(item);
|
||||
});
|
||||
}
|
||||
|
||||
private void initULScaleBluetoothConnection() {
|
||||
bluetoothManager = BluetoothManager.getInstance();
|
||||
if (bluetoothManager == null) {
|
||||
// Bluetooth unavailable on this device :( tell the user
|
||||
Toast.makeText(requireActivity(), "Bluetooth not available.", Toast.LENGTH_LONG).show(); // Replace context with your context instance.
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext());
|
||||
var btMacAddress = sharedPreferences.getString(MainSettingsFragment.KEY_PALLET_BT_DEVICE, null);
|
||||
|
||||
if (btMacAddress == null) {
|
||||
Toast.makeText(requireActivity(), "Nessun dispositivo BLUETOOTH configurato nelle impostazioni.", Toast.LENGTH_LONG).show(); // Replace context with your context instance.
|
||||
return;
|
||||
}
|
||||
|
||||
var btName = Stream.of(bluetoothManager.getPairedDevicesList())
|
||||
.filter(x -> x.getAddress().equalsIgnoreCase(btMacAddress))
|
||||
.map(BluetoothDevice::getName)
|
||||
.findFirstOrElse(null);
|
||||
|
||||
var disposableBluetooth = bluetoothManager.openSerialDevice(btMacAddress)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(this::onConnected, x -> this.onError(new BluetoothConnectionException(btName, btMacAddress, x)));
|
||||
|
||||
}
|
||||
|
||||
private void onConnected(BluetoothSerialDevice connectedDevice) {
|
||||
Toast.makeText(requireActivity(), "Connesso a: " + connectedDevice.getMac(), Toast.LENGTH_LONG).show();
|
||||
mConnectedBluetoothDevice = connectedDevice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
if (mConnectedBluetoothDevice != null)
|
||||
bluetoothManager.close();
|
||||
|
||||
super.onDetach();
|
||||
}
|
||||
|
||||
public void setOrder(OrdineLavorazioneDTO order) {
|
||||
currentOrder.postValue(order);
|
||||
mBindings.invalidateAll();
|
||||
@@ -134,7 +190,7 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
}
|
||||
|
||||
private void refreshList(List<MtbColt> mtbColts) {
|
||||
if(mtbColts != null) {
|
||||
if (mtbColts != null) {
|
||||
sumLUNumber.set(new BigDecimal(mtbColts.size()));
|
||||
|
||||
AtomicBigDecimal sumColli = new AtomicBigDecimal(BigDecimal.ZERO);
|
||||
@@ -167,7 +223,7 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
|
||||
|
||||
public void addULButtonClick() {
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
String codProd = this.currentOrder.getValue().getCodProd();
|
||||
mArticoloRESTConsumer.getByCodMart(codProd, mtbAart -> {
|
||||
@@ -186,9 +242,10 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
" AND (data_fine IS NULL OR last_step = id_step) " +
|
||||
"ORDER BY id_step DESC";
|
||||
|
||||
mSystemRESTConsumer.<List<DtbOrdSteps>>processSql(sql, new TypeToken<ArrayList<DtbOrdSteps>>() {}.getType(), dtbOrdStep -> {
|
||||
mSystemRESTConsumer.<List<DtbOrdSteps>>processSql(sql, new TypeToken<ArrayList<DtbOrdSteps>>() {
|
||||
}.getType(), dtbOrdStep -> {
|
||||
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
|
||||
DialogInputLUProdDTO dialogInputLUProdDTO = new DialogInputLUProdDTO()
|
||||
.setMtbAart(mtbAart)
|
||||
@@ -203,7 +260,7 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
|
||||
|
||||
DialogInputLUProdView
|
||||
.newInstance(dialogInputLUProdDTO, resultDTO -> {
|
||||
.newInstance(mConnectedBluetoothDevice != null ? mConnectedBluetoothDevice.toSimpleDeviceInterface() : null, dialogInputLUProdDTO, resultDTO -> {
|
||||
ProdRientroMerceOrderDetailPickedQuantityDTO pickedQuantityDTO = new ProdRientroMerceOrderDetailPickedQuantityDTO()
|
||||
.setNumCnf(resultDTO.getNumCnf())
|
||||
.setPesoCollo(resultDTO.getPesoCollo())
|
||||
@@ -216,9 +273,9 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
|
||||
this.mViewModel.createLU(pickedQuantityDTO);
|
||||
}, () -> {
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
})
|
||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
|
||||
}, this::onError);
|
||||
|
||||
@@ -248,63 +305,59 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
||||
if (currentOrder.getValue() != null) {
|
||||
switch (currentOrder.getValue().getStatoEnum()) {
|
||||
case IN_CORSO:
|
||||
return ContextCompat.getDrawable(getActivity(), R.drawable.ic_play_circle_filled_24dp);
|
||||
return ContextCompat.getDrawable(requireActivity(), R.drawable.ic_play_circle_filled_24dp);
|
||||
case PAUSA:
|
||||
return ContextCompat.getDrawable(getActivity(), R.drawable.ic_pause_circle_filled_24dp);
|
||||
return ContextCompat.getDrawable(requireActivity(), R.drawable.ic_pause_circle_filled_24dp);
|
||||
case PROGRAMMATO:
|
||||
default:
|
||||
return ContextCompat.getDrawable(getActivity(), R.drawable.ic_clock_circle_outline_24dp);
|
||||
return ContextCompat.getDrawable(requireActivity(), R.drawable.ic_clock_circle_outline_24dp);
|
||||
}
|
||||
}
|
||||
else
|
||||
return ContextCompat.getDrawable(getActivity(), R.drawable.ic_clock_circle_outline_24dp);
|
||||
} else
|
||||
return ContextCompat.getDrawable(requireActivity(), R.drawable.ic_clock_circle_outline_24dp);
|
||||
}
|
||||
|
||||
public Integer getOrderStatusIconTintColor() {
|
||||
if (currentOrder.getValue() != null) {
|
||||
switch (currentOrder.getValue().getStatoEnum()) {
|
||||
case IN_CORSO:
|
||||
return ContextCompat.getColor(getActivity(), R.color.green_800);
|
||||
return ContextCompat.getColor(requireActivity(), R.color.green_800);
|
||||
case PAUSA:
|
||||
return ContextCompat.getColor(getActivity(), R.color.yellow_800);
|
||||
return ContextCompat.getColor(requireActivity(), R.color.yellow_800);
|
||||
case PROGRAMMATO:
|
||||
default:
|
||||
return ContextCompat.getColor(getActivity(), R.color.blue_800);
|
||||
return ContextCompat.getColor(requireActivity(), R.color.blue_800);
|
||||
}
|
||||
}
|
||||
else
|
||||
return ContextCompat.getColor(getActivity(), R.color.blue_800);
|
||||
} else
|
||||
return ContextCompat.getColor(requireActivity(), R.color.blue_800);
|
||||
}
|
||||
|
||||
public Drawable getOrderStatusLabelBackgroud() {
|
||||
if (currentOrder.getValue() != null) {
|
||||
switch (currentOrder.getValue().getStatoEnum()) {
|
||||
case IN_CORSO:
|
||||
return ContextCompat.getDrawable(getActivity(), R.drawable.label_success_text);
|
||||
return ContextCompat.getDrawable(requireActivity(), R.drawable.label_success_text);
|
||||
case PAUSA:
|
||||
return ContextCompat.getDrawable(getActivity(), R.drawable.label_warning_text);
|
||||
return ContextCompat.getDrawable(requireActivity(), R.drawable.label_warning_text);
|
||||
case PROGRAMMATO:
|
||||
default:
|
||||
return ContextCompat.getDrawable(getActivity(), R.drawable.label_primary_text);
|
||||
return ContextCompat.getDrawable(requireActivity(), R.drawable.label_primary_text);
|
||||
}
|
||||
}
|
||||
else
|
||||
return ContextCompat.getDrawable(getActivity(), R.drawable.label_primary_text);
|
||||
} else
|
||||
return ContextCompat.getDrawable(requireActivity(), R.drawable.label_primary_text);
|
||||
}
|
||||
|
||||
public Integer getOrderStatusLabelTextColor() {
|
||||
if (currentOrder.getValue() != null) {
|
||||
switch (currentOrder.getValue().getStatoEnum()) {
|
||||
case IN_CORSO:
|
||||
return ContextCompat.getColor(getActivity(), R.color.green_800);
|
||||
return ContextCompat.getColor(requireActivity(), R.color.green_800);
|
||||
case PAUSA:
|
||||
return ContextCompat.getColor(getActivity(), R.color.yellow_800);
|
||||
return ContextCompat.getColor(requireActivity(), R.color.yellow_800);
|
||||
case PROGRAMMATO:
|
||||
default:
|
||||
return ContextCompat.getColor(getActivity(), R.color.blue_800);
|
||||
return ContextCompat.getColor(requireActivity(), R.color.blue_800);
|
||||
}
|
||||
}
|
||||
else
|
||||
return ContextCompat.getColor(getActivity(), R.color.blue_800);
|
||||
} else
|
||||
return ContextCompat.getColor(requireActivity(), R.color.blue_800);
|
||||
}
|
||||
}
|
||||
@@ -334,7 +334,7 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
|
||||
@Override
|
||||
public void onWarning(String warningText, Runnable action) {
|
||||
this.requireActivity().runOnUiThread(() -> {
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
DialogSimpleMessageView
|
||||
.makeWarningDialog(new SpannableString(Html.fromHtml(warningText)), null, action)
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
|
||||
@@ -192,7 +192,7 @@ public class PVOrdineAcquistoEditViewModel {
|
||||
}
|
||||
|
||||
private boolean isAutoOrderOnScan() {
|
||||
return SettingsManager.iDB().getFlagOrdinaNuoviArticoliInGriglia();
|
||||
return SettingsManager.iDB().isFlagOrdinaArticoliOnScan();
|
||||
}
|
||||
|
||||
private void getNewArticoli(int idGrigla, RunnableArgs<List<ArticoloGriglia>> onSuccess, RunnableArgs<Exception> onError) {
|
||||
|
||||
@@ -214,13 +214,10 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
BarcodeManager.disable();
|
||||
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||
BarcodeManager.enable();
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
};
|
||||
|
||||
@@ -334,12 +331,12 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
() -> onComplete.run(true),
|
||||
() -> onComplete.run(false)
|
||||
)
|
||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
UtilityToast.showToast(ex.getMessage());
|
||||
@@ -391,11 +388,11 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
.setPartitaMag(resultDTO.getPartitaMag())
|
||||
.setDataScad(resultDTO.getDataScad());
|
||||
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||
})
|
||||
.setOnAbort(() -> {
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
})
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@@ -494,7 +494,7 @@ public class RettificaGiacenzeViewModel {
|
||||
onComplete.run();
|
||||
} else {
|
||||
|
||||
this.mPrinterRESTConsumer.printCollo(null, mCurrentMtbColt, () -> {
|
||||
this.mPrinterRESTConsumer.printCollo(mCurrentMtbColt, () -> {
|
||||
this.sendLUSuccessfullyPrinted();
|
||||
onComplete.run();
|
||||
}, ex -> this.sendLUPrintError(ex, onComplete));
|
||||
|
||||
@@ -1,20 +1,34 @@
|
||||
package it.integry.integrywmsnative.gest.settings;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceFragmentCompat;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.harrysoft.androidbluetoothserial.BluetoothManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
|
||||
public class MainSettingsFragment extends PreferenceFragmentCompat implements ITitledFragment {
|
||||
public class MainSettingsFragment extends PreferenceFragmentCompat implements ITitledFragment, Preference.OnPreferenceChangeListener {
|
||||
|
||||
private final ArrayList<Runnable> onPreDestroyList = new ArrayList<>();
|
||||
|
||||
public static final String KEY_PALLET_BT_DEVICE = "pallet_scale_bt_device";
|
||||
|
||||
private Collection<BluetoothDevice> btPairedDevices;
|
||||
|
||||
@Override
|
||||
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||
titleText.setText(context.getText(R.string.settings_category).toString());
|
||||
@@ -23,8 +37,52 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
||||
@Override
|
||||
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
|
||||
setPreferencesFromResource(R.xml.app_preferences, rootKey);
|
||||
|
||||
var palletScaleBtDeviceListPref = (ListPreference) findPreference(KEY_PALLET_BT_DEVICE);
|
||||
setListPreferenceData(palletScaleBtDeviceListPref);
|
||||
palletScaleBtDeviceListPref.setOnPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
|
||||
protected void setListPreferenceData(ListPreference lp) {
|
||||
BluetoothManager bluetoothManager = BluetoothManager.getInstance();
|
||||
if (bluetoothManager == null) {
|
||||
// Bluetooth unavailable on this device :( tell the user
|
||||
Toast.makeText(requireActivity(), "Bluetooth not available", Toast.LENGTH_LONG).show(); // Replace context with your context instance.
|
||||
return;
|
||||
}
|
||||
|
||||
btPairedDevices = bluetoothManager.getPairedDevicesList();
|
||||
|
||||
if(!Stream.of(btPairedDevices).anyMatch(x -> x.getAddress().equalsIgnoreCase(lp.getValue()))) {
|
||||
lp.setValue(null);
|
||||
}
|
||||
|
||||
updatePalletBtDeviceSummary(lp, lp.getValue());
|
||||
|
||||
if (!btPairedDevices.isEmpty()) {
|
||||
CharSequence[] entries = new CharSequence[btPairedDevices.size()];
|
||||
Stream.of(btPairedDevices)
|
||||
.map(BluetoothDevice::getName)
|
||||
.toList()
|
||||
.toArray(entries);
|
||||
|
||||
CharSequence[] entryValues = new CharSequence[btPairedDevices.size()];
|
||||
Stream.of(btPairedDevices)
|
||||
.map(BluetoothDevice::getAddress)
|
||||
.toList()
|
||||
.toArray(entryValues);
|
||||
|
||||
lp.setEntries(entries);
|
||||
lp.setEntryValues(entryValues);
|
||||
} else {
|
||||
lp.setEntries(new CharSequence[0]);
|
||||
lp.setEntryValues(new CharSequence[0]);
|
||||
lp.setDialogMessage("Nessun dispositivo bluetooth associato. Associane uno dalle impostazioni bluetooth prima di procedere.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addOnPreDestroy(Runnable onPreDestroy) {
|
||||
onPreDestroyList.add(onPreDestroy);
|
||||
@@ -34,9 +92,34 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
for (Runnable onPreDestroy :
|
||||
onPreDestroyList) {
|
||||
for (Runnable onPreDestroy : onPreDestroyList) {
|
||||
onPreDestroy.run();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceChange(@NonNull Preference preference, Object newValue) {
|
||||
|
||||
final int idx;
|
||||
switch (preference.getKey()) {
|
||||
case KEY_PALLET_BT_DEVICE:
|
||||
final var palletScaleBtDeviceListPref = (ListPreference) preference;
|
||||
updatePalletBtDeviceSummary(palletScaleBtDeviceListPref, (String) newValue);
|
||||
break;
|
||||
|
||||
}
|
||||
// Set result so knows to refresh itself
|
||||
// getActivity().setResult(RESULT_OK);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private void updatePalletBtDeviceSummary(ListPreference listPref, String btDeviceAddress) {
|
||||
String btDeviceName = Stream.of(btPairedDevices)
|
||||
.filter(x -> x.getAddress().equalsIgnoreCase(btDeviceAddress))
|
||||
.map(BluetoothDevice::getName)
|
||||
.findFirstOrElse(UtilityResources.getString(R.string.pallet_scale_bt_device_selection_info));
|
||||
listPref.setSummary(btDeviceName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -44,7 +44,6 @@ 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.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
@@ -56,12 +55,12 @@ import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityToast;
|
||||
import it.integry.integrywmsnative.databinding.ActivitySpedizioneBinding;
|
||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliActivity;
|
||||
import it.integry.integrywmsnative.gest.spedizione.ui.SpedizioneListAdapter;
|
||||
import it.integry.integrywmsnative.gest.spedizione.ui.SpedizioneListModel;
|
||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.BaseDialogRowInfoView;
|
||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||
import it.integry.integrywmsnative.gest.spedizione.ui.SpedizioneListAdapter;
|
||||
import it.integry.integrywmsnative.gest.spedizione.ui.SpedizioneListModel;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
||||
@@ -204,7 +203,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
boolean shouldAskPesoLU = SettingsManager.iDB().isFlagAskPesoColloSpedizione();
|
||||
boolean useQtaOrd = SettingsManager.iDB().isFlagSpedizioneUseQtaOrd();
|
||||
|
||||
if (!mEnableFakeGiacenza) this.openProgress();
|
||||
if (!mEnableFakeGiacenza) this.onLoadingStarted();
|
||||
mViewmodel.init(
|
||||
codMdep,
|
||||
!mEnableFakeGiacenza,
|
||||
@@ -622,13 +621,10 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
BarcodeManager.disable();
|
||||
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewmodel.processBarcodeDTO(data, () -> {
|
||||
BarcodeManager.enable();
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
};
|
||||
|
||||
@@ -660,10 +656,10 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
public void createNewUL() {
|
||||
this.mBindings.spedizioneFab.close(true);
|
||||
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewmodel.createNewLU(null, null, () -> {
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -672,7 +668,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
ArrayList<MtbColt> createdMtbColts = this.mViewmodel.getCreatedMtbColts();
|
||||
|
||||
Intent myIntent = ListaBancaliActivity.createIntent(this, createdMtbColts, true, PrinterRESTConsumer.Type.PRIMARIA, false);
|
||||
Intent myIntent = ListaBancaliActivity.createIntent(this, createdMtbColts, true, false);
|
||||
this.startActivityForResult(myIntent, PICK_UL_REQUEST);
|
||||
}
|
||||
|
||||
@@ -683,16 +679,6 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
this.mViewmodel.closeOrder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingStarted() {
|
||||
this.openProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingEnded() {
|
||||
this.closeProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLUOpened(MtbColt mtbColt) {
|
||||
this.addExtraItemsEnabled.set(SettingsManager.iDB().isFlagCanAddExtraItemSpedizione());
|
||||
@@ -737,7 +723,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
@Override
|
||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
DialogSimpleMessageView.makeErrorDialog(
|
||||
new SpannableString(ex.getMessage()),
|
||||
null,
|
||||
@@ -773,7 +759,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
UtilityToast.showToast(ex.getMessage());
|
||||
@@ -834,7 +820,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
.setPartitaMag(resultDTO.getPartitaMag())
|
||||
.setDataScad(resultDTO.getDataScad());
|
||||
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||
})
|
||||
.setOnAbort(() -> {
|
||||
|
||||
@@ -78,7 +78,7 @@ public class SpedizioneViewModel {
|
||||
private GestioneEnum mDefaultGestioneOfUL = null;
|
||||
private int mDefaultSegnoCol = -1;
|
||||
private String mDefaultCodMdep = null;
|
||||
private List<FiltroOrdineDTO> mDefaultFiltroOrdine = new ArrayList<>();
|
||||
private final List<FiltroOrdineDTO> mDefaultFiltroOrdine = new ArrayList<>();
|
||||
private String mDefaultCodAnagOfUL = null;
|
||||
private String mDefaultRagSocOfUL = null;
|
||||
private String mDefaultRifOrdOfUL = null;
|
||||
@@ -1722,26 +1722,25 @@ public class SpedizioneViewModel {
|
||||
if (!shouldPrint) {
|
||||
onComplete.run();
|
||||
} else {
|
||||
cyclicPrint(PrinterRESTConsumer.Type.PRIMARIA, mtbColtsToPrint.iterator(), onComplete, ex -> this.sendLUPrintError(ex, onComplete));
|
||||
cyclicPrint(mtbColtsToPrint.iterator(), onComplete, ex -> this.sendLUPrintError(ex, onComplete));
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void cyclicPrint(PrinterRESTConsumer.Type printerType, @NotNull Iterator<MtbColt> sourceMtbColts, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||
private void cyclicPrint(@NotNull Iterator<MtbColt> sourceMtbColts, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||
if (sourceMtbColts.hasNext()) {
|
||||
singlePrint(printerType, sourceMtbColts.next(), () -> {
|
||||
cyclicPrint(printerType, sourceMtbColts, onComplete, onAbort);
|
||||
singlePrint(sourceMtbColts.next(), () -> {
|
||||
cyclicPrint(sourceMtbColts, onComplete, onAbort);
|
||||
}, onAbort);
|
||||
} else {
|
||||
onComplete.run();
|
||||
}
|
||||
}
|
||||
|
||||
private void singlePrint(PrinterRESTConsumer.Type printerType, MtbColt mtbColtToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
private void singlePrint(MtbColt mtbColtToPrint, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
printerType,
|
||||
mtbColtToPrint,
|
||||
onComplete,
|
||||
onFailed);
|
||||
@@ -1749,13 +1748,17 @@ public class SpedizioneViewModel {
|
||||
|
||||
|
||||
public void recoverLU(MtbColt mtbColt) {
|
||||
this.sendOnLoadingStarted();
|
||||
this.mCurrentMtbColt = mtbColt;
|
||||
mMtbColtSessionID = this.mColliDataRecoverService.startNewSession(mtbColt, mTestateOrdini);
|
||||
|
||||
this.mCurrentMtbColt.generaFiltroOrdineFromDTO(mDefaultFiltroOrdine);
|
||||
|
||||
this.mColliMagazzinoRESTConsumer.saveCollo(this.mCurrentMtbColt, savedMtbColt -> {
|
||||
this.resetMatchedRows();
|
||||
this.sendLUOpened(this.mCurrentMtbColt);
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private void postCloseOperations(List<MtbColt> mtbColtList) {
|
||||
|
||||
@@ -158,7 +158,7 @@ public class UltimeConsegneClienteFragment extends BaseFragment implements Ultim
|
||||
}
|
||||
|
||||
private void refreshItems() {
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
String currentAnagFilter = mAppliedFilterViewModel != null ? mAppliedFilterViewModel.ragSoc.get() : null;
|
||||
String currentCodAnagFilter = null;
|
||||
@@ -247,22 +247,4 @@ public class UltimeConsegneClienteFragment extends BaseFragment implements Ultim
|
||||
this.mOnPreDestroyList.add(onPreDestroy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingStarted() {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingEnded() {
|
||||
this.closeProgress();
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
this.closeProgress();
|
||||
UtilityExceptions.defaultException(getActivity(), ex, mCurrentProgress);
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ public class UltimiArriviFornitoreFragment extends BaseFragment implements ITitl
|
||||
}
|
||||
|
||||
private void filterItems(List<MtbAart> filteredMtbAarts) {
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
String currentAnagFilter = mAppliedFilterViewModel != null ? mAppliedFilterViewModel.ragSoc.get() : null;
|
||||
String currentCodAnagFilter = null;
|
||||
@@ -252,25 +252,6 @@ public class UltimiArriviFornitoreFragment extends BaseFragment implements ITitl
|
||||
this.mOnPreDestroyList.add(onPreDestroy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingStarted() {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingEnded() {
|
||||
this.closeProgress();
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
this.closeProgress();
|
||||
UtilityExceptions.defaultException(getActivity(), ex, mCurrentProgress);
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMtbColtScanned(MtbColt scannedMtbColt) {
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ public class VersamentoMerceFragment extends BaseFragment implements ITitledFrag
|
||||
null, this::openLU)
|
||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
}).show(getActivity().getSupportFragmentManager(), "tag");
|
||||
}).show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
|
||||
@@ -130,12 +130,10 @@ public class VersamentoMerceFragment extends BaseFragment implements ITitledFrag
|
||||
}
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||
BarcodeManager.enable();
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -54,8 +54,6 @@ public class VersamentoMerceViewModel {
|
||||
|
||||
|
||||
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||
|
||||
new Thread(() -> {
|
||||
if (UtilityBarcode.isEtichettaPosizione(barcodeScanDTO, false)) {
|
||||
this.executeEtichettaPosizione(barcodeScanDTO, onComplete);
|
||||
} else if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||
@@ -65,9 +63,6 @@ public class VersamentoMerceViewModel {
|
||||
} else {
|
||||
onComplete.run();
|
||||
}
|
||||
}).start();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -84,9 +79,8 @@ public class VersamentoMerceViewModel {
|
||||
} else if (mtbColtList.size() == 1) {
|
||||
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||
|
||||
onComplete.run();
|
||||
//TAKE HERE
|
||||
pickMerceULtoUL(mtbColt);
|
||||
pickMerceULtoUL(mtbColt, onComplete);
|
||||
|
||||
}, this::sendError);
|
||||
} else {
|
||||
@@ -97,14 +91,22 @@ public class VersamentoMerceViewModel {
|
||||
|
||||
if (!UtilityString.equalsIgnoreCase(mCurrentMtbColt.getValue().getCodMdep(), foundPosizione.getCodMdep())) {
|
||||
this.sendOnSpostamentoTraDepConfirmRequired(mCurrentMtbColt.getValue().getCodMdep(), foundPosizione.getCodMdep(), canContinue -> {
|
||||
if (canContinue) {
|
||||
updatePosizione(foundPosizione, UtilityPosizione.isPosizioneWithLivello(foundPosizione));
|
||||
} else {
|
||||
onComplete.run();
|
||||
if (canContinue) {
|
||||
if (UtilityPosizione.isPosizioneWithLivello(foundPosizione)) {
|
||||
askLivelloPosizione(foundPosizione);
|
||||
} else {
|
||||
updatePosizione(foundPosizione);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
updatePosizione(foundPosizione, UtilityPosizione.isPosizioneWithLivello(foundPosizione));
|
||||
onComplete.run();
|
||||
if (UtilityPosizione.isPosizioneWithLivello(foundPosizione)) {
|
||||
askLivelloPosizione(foundPosizione);
|
||||
} else {
|
||||
updatePosizione(foundPosizione);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -150,12 +152,11 @@ public class VersamentoMerceViewModel {
|
||||
if (mtbColt == null) {
|
||||
this.mColliMagazzinoRESTConsumer.createColloFromEtichettaAnonima(sscc, GestioneEnum.LAVORAZIONE, mtbColtAnonimo -> {
|
||||
onComplete.run();
|
||||
pickMerceULtoUL(mtbColtAnonimo);
|
||||
pickMerceULtoUL(mtbColtAnonimo, onComplete);
|
||||
}, this::sendError);
|
||||
|
||||
} else {
|
||||
onComplete.run();
|
||||
pickMerceULtoUL(mtbColt);
|
||||
pickMerceULtoUL(mtbColt, onComplete);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,7 +165,8 @@ public class VersamentoMerceViewModel {
|
||||
}
|
||||
|
||||
|
||||
private void pickMerceULtoUL(MtbColt destMtbColt) {
|
||||
private void pickMerceULtoUL(MtbColt destMtbColt, Runnable onComplete) {
|
||||
this.sendOnLoadingStarted();
|
||||
MtbColt sourceMtbColt = mCurrentMtbColt.getValue();
|
||||
|
||||
if (!UtilityString.equalsIgnoreCase(sourceMtbColt.getCodMdep(), destMtbColt.getCodMdep())) {
|
||||
@@ -181,21 +183,24 @@ public class VersamentoMerceViewModel {
|
||||
return;
|
||||
}
|
||||
|
||||
this.sendOnLoadingEnded();
|
||||
this.sendOnArtsChooseRequired(mtbColrsToPick, pickedAarts -> {
|
||||
List<MtbColr> destNewMtbColr = new ArrayList<>();
|
||||
|
||||
askQuantities(pickedAarts.iterator(), destNewMtbColr, () -> {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
MtbColt clonedSourceTestata = (MtbColt) sourceMtbColt.clone();
|
||||
clonedSourceTestata.setMtbColr(new ObservableArrayList<>());
|
||||
clonedSourceTestata.getMtbColr().addAll(destNewMtbColr);
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
this.mColliMagazzinoRESTConsumer.spostaArtsTraUL(
|
||||
clonedSourceTestata,
|
||||
destMtbColt,
|
||||
this::sendOnDataSaved,
|
||||
() -> {
|
||||
this.sendOnDataSaved();
|
||||
onComplete.run();
|
||||
},
|
||||
this::sendError
|
||||
);
|
||||
|
||||
@@ -242,19 +247,18 @@ public class VersamentoMerceViewModel {
|
||||
}
|
||||
|
||||
|
||||
public void updatePosizione(MtbDepoPosizione mtbDepoPosizione, boolean shouldAskLivello) {
|
||||
|
||||
if (shouldAskLivello) {
|
||||
public void askLivelloPosizione(MtbDepoPosizione mtbDepoPosizione) {
|
||||
this.sendOnLivelloPosizioneRequired(mtbDepoPosizione, newPosizione -> {
|
||||
|
||||
if (newPosizione == null) {
|
||||
updatePosizione(mtbDepoPosizione, shouldAskLivello);
|
||||
askLivelloPosizione(mtbDepoPosizione);
|
||||
} else {
|
||||
updatePosizione(newPosizione, false);
|
||||
updatePosizione(newPosizione);
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
}
|
||||
|
||||
public void updatePosizione(MtbDepoPosizione mtbDepoPosizione) {
|
||||
this.sendOnLoadingStarted();
|
||||
mColliMagazzinoRESTConsumer.changePosizione(mCurrentMtbColt.getValue(), mtbDepoPosizione, () -> {
|
||||
this.sendOnLoadingEnded();
|
||||
@@ -262,8 +266,6 @@ public class VersamentoMerceViewModel {
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public MutableLiveData<MtbColt> getCurrentMtbColt() {
|
||||
return mCurrentMtbColt;
|
||||
|
||||
@@ -255,9 +255,7 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
||||
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||
BarcodeManager.disable();
|
||||
|
||||
openProgress();
|
||||
onLoadingStarted();
|
||||
|
||||
|
||||
if (UtilityBarcode.isEan13(data)) {
|
||||
@@ -265,8 +263,7 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
||||
} else if (UtilityBarcode.isEtichetta128(data)) {
|
||||
this.executeEtichettaEan128(data);
|
||||
} else {
|
||||
closeProgress();
|
||||
BarcodeManager.enable();
|
||||
onLoadingEnded();
|
||||
}
|
||||
|
||||
|
||||
@@ -290,8 +287,7 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
||||
this.loadArticolo(barcodeProd, ean128Model);
|
||||
} else {
|
||||
DialogCommon.showNoArtFoundDialog(context, () -> {
|
||||
BarcodeManager.enable();
|
||||
closeProgress();
|
||||
onLoadingEnded();
|
||||
});
|
||||
|
||||
}
|
||||
@@ -300,16 +296,11 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
||||
} else {
|
||||
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
|
||||
DialogCommon.showNoArtFoundDialog(context, () -> {
|
||||
BarcodeManager.enable();
|
||||
closeProgress();
|
||||
onLoadingEnded();
|
||||
});
|
||||
|
||||
}
|
||||
}, ex -> {
|
||||
closeProgress();
|
||||
UtilityExceptions.defaultException(context, ex);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
}, this::onError);
|
||||
}
|
||||
|
||||
|
||||
@@ -326,22 +317,16 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
||||
|
||||
this.searchArtInList(mtbAartList.get(0), ean128Model);
|
||||
|
||||
BarcodeManager.enable();
|
||||
closeProgress();
|
||||
onLoadingEnded();
|
||||
|
||||
} else {
|
||||
|
||||
DialogCommon.showNoArtFoundDialog(context, () -> {
|
||||
BarcodeManager.enable();
|
||||
closeProgress();
|
||||
onLoadingEnded();
|
||||
});
|
||||
}
|
||||
|
||||
}, ex -> {
|
||||
closeProgress();
|
||||
BarcodeManager.enable();
|
||||
UtilityExceptions.defaultException(context, ex);
|
||||
});
|
||||
}, this::onError);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import androidx.fragment.app.DialogFragment;
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
import com.harrysoft.androidbluetoothserial.SimpleBluetoothDeviceInterface;
|
||||
import com.pedromassango.doubleclick.DoubleClick;
|
||||
import com.pedromassango.doubleclick.DoubleClickListener;
|
||||
|
||||
@@ -52,10 +53,13 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
@Inject
|
||||
DialogInputLUProdViewModel mViewModel;
|
||||
|
||||
private final SimpleBluetoothDeviceInterface mBluetoothDeviceInterface;
|
||||
private final DialogInputLUProdDTO mDialogInputLUProdDTO;
|
||||
private final RunnableArgs<DialogInputLUProdResultDTO> mOnComplete;
|
||||
private final Runnable mOnAbort;
|
||||
|
||||
public ObservableField<Boolean> enabledBluetoothDevice = new ObservableField<>();
|
||||
|
||||
public ObservableField<String> selectedMtbTcol = new ObservableField<>();
|
||||
public ObservableField<DialogInputLUProdTipoColloListModel> currentMtbTCol = new ObservableField<>();
|
||||
|
||||
@@ -87,13 +91,14 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
private DialogInputLUProdTipoColloAdapter codTcolArrayAdapter = null;
|
||||
private DialogInputLULineeProdAdapter lineeProdArrayAdapter = null;
|
||||
|
||||
public static DialogInputLUProdView newInstance(@NotNull DialogInputLUProdDTO dialogInputLUProdDTO, @NotNull RunnableArgs<DialogInputLUProdResultDTO> onComplete, @NotNull Runnable onAbort) {
|
||||
return new DialogInputLUProdView(dialogInputLUProdDTO, onComplete, onAbort);
|
||||
public static DialogInputLUProdView newInstance(SimpleBluetoothDeviceInterface bluetoothDeviceInterface, @NotNull DialogInputLUProdDTO dialogInputLUProdDTO, @NotNull RunnableArgs<DialogInputLUProdResultDTO> onComplete, @NotNull Runnable onAbort) {
|
||||
return new DialogInputLUProdView(bluetoothDeviceInterface, dialogInputLUProdDTO, onComplete, onAbort);
|
||||
}
|
||||
|
||||
private DialogInputLUProdView(@NotNull DialogInputLUProdDTO dialogInputLUProdDTO, @NotNull RunnableArgs<DialogInputLUProdResultDTO> onComplete, @NotNull Runnable onAbort) {
|
||||
private DialogInputLUProdView(SimpleBluetoothDeviceInterface bluetoothDeviceInterface, @NotNull DialogInputLUProdDTO dialogInputLUProdDTO, @NotNull RunnableArgs<DialogInputLUProdResultDTO> onComplete, @NotNull Runnable onAbort) {
|
||||
super();
|
||||
|
||||
this.mBluetoothDeviceInterface = bluetoothDeviceInterface;
|
||||
this.mDialogInputLUProdDTO = dialogInputLUProdDTO;
|
||||
this.mOnComplete = onComplete;
|
||||
this.mOnAbort = onAbort;
|
||||
@@ -104,7 +109,6 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setStyle(DialogFragment.STYLE_NORMAL, R.style.AppTheme_NewMaterial_Dialog_FullscreenDialog);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -142,6 +146,13 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
super.onStart();
|
||||
this.init();
|
||||
|
||||
|
||||
if(mBluetoothDeviceInterface != null) {
|
||||
// Listen to bluetooth events
|
||||
mBluetoothDeviceInterface.setListeners(this::onMessageReceived, this::onMessageSent, x -> this.onError(new Exception(x)));
|
||||
enabledBluetoothDevice.set(true);
|
||||
}
|
||||
|
||||
this.mViewModel.setListener(this);
|
||||
this.mViewModel.init(mDialogInputLUProdDTO.getCodJfasParent());
|
||||
}
|
||||
@@ -166,7 +177,7 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
});
|
||||
|
||||
UtilityObservable.addPropertyChanged(this.currentMtbTCol, (value) -> {
|
||||
this.currentTaraPed.set(value.getOriginalModel().getTaraKg());
|
||||
this.currentTaraPed.set(value.getOriginalModel().getPesoKg());
|
||||
});
|
||||
|
||||
UtilityObservable.addPropertyChanged(this.selectedLineaProd, (value) -> {
|
||||
@@ -385,10 +396,37 @@ public class DialogInputLUProdView extends BaseDialogFragment implements DialogI
|
||||
this.onDataChanged();
|
||||
}
|
||||
|
||||
public void readWeightFromDevice() {
|
||||
// Toast.makeText(requireActivity(), "Leggo peso uaglio", Toast.LENGTH_SHORT).show();
|
||||
|
||||
// Let's send a message:
|
||||
mBluetoothDeviceInterface.sendMessage("GW\r");
|
||||
}
|
||||
|
||||
private void onMessageSent(String request) {
|
||||
// Toast.makeText(requireActivity(), "Aspitt nu mument", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
private void onMessageReceived(String response) {
|
||||
// Toast.makeText(requireActivity(), "Ne awa: " + response, Toast.LENGTH_SHORT).show();
|
||||
|
||||
String tmpResp = response.replace(".", "");
|
||||
|
||||
BigDecimal grossWeight = new BigDecimal(tmpResp.substring(2,7));
|
||||
BigDecimal netWeight = new BigDecimal(tmpResp.substring(8,13));
|
||||
|
||||
mViewModel.setPesoNetto(netWeight);
|
||||
mViewModel.setPesoLordo(grossWeight);
|
||||
}
|
||||
|
||||
|
||||
public void save() {
|
||||
if (this.mViewModel.validate()) {
|
||||
this.mOnComplete.run(this.mViewModel.getResult());
|
||||
|
||||
if(mBluetoothDeviceInterface != null)
|
||||
mBluetoothDeviceInterface.setListeners(null, null, null);
|
||||
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,8 +158,8 @@ public class DialogInputLUProdViewModel {
|
||||
this.mListener.onDataChanged();
|
||||
}
|
||||
|
||||
public void setPesoNetto(BigDecimal qtaTot) {
|
||||
this.internalPesoNetto = qtaTot;
|
||||
public void setPesoNetto(BigDecimal pesoNetto) {
|
||||
this.internalPesoNetto = pesoNetto;
|
||||
}
|
||||
|
||||
public void setTaraPed(BigDecimal taraPed) {
|
||||
|
||||
@@ -87,6 +87,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
|
||||
private int mBarcodeScannerIstanceID;
|
||||
private boolean mFirstStart = true;
|
||||
private boolean mAbort = true;
|
||||
|
||||
|
||||
public DialogInputQuantityV2View setDialogInputQuantityV2DTO(DialogInputQuantityV2DTO mDialogInputQuantityV2DTO) {
|
||||
@@ -165,6 +166,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
});
|
||||
}
|
||||
this.onLoadingEnded();
|
||||
mBindings.inputNumCnfText.requestFocus();
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
@@ -175,33 +177,34 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
||||
}
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||
this.closeProgress();
|
||||
BarcodeManager.enable();
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
};
|
||||
|
||||
public void save() {
|
||||
if (this.mViewModel.validate()) {
|
||||
this.mOnComplete.run(this.mViewModel.getResult(), false);
|
||||
this.mAbort = false;
|
||||
dismiss();
|
||||
this.mOnComplete.run(this.mViewModel.getResult(), false);
|
||||
}
|
||||
}
|
||||
|
||||
public void saveAndCloseLU() {
|
||||
if (this.mViewModel.validate()) {
|
||||
this.mOnComplete.run(this.mViewModel.getResult(), true);
|
||||
this.mAbort = false;
|
||||
dismiss();
|
||||
this.mOnComplete.run(this.mViewModel.getResult(), true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
|
||||
BarcodeManager.removeCallback(mBarcodeScannerIstanceID);
|
||||
this.mOnAbort.run();
|
||||
if (mAbort) this.mOnAbort.run();
|
||||
super.onDismiss(dialog);
|
||||
}
|
||||
|
||||
|
||||
@@ -104,8 +104,7 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
|
||||
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.processBarcodeDTO(data, (status, mtbAart, ean128Model, mtbColrList) -> {
|
||||
|
||||
@@ -130,8 +129,7 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
|
||||
}
|
||||
|
||||
|
||||
BarcodeManager.enable();
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
|
||||
dismiss();
|
||||
});
|
||||
|
||||
@@ -11,7 +11,6 @@ import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -28,7 +27,6 @@ import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.databinding.DialogScanOrCreateLuBinding;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
import it.integry.integrywmsnative.view.dialogs.basket_lu.DialogBasketLU;
|
||||
@@ -133,12 +131,10 @@ public class DialogScanOrCreateLUView extends BaseDialogFragment implements Dial
|
||||
}
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
this.onLoadingStarted();
|
||||
|
||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||
BarcodeManager.enable();
|
||||
this.closeProgress();
|
||||
this.onLoadingEnded();
|
||||
});
|
||||
};
|
||||
|
||||
@@ -159,7 +155,7 @@ public class DialogScanOrCreateLUView extends BaseDialogFragment implements Dial
|
||||
}, () -> {
|
||||
onConfirm.run(false);
|
||||
})
|
||||
.show(((AppCompatActivity) getActivity()).getSupportFragmentManager(), "tag");
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -169,21 +165,4 @@ public class DialogScanOrCreateLUView extends BaseDialogFragment implements Dial
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
this.closeProgress();
|
||||
UtilityExceptions.defaultException(getActivity(), ex);
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingStarted() {
|
||||
this.openProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingEnded() {
|
||||
this.closeProgress();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BIN
app/src/main/res/drawable/ic_scale.png
Normal file
BIN
app/src/main/res/drawable/ic_scale.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 889 B |
@@ -65,6 +65,18 @@
|
||||
android:src="@drawable/ic_erase_96"
|
||||
android:tint="@android:color/white" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/read_weight_form_device"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="end"
|
||||
android:adjustViewBounds="true"
|
||||
android:backgroundTint="@android:color/transparent"
|
||||
android:onClick="@{() -> view.readWeightFromDevice()}"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_scale"
|
||||
android:tint="@android:color/white" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
|
||||
@@ -52,6 +52,18 @@
|
||||
android:onClick="@{() -> view.resetValues()}"
|
||||
android:tint="@android:color/white"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/read_weight_form_device"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="end"
|
||||
android:adjustViewBounds="true"
|
||||
android:backgroundTint="@android:color/transparent"
|
||||
android:onClick="@{() -> view.readWeightFromDevice()}"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_scale"
|
||||
android:tint="@android:color/white" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
|
||||
@@ -27,11 +27,15 @@
|
||||
type="it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/white">
|
||||
|
||||
android:background="@color/full_white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
@@ -39,9 +43,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:titleTextColor="@android:color/white">
|
||||
|
||||
|
||||
@@ -50,10 +51,7 @@
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
@@ -774,8 +772,6 @@
|
||||
android:layout_weight="0.4"
|
||||
android:onClick="@{() -> view.saveAndCloseLU()}"
|
||||
android:text="@string/action_close_ul"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:strokeColor="@color/colorPrimary"
|
||||
app:visibility="@{view.enabledLUCloseButton}" />
|
||||
|
||||
@@ -791,8 +787,7 @@
|
||||
android:onClick="@{() -> view.dismiss()}"
|
||||
android:paddingEnd="3dp"
|
||||
app:icon="@drawable/ic_close_24dp"
|
||||
app:iconGravity="textStart"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:iconGravity="textStart" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
@@ -806,13 +801,13 @@
|
||||
android:onClick="@{() -> view.save()}"
|
||||
android:paddingEnd="3dp"
|
||||
app:icon="@drawable/ic_save_24"
|
||||
app:iconGravity="textStart"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:iconGravity="textStart" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
</layout>
|
||||
@@ -30,6 +30,9 @@
|
||||
<string name="reset">Resetta</string>
|
||||
<string name="dispatched_abbr">Evasi</string>
|
||||
<string name="logistic_unit">UL</string>
|
||||
<string name="pallet_scale">Bilancia UL</string>
|
||||
<string name="pallet_scale_bt_device_selection_title">Dispositivo bluetooth</string>
|
||||
<string name="pallet_scale_bt_device_selection_info">Seleziona un dispositivo bluetooth già associato</string>
|
||||
|
||||
<string name="permission_request_message">Questi permessi sono necessari al funzionamento dell\'app</string>
|
||||
<string name="picking_not_available">Picking non disponibile</string>
|
||||
|
||||
@@ -81,6 +81,9 @@
|
||||
<string name="dialog_input_peso_lu_description">Insert info about LU TYPE and NET / GROSS weight</string>
|
||||
<string name="info">Info</string>
|
||||
<string name="lu_info">LU\'s info</string>
|
||||
<string name="pallet_scale">Pallet scale</string>
|
||||
<string name="pallet_scale_bt_device_selection_title">Bluetooth device</string>
|
||||
<string name="pallet_scale_bt_device_selection_info">Please select a paired bluetooth device</string>
|
||||
|
||||
<string name="action_continue">Continue</string>
|
||||
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
<androidx.preference.PreferenceScreen
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<androidx.preference.PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<PreferenceCategory
|
||||
app:title="@string/accettazione_title_fragment"/>
|
||||
app:title="@string/accettazione_title_fragment"
|
||||
app:iconSpaceReserved="false">
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
app:defaultValue="true"
|
||||
app:key="picking_ingresso_enable_sec_unt_mis"
|
||||
app:title="Abilita seconda unità di misura"
|
||||
app:defaultValue="true"/>
|
||||
app:singleLineTitle="false"
|
||||
app:title="Abilita seconda unità di misura" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
app:title="@string/vendita_title_fragment"/>
|
||||
app:title="@string/vendita_title_fragment"
|
||||
app:iconSpaceReserved="false">
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
app:defaultValue="true"
|
||||
app:singleLineTitle="false"
|
||||
app:key="picking_uscita_enable_quantity_reset"
|
||||
app:title="Resetta le quantità ad ogni Chiudi UL"
|
||||
app:defaultValue="true"/>
|
||||
app:title="Resetta le quantità ad ogni Chiudi UL" />
|
||||
|
||||
<!-- <Preference-->
|
||||
<!-- app:key="feedback"-->
|
||||
<!-- app:title="Send feedback"-->
|
||||
<!-- app:summary="Report technical issues or suggest new features"/>-->
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
app:title="@string/pallet_scale"
|
||||
app:iconSpaceReserved="false">
|
||||
|
||||
<!-- <ListPreference-->
|
||||
<!-- app:key="check_in_printer"-->
|
||||
<!-- app:title="@string/check_in_printer"-->
|
||||
<!-- app:summary="%s"-->
|
||||
<!-- app:entries="@array/printerTypes"-->
|
||||
<!-- app:entryValues="@array/printerTypes"-->
|
||||
<!-- app:defaultValue="0" />-->
|
||||
<ListPreference
|
||||
app:iconSpaceReserved="false"
|
||||
app:dialogTitle="@string/pallet_scale"
|
||||
app:key="pallet_scale_bt_device"
|
||||
app:summary="@string/pallet_scale_bt_device_selection_info"
|
||||
app:title="@string/pallet_scale_bt_device_selection_title" />
|
||||
|
||||
<!-- <ListPreference-->
|
||||
<!-- app:key="check_out_printer"-->
|
||||
<!-- app:title="@string/check_out_printer"-->
|
||||
<!-- app:summary="%s"-->
|
||||
<!-- app:entries="@array/printerTypes"-->
|
||||
<!-- app:entryValues="@array/printerTypes"-->
|
||||
<!-- app:defaultValue="0" />-->
|
||||
</PreferenceCategory>
|
||||
|
||||
</androidx.preference.PreferenceScreen>
|
||||
@@ -22,11 +22,11 @@ android {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -10,7 +10,7 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.1.2'
|
||||
classpath 'com.android.tools.build:gradle:7.1.3'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.google.gms:google-services:4.3.10'
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ android {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
BIN
ext_sources/ICONS/icons8-bilancia-96.png
Normal file
BIN
ext_sources/ICONS/icons8-bilancia-96.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 889 B |
@@ -22,10 +22,10 @@ android {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -22,10 +22,10 @@ android {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -21,10 +21,10 @@ android {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -21,10 +21,10 @@ android {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
Reference in New Issue
Block a user