Compare commits
25 Commits
v1.24.0
...
v1.24.4(27
| Author | SHA1 | Date | |
|---|---|---|---|
| a0e17f557d | |||
| 684946bb14 | |||
| 4aab6b1688 | |||
| 310a79f41d | |||
| f8164ca1eb | |||
| 790a9eae6c | |||
| b41edd314f | |||
| 34d8a93c01 | |||
| 3b45d8fe35 | |||
| aba1fcdc7b | |||
| 012d7caa52 | |||
| e7e20da206 | |||
| ef6535897b | |||
| 8c75ecbd0a | |||
| fad3c4243d | |||
| a6e75114cb | |||
| 48a83bc0d5 | |||
| b58475b426 | |||
| 207daab105 | |||
| c32da27b7f | |||
| 1f94c14634 | |||
| 4880ea8301 | |||
| a2d165d475 | |||
| d142f0c868 | |||
| 746838010a |
@@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 268
|
def appVersionCode = 272
|
||||||
def appVersionName = '1.24.0'
|
def appVersionName = '1.24.4'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
@@ -85,7 +85,6 @@ android {
|
|||||||
dynamicFeatures = [":dynamic__base", ":dynamic_vgalimenti"]
|
dynamicFeatures = [":dynamic__base", ":dynamic_vgalimenti"]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
package it.integry.integrywmsnative;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import androidx.test.InstrumentationRegistry;
|
|
||||||
import androidx.test.runner.AndroidJUnit4;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instrumentation test, which will execute on an Android device.
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
|
||||||
public class ExampleInstrumentedTest {
|
|
||||||
@Test
|
|
||||||
public void useAppContext() throws Exception {
|
|
||||||
// Context of the app under test.
|
|
||||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
|
||||||
|
|
||||||
assertEquals("it.integry.integrywmsnative", appContext.getPackageName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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.data_store.db.RoomModule;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseActivityComponent;
|
import it.integry.integrywmsnative.core.expansion.BaseActivityComponent;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseActivityModule;
|
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.BaseFragmentComponent;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseFragmentModule;
|
import it.integry.integrywmsnative.core.expansion.BaseFragmentModule;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
||||||
@@ -91,6 +93,7 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
MainApplicationModule.class,
|
MainApplicationModule.class,
|
||||||
BaseActivityModule.class,
|
BaseActivityModule.class,
|
||||||
BaseFragmentModule.class,
|
BaseFragmentModule.class,
|
||||||
|
BaseDialogFragmentModule.class,
|
||||||
LoginModule.class,
|
LoginModule.class,
|
||||||
MainActivityModule.class,
|
MainActivityModule.class,
|
||||||
MainFragmentModule.class,
|
MainFragmentModule.class,
|
||||||
@@ -133,6 +136,8 @@ public interface MainApplicationComponent {
|
|||||||
|
|
||||||
BaseFragmentComponent.Factory baseFragmentComponent();
|
BaseFragmentComponent.Factory baseFragmentComponent();
|
||||||
|
|
||||||
|
BaseDialogFragmentComponent.Factory baseDialogFragmentComponent();
|
||||||
|
|
||||||
SplashActivityComponent.Factory splashActivityComponent();
|
SplashActivityComponent.Factory splashActivityComponent();
|
||||||
|
|
||||||
LoginComponent.Factory loginActivityComponent();
|
LoginComponent.Factory loginActivityComponent();
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class ColliDataRecoverService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean thereIsAnExistantSession() {
|
public boolean thereIsAnExistantSession() {
|
||||||
return mtbColtsSessions.size() > 0;
|
return mtbColtsSessions != null && mtbColtsSessions.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Integer> getAllSessionIDs() {
|
public List<Integer> getAllSessionIDs() {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import androidx.room.Database;
|
|||||||
import androidx.room.RoomDatabase;
|
import androidx.room.RoomDatabase;
|
||||||
import androidx.room.TypeConverters;
|
import androidx.room.TypeConverters;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.converter.BigDecimalConverter;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.converter.DateConverter;
|
import it.integry.integrywmsnative.core.data_store.db.converter.DateConverter;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloGrigliaDao;
|
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloGrigliaDao;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
||||||
@@ -20,7 +21,8 @@ import it.integry.integrywmsnative.core.data_store.db.entity.SqlMtbColt;
|
|||||||
|
|
||||||
@Database(entities = {ArticoloGriglia.class, Griglia.class, Ordine.class, ArticoloOrdine.class, SqlMtbColt.class, SqlMtbColr.class}, version = 8, exportSchema = false)
|
@Database(entities = {ArticoloGriglia.class, Griglia.class, Ordine.class, ArticoloOrdine.class, SqlMtbColt.class, SqlMtbColr.class}, version = 8, exportSchema = false)
|
||||||
@TypeConverters({
|
@TypeConverters({
|
||||||
DateConverter.class
|
DateConverter.class,
|
||||||
|
BigDecimalConverter.class
|
||||||
})
|
})
|
||||||
public abstract class AppDatabase extends RoomDatabase {
|
public abstract class AppDatabase extends RoomDatabase {
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package it.integry.integrywmsnative.core.data_store.db.converter;
|
||||||
|
|
||||||
|
import androidx.room.TypeConverter;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class BigDecimalConverter {
|
||||||
|
@TypeConverter
|
||||||
|
public static BigDecimal fromFloat(Float value) {
|
||||||
|
return value == null ? null : BigDecimal.valueOf(value.doubleValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeConverter
|
||||||
|
public static Float dateToTimestamp(BigDecimal value) {
|
||||||
|
return value == null ? null : value.floatValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,9 +8,8 @@ import androidx.room.Update;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
import it.integry.integrywmsnative.core.data_store.db.wrappers.ArticoloOrdineWrapper;
|
||||||
|
|
||||||
@Dao
|
@Dao
|
||||||
public interface ArticoloOrdineDao {
|
public interface ArticoloOrdineDao {
|
||||||
@@ -34,8 +33,17 @@ public interface ArticoloOrdineDao {
|
|||||||
@Update
|
@Update
|
||||||
void update(ArticoloOrdine articolo);
|
void update(ArticoloOrdine articolo);
|
||||||
|
|
||||||
@Query("SELECT * FROM articoli_ordine where id_ordine = :ordineId")
|
@Query("SELECT articoli_ordine.*," +
|
||||||
List<ArticoloOrdine> findArticoliByOrdine(int ordineId);
|
"articoli_griglia.gg_scadenza," +
|
||||||
|
"articoli_griglia.giacenza," +
|
||||||
|
"articoli_griglia.qta_prevista_vendita," +
|
||||||
|
"articoli_griglia.qta_proposta " +
|
||||||
|
"FROM articoli_ordine " +
|
||||||
|
"INNER JOIN ordini on articoli_ordine.id_ordine = ordini.ordine_id " +
|
||||||
|
"LEFT OUTER JOIN articoli_griglia " +
|
||||||
|
"on articoli_ordine.cod_mart = articoli_griglia.cod_mart and ordini.id_griglia = articoli_griglia.id_griglia and articoli_ordine.bar_code = articoli_griglia.bar_code " +
|
||||||
|
"where id_ordine = :ordineId")
|
||||||
|
List<ArticoloOrdineWrapper> findArticoliByOrdine(int ordineId);
|
||||||
|
|
||||||
@Query("SELECt * from articoli_ordine where cod_mart = :codMart and id_ordine = :ordineId LIMIT 1")
|
@Query("SELECt * from articoli_ordine where cod_mart = :codMart and id_ordine = :ordineId LIMIT 1")
|
||||||
ArticoloOrdine findArticoloByCodMartAndOrdine(int ordineId, String codMart);
|
ArticoloOrdine findArticoloByCodMartAndOrdine(int ordineId, String codMart);
|
||||||
|
|||||||
@@ -82,6 +82,9 @@ public class ArticoloOrdine {
|
|||||||
@Ignore
|
@Ignore
|
||||||
private BigDecimal qtaProposta = BigDecimal.ZERO;
|
private BigDecimal qtaProposta = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
@Ignore
|
||||||
|
private int bgTint;
|
||||||
|
|
||||||
|
|
||||||
public Integer getArticoloOrdineId() {
|
public Integer getArticoloOrdineId() {
|
||||||
return articoloOrdineId;
|
return articoloOrdineId;
|
||||||
@@ -244,6 +247,23 @@ public class ArticoloOrdine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public float getCnfDaRic() {
|
public float getCnfDaRic() {
|
||||||
return qtaCnf > 0.f ? merceDaRic / qtaCnf : 0;
|
return qtaCnf > 0.f ? merceDaRic * qtaCnf : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int checkQtaProposta() {
|
||||||
|
int check = 0;
|
||||||
|
if (!qtaProposta.equals(BigDecimal.ZERO)) {
|
||||||
|
check = BigDecimal.valueOf(qtaOrd).compareTo(qtaProposta);
|
||||||
|
}
|
||||||
|
return check;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBgTint() {
|
||||||
|
return bgTint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArticoloOrdine setBgTint(int bgTint) {
|
||||||
|
this.bgTint = bgTint;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.data_store.db.repository.implementations;
|
package it.integry.integrywmsnative.core.data_store.db.repository.implementations;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -11,6 +13,7 @@ import it.integry.integrywmsnative.core.data_store.db.dao.ArticoloOrdineDao;
|
|||||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
import it.integry.integrywmsnative.core.data_store.db.entity.Ordine;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoliOrdineRepository;
|
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoliOrdineRepository;
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.wrappers.ArticoloOrdineWrapper;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
|
||||||
public class ArticoliOrdineDataSource extends Repository implements ArticoliOrdineRepository {
|
public class ArticoliOrdineDataSource extends Repository implements ArticoliOrdineRepository {
|
||||||
@@ -95,7 +98,15 @@ public class ArticoliOrdineDataSource extends Repository implements ArticoliOrdi
|
|||||||
public void findArticoliByOrdine(Ordine ordine, RunnableArgs<List<ArticoloOrdine>> onLoad, RunnableArgs<Exception> onError) {
|
public void findArticoliByOrdine(Ordine ordine, RunnableArgs<List<ArticoloOrdine>> onLoad, RunnableArgs<Exception> onError) {
|
||||||
execute(() -> {
|
execute(() -> {
|
||||||
try {
|
try {
|
||||||
onLoad.run(mArticoloOrdineDao.findArticoliByOrdine(ordine.getOrdineId()));
|
List<ArticoloOrdineWrapper> list = mArticoloOrdineDao.findArticoliByOrdine(ordine.getOrdineId());
|
||||||
|
onLoad.run(Stream.of(list).map(x -> {
|
||||||
|
ArticoloOrdine art = x.getArticoloOrdine();
|
||||||
|
art.setGgScadenza(x.getGgScadenza());
|
||||||
|
art.setGiacenza(x.getGiacenza());
|
||||||
|
art.setQtaProposta(x.getQtaProposta());
|
||||||
|
art.setQtaPrevistaVendita(x.getQtaPrevistaVendita());
|
||||||
|
return art;
|
||||||
|
}).toList());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
onError.run(e);
|
onError.run(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package it.integry.integrywmsnative.core.data_store.db.wrappers;
|
||||||
|
|
||||||
|
import androidx.room.ColumnInfo;
|
||||||
|
import androidx.room.Embedded;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||||
|
|
||||||
|
public class ArticoloOrdineWrapper {
|
||||||
|
@Embedded
|
||||||
|
private ArticoloOrdine articoloOrdine;
|
||||||
|
|
||||||
|
@ColumnInfo(name = "gg_scadenza")
|
||||||
|
private int ggScadenza = 0;
|
||||||
|
|
||||||
|
@ColumnInfo(name = "giacenza")
|
||||||
|
private BigDecimal giacenza = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
@ColumnInfo(name = "qta_prevista_vendita")
|
||||||
|
private BigDecimal qtaPrevistaVendita = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
@ColumnInfo(name = "qta_proposta")
|
||||||
|
private BigDecimal qtaProposta = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
public ArticoloOrdine getArticoloOrdine() {
|
||||||
|
return articoloOrdine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArticoloOrdine(ArticoloOrdine articoloOrdine) {
|
||||||
|
this.articoloOrdine = articoloOrdine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGgScadenza() {
|
||||||
|
return ggScadenza;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGgScadenza(int ggScadenza) {
|
||||||
|
this.ggScadenza = ggScadenza;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getGiacenza() {
|
||||||
|
return giacenza;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGiacenza(BigDecimal giacenza) {
|
||||||
|
this.giacenza = giacenza;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaPrevistaVendita() {
|
||||||
|
return qtaPrevistaVendita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQtaPrevistaVendita(BigDecimal qtaPrevistaVendita) {
|
||||||
|
this.qtaPrevistaVendita = qtaPrevistaVendita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getQtaProposta() {
|
||||||
|
return qtaProposta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQtaProposta(BigDecimal qtaProposta) {
|
||||||
|
this.qtaProposta = qtaProposta;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package it.integry.integrywmsnative.core.exception;
|
||||||
|
|
||||||
|
public class NotValidLicenseException extends Exception {
|
||||||
|
|
||||||
|
public NotValidLicenseException() {
|
||||||
|
super("Licenza non valida");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,6 +36,45 @@ public class BaseActivity extends AppCompatActivity {
|
|||||||
return v;
|
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
|
@Override
|
||||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||||
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
||||||
@@ -56,47 +95,4 @@ public class BaseActivity extends AppCompatActivity {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void openProgress() {
|
|
||||||
BarcodeManager.disable();
|
|
||||||
if (!progressOpened) {
|
|
||||||
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.FragmentManager;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
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.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
|
||||||
public class BaseDialogFragment extends DialogFragment {
|
public class BaseDialogFragment extends DialogFragment {
|
||||||
|
|
||||||
private boolean mBarcodeListener = false;
|
@Inject
|
||||||
private DialogProgressView mCurrentProgress;
|
public DialogProgressView mCurrentProgress;
|
||||||
|
private boolean progressOpened;
|
||||||
|
|
||||||
|
private boolean mBarcodeListener = false;
|
||||||
|
|
||||||
public BaseDialogFragment() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -41,6 +43,11 @@ public class BaseDialogFragment extends DialogFragment {
|
|||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
MainApplication.appComponent
|
||||||
|
.baseDialogFragmentComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
||||||
getDialog().setOnKeyListener((dialog, keyCode, event) -> {
|
getDialog().setOnKeyListener((dialog, keyCode, event) -> {
|
||||||
if (mBarcodeListener && (event.getAction() == KeyEvent.ACTION_DOWN || event.getAction() == KeyEvent.ACTION_MULTIPLE) && !isControlKey(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) {
|
private boolean isControlKey(KeyEvent keyEvent) {
|
||||||
int keyCode = keyEvent.getKeyCode();
|
int keyCode = keyEvent.getKeyCode();
|
||||||
return (
|
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;
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -63,6 +64,30 @@ public abstract class BaseFragment extends Fragment {
|
|||||||
BarcodeManager.enable();
|
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) {
|
public void onError(Exception ex) {
|
||||||
requireActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
this.closeProgress();
|
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() {
|
protected void popMe() {
|
||||||
requireActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
((IPoppableActivity) requireActivity()).pop();
|
((IPoppableActivity) requireActivity()).pop();
|
||||||
|
|||||||
@@ -2,12 +2,16 @@ package it.integry.integrywmsnative.core.model;
|
|||||||
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
|
||||||
|
import com.annimon.stream.Optional;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.dto.InternalCodAnagsDTO;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
||||||
@@ -105,11 +109,41 @@ public class MtbColt extends EntityBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MtbColt initDefaultFields() {
|
public MtbColt initDefaultFields(GestioneEnum gestioneEnum) {
|
||||||
|
setGestione(gestioneEnum);
|
||||||
setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep());
|
setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep());
|
||||||
setPreparatoDa(SettingsManager.i().getUser().getFullname());
|
setPreparatoDa(SettingsManager.i().getUser().getFullname());
|
||||||
setOraInizPrep(UtilityDate.getDateInstance());
|
setOraInizPrep(UtilityDate.getDateInstance());
|
||||||
setCodAnag(SettingsManager.iDB().getDefaultCodAnag());
|
|
||||||
|
String codAnagToUse = null;
|
||||||
|
switch (gestioneEnum) {
|
||||||
|
case ACQUISTO:
|
||||||
|
case LAVORAZIONE:
|
||||||
|
case PRODUZIONE:
|
||||||
|
if(SettingsManager.iDB().getInternalCodAnags() == null) break;
|
||||||
|
|
||||||
|
Optional<InternalCodAnagsDTO> optCodAnagForn = Stream.of(SettingsManager.iDB().getInternalCodAnags())
|
||||||
|
.filter(InternalCodAnagsDTO::isFornitore)
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
if(optCodAnagForn.isEmpty()) break;
|
||||||
|
|
||||||
|
codAnagToUse = optCodAnagForn.get().getCodAnag();
|
||||||
|
break;
|
||||||
|
case VENDITA:
|
||||||
|
if(SettingsManager.iDB().getInternalCodAnags() == null) break;
|
||||||
|
|
||||||
|
Optional<InternalCodAnagsDTO> optCodAnagClie = Stream.of(SettingsManager.iDB().getInternalCodAnags())
|
||||||
|
.filter(InternalCodAnagsDTO::isCliente)
|
||||||
|
.findFirst();
|
||||||
|
|
||||||
|
if(optCodAnagClie.isEmpty()) break;
|
||||||
|
|
||||||
|
codAnagToUse = optCodAnagClie.get().getCodAnag();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
setCodAnag(codAnagToUse);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model.dto;
|
||||||
|
|
||||||
|
public class InternalCodAnagsDTO {
|
||||||
|
|
||||||
|
private String codAnag;
|
||||||
|
private boolean isCliente;
|
||||||
|
private boolean isFornitore;
|
||||||
|
|
||||||
|
public String getCodAnag() {
|
||||||
|
return codAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public InternalCodAnagsDTO setCodAnag(String codAnag) {
|
||||||
|
this.codAnag = codAnag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCliente() {
|
||||||
|
return isCliente;
|
||||||
|
}
|
||||||
|
|
||||||
|
public InternalCodAnagsDTO setCliente(boolean cliente) {
|
||||||
|
isCliente = cliente;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFornitore() {
|
||||||
|
return isFornitore;
|
||||||
|
}
|
||||||
|
|
||||||
|
public InternalCodAnagsDTO setFornitore(boolean fornitore) {
|
||||||
|
isFornitore = fornitore;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -104,10 +104,9 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
|
|
||||||
public void createColloLavorazione(int segno, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createColloLavorazione(int segno, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MtbColt mtbColtToCreate = new MtbColt()
|
MtbColt mtbColtToCreate = new MtbColt()
|
||||||
.setSegno(segno)
|
.setSegno(segno);
|
||||||
.setGestione(GestioneEnum.LAVORAZIONE);
|
|
||||||
|
|
||||||
mtbColtToCreate.initDefaultFields();
|
mtbColtToCreate.initDefaultFields(GestioneEnum.LAVORAZIONE);
|
||||||
|
|
||||||
mtbColtToCreate
|
mtbColtToCreate
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
.setOperation(CommonModelConsts.OPERATION.INSERT);
|
||||||
@@ -123,9 +122,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
public void createColloScaricoDaCarico(MtbColt sourceMtbColt, MtbDepoPosizione posizione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createColloScaricoDaCarico(MtbColt sourceMtbColt, MtbDepoPosizione posizione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
MtbColt newMtbColt = new MtbColt()
|
MtbColt newMtbColt = new MtbColt()
|
||||||
.initDefaultFields()
|
.initDefaultFields(GestioneEnum.LAVORAZIONE)
|
||||||
.setCodAnag(null)
|
.setCodAnag(null)
|
||||||
.setGestione(GestioneEnum.LAVORAZIONE)
|
|
||||||
.setSegno(-1)
|
.setSegno(-1)
|
||||||
.setCodTcol(sourceMtbColt.getCodTcol())
|
.setCodTcol(sourceMtbColt.getCodTcol())
|
||||||
.setPesoKg(sourceMtbColt.getPesoKg())
|
.setPesoKg(sourceMtbColt.getPesoKg())
|
||||||
@@ -176,9 +174,8 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
public void createColliScaricoDaOrdineLavorazione(MtbColt sourceMtbColt, MtbColr sourceMtbColr, MtbDepoPosizione posizione, List<OrdineLavorazioneDTO> ordini, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createColliScaricoDaOrdineLavorazione(MtbColt sourceMtbColt, MtbColr sourceMtbColr, MtbDepoPosizione posizione, List<OrdineLavorazioneDTO> ordini, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
MtbColt newMtbColt = new MtbColt()
|
MtbColt newMtbColt = new MtbColt()
|
||||||
.initDefaultFields()
|
.initDefaultFields(GestioneEnum.LAVORAZIONE)
|
||||||
.setCodAnag(null)
|
.setCodAnag(null)
|
||||||
.setGestione(GestioneEnum.LAVORAZIONE)
|
|
||||||
.setSegno(-1)
|
.setSegno(-1)
|
||||||
.setCodTcol(sourceMtbColt.getCodTcol())
|
.setCodTcol(sourceMtbColt.getCodTcol())
|
||||||
// .setPesoKg(sourceMtbColt.getPesoKg())
|
// .setPesoKg(sourceMtbColt.getPesoKg())
|
||||||
@@ -246,9 +243,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
public void createColloFromEtichettaAnonima(String barcode, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public void createColloFromEtichettaAnonima(String barcode, GestioneEnum gestione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
MtbColt mtbColtToCreate = new MtbColt()
|
MtbColt mtbColtToCreate = new MtbColt()
|
||||||
.setGestione(gestione);
|
.initDefaultFields(gestione);
|
||||||
|
|
||||||
mtbColtToCreate.initDefaultFields();
|
|
||||||
|
|
||||||
Integer customNumCollo = UtilityBarcode.getNumColloFromULAnonima(barcode);
|
Integer customNumCollo = UtilityBarcode.getNumColloFromULAnonima(barcode);
|
||||||
String customSerCollo = CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE;
|
String customSerCollo = CommonConst.Config.DEFAULT_ANONYMOUS_UL_SERIE;
|
||||||
@@ -587,35 +582,37 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone();
|
new Thread(() -> {
|
||||||
MtbColt mtbColtDestClone = (MtbColt) destMtbColt.clone();
|
MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone();
|
||||||
|
MtbColt mtbColtDestClone = (MtbColt) destMtbColt.clone();
|
||||||
|
|
||||||
for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) {
|
for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) {
|
||||||
mtbColtToMoveClone.getMtbColr().get(i)
|
mtbColtToMoveClone.getMtbColr().get(i)
|
||||||
.setMtbAart(null)
|
.setMtbAart(null)
|
||||||
.setMtbPartitaMag(null);
|
.setMtbPartitaMag(null);
|
||||||
}
|
|
||||||
|
|
||||||
mtbColtDestClone.setMtbColr(null);
|
|
||||||
|
|
||||||
SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO = new SpostaArtsTraULRequestDTO()
|
|
||||||
.setSourceMtbColt(mtbColtToMoveClone)
|
|
||||||
.setDestinationMtbColt(mtbColtDestClone);
|
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
|
||||||
colliMagazzinoRESTConsumerService.spostaArtsTraUL(spostaArtsTraULRequestDTO).enqueue(new Callback<>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
|
||||||
analyzeAnswer(response, "spostaArtsTraUL", data -> {
|
|
||||||
onComplete.run();
|
|
||||||
}, onFailed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
mtbColtDestClone.setMtbColr(null);
|
||||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
|
||||||
if (onFailed != null) onFailed.run(new Exception(t));
|
SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO = new SpostaArtsTraULRequestDTO()
|
||||||
}
|
.setSourceMtbColt(mtbColtToMoveClone)
|
||||||
});
|
.setDestinationMtbColt(mtbColtDestClone);
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
|
colliMagazzinoRESTConsumerService.spostaArtsTraUL(spostaArtsTraULRequestDTO).enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
|
analyzeAnswer(response, "spostaArtsTraUL", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import android.util.Log;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.exception.NotValidLicenseException;
|
||||||
import it.integry.integrywmsnative.core.rest.CommonRESTException;
|
import it.integry.integrywmsnative.core.rest.CommonRESTException;
|
||||||
import it.integry.integrywmsnative.core.rest.model.EsitoType;
|
import it.integry.integrywmsnative.core.rest.model.EsitoType;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
@@ -41,7 +42,9 @@ public class _BaseRESTConsumer {
|
|||||||
if (response.code() == 404) {
|
if (response.code() == 404) {
|
||||||
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url().toString() + ")");
|
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url().toString() + ")");
|
||||||
onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")"));
|
onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")"));
|
||||||
} else {
|
} else if (response.code() == 550)
|
||||||
|
onFailed.run(new NotValidLicenseException());
|
||||||
|
else {
|
||||||
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
||||||
onFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
|
onFailed.run(new Exception("Status " + response.code() + ": " + response.message()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,23 +30,27 @@ public class ServerStatusChecker {
|
|||||||
private Runnable runnableCode = new Runnable() {
|
private Runnable runnableCode = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if(shouldExecute && !UtilityString.isNullOrEmpty(SettingsManager.i().getServer().getHost())) {
|
if (shouldExecute && !UtilityString.isNullOrEmpty(SettingsManager.i().getServer().getHost())) {
|
||||||
UtilityServer.isEmsApiAvailable(SettingsManager.i().getServer().getHost(), SettingsManager.i().getServer().getPort(), mInternalCallback);
|
UtilityServer.isEmsApiAvailable(
|
||||||
|
SettingsManager.i().getServer().getHost(),
|
||||||
|
SettingsManager.i().getServer().getPort(),
|
||||||
|
() -> mInternalCallback.run(true),
|
||||||
|
ex -> mInternalCallback.run(false));
|
||||||
handler.postDelayed(this, MILLIS_DELAY);
|
handler.postDelayed(this, MILLIS_DELAY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public void addCallback(RunnableArgs<Boolean> callback){
|
public void addCallback(RunnableArgs<Boolean> callback) {
|
||||||
this.mCallback.add(callback);
|
this.mCallback.add(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeCallback(RunnableArgs<Boolean> callback){
|
public void removeCallback(RunnableArgs<Boolean> callback) {
|
||||||
this.mCallback.remove(callback);
|
this.mCallback.remove(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void init(){
|
public static void init() {
|
||||||
instance.shouldExecute = true;
|
instance.shouldExecute = true;
|
||||||
|
|
||||||
instance.handler.post(instance.runnableCode);
|
instance.handler.post(instance.runnableCode);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.Azienda;
|
import it.integry.integrywmsnative.core.model.Azienda;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
|
import it.integry.integrywmsnative.core.model.dto.InternalCodAnagsDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
import it.integry.integrywmsnative.core.rest.model.AvailableCodMdepsDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
import it.integry.integrywmsnative.core.rest.model.DistribuzioneColloDTO;
|
||||||
|
|
||||||
@@ -15,10 +16,11 @@ public class DBSettingsModel {
|
|||||||
private List<MtbDepoPosizione> availablePosizioni = null;
|
private List<MtbDepoPosizione> availablePosizioni = null;
|
||||||
|
|
||||||
private Azienda datiAzienda = null;
|
private Azienda datiAzienda = null;
|
||||||
|
private List<InternalCodAnagsDTO> internalCodAnags = null;
|
||||||
|
|
||||||
private boolean enableCheckPartitaMagCheckPickingV;
|
private boolean enableCheckPartitaMagCheckPickingV;
|
||||||
private boolean flagMultiClienteOrdV;
|
private boolean flagMultiClienteOrdV;
|
||||||
private String defaultCodAnag;
|
private boolean flagUseCodAnagAziendale;
|
||||||
private String defaultCausaleRettificaGiacenze;
|
private String defaultCausaleRettificaGiacenze;
|
||||||
private DistribuzioneColloDTO.CriterioDistribuzione defaultCriterioDistribuzione;
|
private DistribuzioneColloDTO.CriterioDistribuzione defaultCriterioDistribuzione;
|
||||||
private boolean flagAskClienteInPickingLibero;
|
private boolean flagAskClienteInPickingLibero;
|
||||||
@@ -37,6 +39,7 @@ public class DBSettingsModel {
|
|||||||
private List<String> notePerditaDocInterni = new ArrayList<>();
|
private List<String> notePerditaDocInterni = new ArrayList<>();
|
||||||
private boolean flagSpedizioneUseQtaOrd;
|
private boolean flagSpedizioneUseQtaOrd;
|
||||||
private boolean flagOrdinaNuoviArticoliInGriglia;
|
private boolean flagOrdinaNuoviArticoliInGriglia;
|
||||||
|
private boolean flagOrdinaArticoliOnScan;
|
||||||
private String docInterniCheckFornitore;
|
private String docInterniCheckFornitore;
|
||||||
private String produzioneDefaultCodAnag;
|
private String produzioneDefaultCodAnag;
|
||||||
private String reportNameSpedizionChiudiOrdine;
|
private String reportNameSpedizionChiudiOrdine;
|
||||||
@@ -80,6 +83,15 @@ public class DBSettingsModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<InternalCodAnagsDTO> getInternalCodAnags() {
|
||||||
|
return internalCodAnags;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setInternalCodAnags(List<InternalCodAnagsDTO> internalCodAnags) {
|
||||||
|
this.internalCodAnags = internalCodAnags;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public List<AvailableCodMdepsDTO> getAvailableCodMdep() {
|
public List<AvailableCodMdepsDTO> getAvailableCodMdep() {
|
||||||
return availableCodMdep;
|
return availableCodMdep;
|
||||||
}
|
}
|
||||||
@@ -106,12 +118,12 @@ public class DBSettingsModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDefaultCodAnag() {
|
public boolean isFlagUseCodAnagAziendale() {
|
||||||
return defaultCodAnag;
|
return flagUseCodAnagAziendale;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DBSettingsModel setDefaultCodAnag(String defaultCodAnag) {
|
public DBSettingsModel setFlagUseCodAnagAziendale(boolean flagUseCodAnagAziendale) {
|
||||||
this.defaultCodAnag = defaultCodAnag;
|
this.flagUseCodAnagAziendale = flagUseCodAnagAziendale;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,4 +334,14 @@ public class DBSettingsModel {
|
|||||||
this.flagPickLiberoAllowEmptyDest = flagPickLiberoAllowEmptyDest;
|
this.flagPickLiberoAllowEmptyDest = flagPickLiberoAllowEmptyDest;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean getFlagOrdinaArticoliOnScan() {
|
||||||
|
return flagOrdinaArticoliOnScan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DBSettingsModel setFlagOrdinaArticoliOnScan(boolean flagOrdinaArticoliOnScan) {
|
||||||
|
this.flagOrdinaArticoliOnScan = flagOrdinaArticoliOnScan;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ import android.content.Context;
|
|||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.firebase.perf.metrics.Trace;
|
import com.google.firebase.perf.metrics.Trace;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
import java.net.SocketTimeoutException;
|
import java.net.SocketTimeoutException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@@ -13,6 +15,7 @@ import java.util.List;
|
|||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.StbGestSetup;
|
import it.integry.integrywmsnative.core.model.StbGestSetup;
|
||||||
|
import it.integry.integrywmsnative.core.model.dto.InternalCodAnagsDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
@@ -88,21 +91,18 @@ public class SettingsManager {
|
|||||||
onFailed.run(new Exception("Errore durante il caricamento dei dati. Riavviare l'applicazione!"));
|
onFailed.run(new Exception("Errore durante il caricamento dei dati. Riavviare l'applicazione!"));
|
||||||
};
|
};
|
||||||
|
|
||||||
onProgress.run("dati azienda");
|
|
||||||
loadDatiAzienda(() -> {
|
|
||||||
|
|
||||||
onProgress.run("profili");
|
onProgress.run("depositi");
|
||||||
loadAvailableProfiles(() -> {
|
loadAvailableCodMdeps(() -> {
|
||||||
|
|
||||||
onProgress.run("depositi");
|
onProgress.run("posizioni");
|
||||||
loadAvailableCodMdeps(() -> {
|
loadAvailablePosizioni(() -> {
|
||||||
|
|
||||||
onProgress.run("posizioni");
|
onProgress.run("impostazioni");
|
||||||
loadAvailablePosizioni(() -> {
|
loadGestSetupValues(() -> {
|
||||||
|
|
||||||
onProgress.run("impostazioni");
|
onProgress.run("dati azienda");
|
||||||
loadGestSetupValues(tmpOnComplete, tmpOnFailed);
|
loadDatiAzienda(tmpOnComplete, tmpOnFailed);
|
||||||
}, tmpOnFailed);
|
|
||||||
}, tmpOnFailed);
|
}, tmpOnFailed);
|
||||||
}, tmpOnFailed);
|
}, tmpOnFailed);
|
||||||
}, tmpOnFailed);
|
}, tmpOnFailed);
|
||||||
@@ -113,7 +113,27 @@ public class SettingsManager {
|
|||||||
SystemRESTConsumer.getAzienda(datiAzienda -> {
|
SystemRESTConsumer.getAzienda(datiAzienda -> {
|
||||||
SettingsManager.iDB().setDatiAzienda(datiAzienda);
|
SettingsManager.iDB().setDatiAzienda(datiAzienda);
|
||||||
|
|
||||||
if (onComplete != null) onComplete.run();
|
if (!SettingsManager.iDB().isFlagUseCodAnagAziendale()) {
|
||||||
|
onComplete.run();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String internalCodAnagsQuery = "SELECT ga.cod_anag,\n" +
|
||||||
|
" CAST(CASE WHEN vc.cod_anag IS NOT NULL THEN 1 ELSE 0 END AS BIT) AS is_cliente,\n" +
|
||||||
|
" CAST(CASE WHEN af.cod_anag IS NOT NULL THEN 1 ELSE 0 END AS BIT) AS is_fornitore\n" +
|
||||||
|
"FROM azienda\n" +
|
||||||
|
"INNER JOIN gtb_anag ga on azienda.part_iva = ga.part_iva\n" +
|
||||||
|
"LEFT OUTER JOIN vtb_clie vc on ga.cod_anag = vc.cod_anag AND vc.flag_stato = 'A'\n" +
|
||||||
|
"LEFT OUTER JOIN atb_forn af on ga.cod_anag = af.cod_anag AND af.flag_stato = 'A'";
|
||||||
|
|
||||||
|
Type type = new TypeToken<List<InternalCodAnagsDTO>>() {
|
||||||
|
}.getType();
|
||||||
|
SystemRESTConsumer.<List<InternalCodAnagsDTO>>processSqlStatic(internalCodAnagsQuery, type, internalCodAnagsList -> {
|
||||||
|
SettingsManager.iDB().setInternalCodAnags(internalCodAnagsList);
|
||||||
|
|
||||||
|
if (onComplete != null) onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
|
||||||
}, onFailed);
|
}, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,7 +213,7 @@ public class SettingsManager {
|
|||||||
stbGestSetupList.add(new StbGestSetup()
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("SETUP")
|
.setSection("SETUP")
|
||||||
.setKeySection("COD_ANAG_DEFAULT"));
|
.setKeySection("FLAG_USE_COD_ANAG_AZIENDALE"));
|
||||||
stbGestSetupList.add(new StbGestSetup()
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("SETUP")
|
.setSection("SETUP")
|
||||||
@@ -238,10 +258,6 @@ public class SettingsManager {
|
|||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("PRODUZIONE")
|
.setSection("PRODUZIONE")
|
||||||
.setKeySection("FLAG_VERSAMENTO_DIRETTO"));
|
.setKeySection("FLAG_VERSAMENTO_DIRETTO"));
|
||||||
stbGestSetupList.add(new StbGestSetup()
|
|
||||||
.setGestName("PICKING")
|
|
||||||
.setSection("PRODUZIONE")
|
|
||||||
.setKeySection("DEFAULT_COD_ANAG"));
|
|
||||||
stbGestSetupList.add(new StbGestSetup()
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("SPEDIZIONE")
|
.setSection("SPEDIZIONE")
|
||||||
@@ -274,6 +290,10 @@ public class SettingsManager {
|
|||||||
.setGestName("PVM")
|
.setGestName("PVM")
|
||||||
.setSection("ORDINI_A")
|
.setSection("ORDINI_A")
|
||||||
.setKeySection("ORDINA_NUOVI_ARTICOLI"));
|
.setKeySection("ORDINA_NUOVI_ARTICOLI"));
|
||||||
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
|
.setGestName("PVM")
|
||||||
|
.setSection("ORDINI_A")
|
||||||
|
.setKeySection("ORDINA_ARTICOLI_ON_SCAN"));
|
||||||
stbGestSetupList.add(new StbGestSetup()
|
stbGestSetupList.add(new StbGestSetup()
|
||||||
.setGestName("PVM")
|
.setGestName("PVM")
|
||||||
.setSection("DOC_INTERNI")
|
.setSection("DOC_INTERNI")
|
||||||
@@ -292,7 +312,7 @@ public class SettingsManager {
|
|||||||
dbSettingsModelIstance.setDefaultCausaleRettificaGiacenze(getValueFromList(list, "SETUP", "DEFAULT_CAUSALE_RETTIFICA_GIACENZE", String.class));
|
dbSettingsModelIstance.setDefaultCausaleRettificaGiacenze(getValueFromList(list, "SETUP", "DEFAULT_CAUSALE_RETTIFICA_GIACENZE", String.class));
|
||||||
dbSettingsModelIstance.setEnableCheckPartitaMagCheckPickingV(getValueFromList(list, "SETUP", "ENABLE_CHECK_PARTITA_MAG_PICKING_V", Boolean.class));
|
dbSettingsModelIstance.setEnableCheckPartitaMagCheckPickingV(getValueFromList(list, "SETUP", "ENABLE_CHECK_PARTITA_MAG_PICKING_V", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagMultiClienteOrdV(getValueFromList(list, "SETUP", "FLAG_MULTI_CLIENTE_ORD_VENDITA", Boolean.class));
|
dbSettingsModelIstance.setFlagMultiClienteOrdV(getValueFromList(list, "SETUP", "FLAG_MULTI_CLIENTE_ORD_VENDITA", Boolean.class));
|
||||||
dbSettingsModelIstance.setDefaultCodAnag(getValueFromList(list, "SETUP", "COD_ANAG_DEFAULT", String.class));
|
dbSettingsModelIstance.setFlagUseCodAnagAziendale(getValueFromList(list, "SETUP", "FLAG_USE_COD_ANAG_AZIENDALE", Boolean.class));
|
||||||
dbSettingsModelIstance.setDefaultCriterioDistribuzione(getValueFromList(list, "SETUP", "DEFAULT_CRITERIO_DISTRIBUZIONE", String.class));
|
dbSettingsModelIstance.setDefaultCriterioDistribuzione(getValueFromList(list, "SETUP", "DEFAULT_CRITERIO_DISTRIBUZIONE", String.class));
|
||||||
dbSettingsModelIstance.setFlagAskClienteInPickingLibero(getValueFromList(list, "PICKING_LIBERO", "FLAG_ASK_CLIENTE", Boolean.class));
|
dbSettingsModelIstance.setFlagAskClienteInPickingLibero(getValueFromList(list, "PICKING_LIBERO", "FLAG_ASK_CLIENTE", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagPickLiberoAllowEmptyCliente(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_CLIENTE", Boolean.class));
|
dbSettingsModelIstance.setFlagPickLiberoAllowEmptyCliente(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_CLIENTE", Boolean.class));
|
||||||
@@ -304,7 +324,6 @@ public class SettingsManager {
|
|||||||
dbSettingsModelIstance.setFlagAskPesoColloSpedizione(getValueFromList(list, "SETUP", "FLAG_ASK_PESO_COLLO", Boolean.class));
|
dbSettingsModelIstance.setFlagAskPesoColloSpedizione(getValueFromList(list, "SETUP", "FLAG_ASK_PESO_COLLO", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagUseNewPickingListSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_USE_NEW_PICKING_LIST", Boolean.class));
|
dbSettingsModelIstance.setFlagUseNewPickingListSpedizione(getValueFromList(list, "SPEDIZIONE", "FLAG_USE_NEW_PICKING_LIST", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagVersamentoDirettoProduzione(getValueFromList(list, "PRODUZIONE", "FLAG_VERSAMENTO_DIRETTO", Boolean.class));
|
dbSettingsModelIstance.setFlagVersamentoDirettoProduzione(getValueFromList(list, "PRODUZIONE", "FLAG_VERSAMENTO_DIRETTO", Boolean.class));
|
||||||
dbSettingsModelIstance.setProduzioneDefaultCodAnag(getValueFromList(list, "PRODUZIONE", "DEFAULT_COD_ANAG", String.class));
|
|
||||||
dbSettingsModelIstance.setFlagSpedizioneEnableManualPick(getValueFromList(list, "SPEDIZIONE", "ENABLE_MANUAL_PICK", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneEnableManualPick(getValueFromList(list, "SPEDIZIONE", "ENABLE_MANUAL_PICK", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagSpedizioneEnableFakeGiacenza(getValueFromList(list, "SPEDIZIONE", "ENABLE_FAKE_GIACENZA", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneEnableFakeGiacenza(getValueFromList(list, "SPEDIZIONE", "ENABLE_FAKE_GIACENZA", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagSpedizioneCanSelectMultipleOrders(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_SELECT_MULTIPLE_ORDERS", Boolean.class));
|
dbSettingsModelIstance.setFlagSpedizioneCanSelectMultipleOrders(getValueFromList(list, "SPEDIZIONE", "FLAG_CAN_SELECT_MULTIPLE_ORDERS", Boolean.class));
|
||||||
@@ -314,6 +333,7 @@ public class SettingsManager {
|
|||||||
dbSettingsModelIstance.setDocInterniCheckFornitore(getValueFromList(list, "DOC_INTERNI", "CHECK_FORNITORE", String.class));
|
dbSettingsModelIstance.setDocInterniCheckFornitore(getValueFromList(list, "DOC_INTERNI", "CHECK_FORNITORE", String.class));
|
||||||
dbSettingsModelIstance.setFlagAccettazioneUseQtaOrd(getValueFromList(list, "ACCETTAZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
dbSettingsModelIstance.setFlagAccettazioneUseQtaOrd(getValueFromList(list, "ACCETTAZIONE", "FLAG_USE_QTA_ORD", Boolean.class));
|
||||||
dbSettingsModelIstance.setFlagPickLiberoAllowEmptyDest(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_DEST", Boolean.class));
|
dbSettingsModelIstance.setFlagPickLiberoAllowEmptyDest(getValueFromList(list, "PICKING_LIBERO", "FLAG_ALLOW_EMPTY_DEST", Boolean.class));
|
||||||
|
dbSettingsModelIstance.setFlagOrdinaArticoliOnScan(getValueFromList(list, "ORDINI_A", "ORDINA_ARTICOLI_ON_SCAN", Boolean.class));
|
||||||
|
|
||||||
String notePerdita = getValueFromList(list, "DOC_INTERNI", "NOTE_PERDITA", String.class);
|
String notePerdita = getValueFromList(list, "DOC_INTERNI", "NOTE_PERDITA", String.class);
|
||||||
if (notePerdita != null) {
|
if (notePerdita != null) {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.core.utility;
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
@@ -13,10 +12,5 @@ public class UtilityProgress {
|
|||||||
return progress;
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,14 +5,16 @@ import java.net.InetSocketAddress;
|
|||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.net.SocketAddress;
|
import java.net.SocketAddress;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.exception.NotValidLicenseException;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.gest.login.exception.ServerNotReachableException;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
|
||||||
public class UtilityServer {
|
public class UtilityServer {
|
||||||
|
|
||||||
public static void isHostReachable(final String serverAddress, final int serverTCPport, final RunnableArgs<Boolean> callback){
|
public static void isHostReachable(final String serverAddress, final int serverTCPport, final RunnableArgs<Boolean> callback) {
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
|
|
||||||
boolean connected = false;
|
boolean connected = false;
|
||||||
@@ -36,7 +38,7 @@ public class UtilityServer {
|
|||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void isEmsApiAvailable(final String serverAddress, final int serverTCPport, final RunnableArgs<Boolean> callback) {
|
public static void isEmsApiAvailable(final String serverAddress, final int serverTCPport, final Runnable onComplete, final RunnableArgs<Exception> onFailed) {
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
OkHttpClient client = new OkHttpClient();
|
OkHttpClient client = new OkHttpClient();
|
||||||
|
|
||||||
@@ -46,11 +48,16 @@ public class UtilityServer {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Response response = client.newCall(request).execute();
|
Response response = client.newCall(request).execute();
|
||||||
boolean status = response.isSuccessful();
|
|
||||||
response.close();
|
response.close();
|
||||||
callback.run(status);
|
|
||||||
|
if (response.code() == 200) onComplete.run();
|
||||||
|
else if (response.code() == 404)
|
||||||
|
onFailed.run(new ServerNotReachableException(serverAddress, serverTCPport, null));
|
||||||
|
else if (response.code() == 550)
|
||||||
|
onFailed.run(new NotValidLicenseException());
|
||||||
|
else onFailed.run(new Exception("Errore non identificato (STATUS: " + response.code() + ")"));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
callback.run(false);
|
onFailed.run(new ServerNotReachableException(serverAddress, serverTCPport, e));
|
||||||
}
|
}
|
||||||
|
|
||||||
}).start();
|
}).start();
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.widget.AppCompatTextView;
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
import androidx.databinding.ObservableArrayList;
|
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());
|
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
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
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);
|
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_main_accettazione, container, false);
|
||||||
|
|
||||||
MainApplication.appComponent
|
MainApplication.appComponent
|
||||||
|
|||||||
@@ -688,13 +688,10 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -705,11 +702,10 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
public void createNewLU() {
|
public void createNewLU() {
|
||||||
this.mBindings.accettazioneOrdineInevasoFab.close(true);
|
this.mBindings.accettazioneOrdineInevasoFab.close(true);
|
||||||
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.createNewLU(null, null, false, () -> {
|
this.mViewModel.createNewLU(null, null, false, () -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -756,7 +752,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
DialogSimpleMessageView.makeErrorDialog(
|
DialogSimpleMessageView.makeErrorDialog(
|
||||||
new SpannableString(ex.getMessage()),
|
new SpannableString(ex.getMessage()),
|
||||||
null,
|
null,
|
||||||
@@ -766,16 +762,6 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMtbColrEdit(MtbColr mtbColr) {
|
public void onMtbColrEdit(MtbColr mtbColr) {
|
||||||
this.mViewModel.dispatchRowEdit(mtbColr);
|
this.mViewModel.dispatchRowEdit(mtbColr);
|
||||||
@@ -808,7 +794,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
if (ex instanceof InvalidPesoKGException) {
|
if (ex instanceof InvalidPesoKGException) {
|
||||||
UtilityToast.showToast(ex.getMessage());
|
UtilityToast.showToast(ex.getMessage());
|
||||||
|
|||||||
@@ -373,8 +373,7 @@ public class AccettazionePickingViewModel {
|
|||||||
|
|
||||||
MtbColt mtbColt = new MtbColt();
|
MtbColt mtbColt = new MtbColt();
|
||||||
mtbColt
|
mtbColt
|
||||||
.initDefaultFields()
|
.initDefaultFields(defaultGestioneOfUL)
|
||||||
.setGestione(defaultGestioneOfUL)
|
|
||||||
.setAnnotazioni(additionalNotes)
|
.setAnnotazioni(additionalNotes)
|
||||||
.setPosizione(defaultPosAccettazione)
|
.setPosizione(defaultPosAccettazione)
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import it.integry.integrywmsnative.core.utility.UtilityServer;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.gest.login.exception.InvalidServerCodAziendaException;
|
import it.integry.integrywmsnative.gest.login.exception.InvalidServerCodAziendaException;
|
||||||
import it.integry.integrywmsnative.gest.login.exception.InvalidUserDepositException;
|
import it.integry.integrywmsnative.gest.login.exception.InvalidUserDepositException;
|
||||||
import it.integry.integrywmsnative.gest.login.exception.ServerNotReachableException;
|
|
||||||
import it.integry.integrywmsnative.gest.login.rest.LoginRESTConsumer;
|
import it.integry.integrywmsnative.gest.login.rest.LoginRESTConsumer;
|
||||||
|
|
||||||
public class LoginViewModel {
|
public class LoginViewModel {
|
||||||
@@ -52,13 +51,10 @@ public class LoginViewModel {
|
|||||||
final String host = u.getHost();
|
final String host = u.getHost();
|
||||||
final int port = u.getPort();
|
final int port = u.getPort();
|
||||||
|
|
||||||
UtilityServer.isEmsApiAvailable(host, port, value1 -> {
|
UtilityServer.isEmsApiAvailable(host, port, () -> {
|
||||||
|
|
||||||
if (value1) { //Is online
|
|
||||||
mLoginRESTConsumer.authenticate(host, port, username, password, loginDTO -> {
|
mLoginRESTConsumer.authenticate(host, port, username, password, loginDTO -> {
|
||||||
|
|
||||||
SettingsManager.iDB().setAvailableProfiles(loginDTO.getAvailableProfiles());
|
|
||||||
|
|
||||||
SettingsManager.i().createUserSession();
|
SettingsManager.i().createUserSession();
|
||||||
SettingsManager.i().getUser().setFullname(!UtilityString.isNullOrEmpty(loginDTO.getFull_name()) ? loginDTO.getFull_name() : username);
|
SettingsManager.i().getUser().setFullname(!UtilityString.isNullOrEmpty(loginDTO.getFull_name()) ? loginDTO.getFull_name() : username);
|
||||||
|
|
||||||
@@ -73,11 +69,7 @@ public class LoginViewModel {
|
|||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
|
|
||||||
|
|
||||||
} else { //Is not online
|
}, this::sendError);
|
||||||
this.sendError(new ServerNotReachableException(host, port, null));
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
this.sendError(new InvalidServerCodAziendaException(codAzienda, ex));
|
this.sendError(new InvalidServerCodAziendaException(codAzienda, ex));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -687,21 +687,14 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
private void refreshList(List<OrdiniUscitaElencoDTO> filteredList) {
|
private void refreshList(List<OrdiniUscitaElencoDTO> filteredList) {
|
||||||
|
|
||||||
// new Thread(() -> {
|
|
||||||
|
|
||||||
// requireActivity().runOnUiThread(() -> {
|
|
||||||
// this.onLoadingStarted();
|
|
||||||
List<OrdiniUscitaElencoDTO> tmpList;
|
List<OrdiniUscitaElencoDTO> tmpList;
|
||||||
|
|
||||||
if (filteredList != null) {
|
if (filteredList != null) {
|
||||||
@@ -720,12 +713,6 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
|
|
||||||
fabVisible.set(Stream.of(mOrdiniInevasiMutableData)
|
fabVisible.set(Stream.of(mOrdiniInevasiMutableData)
|
||||||
.anyMatch(y -> y.getSelectedObservable().get()));
|
.anyMatch(y -> y.getSelectedObservable().get()));
|
||||||
|
|
||||||
// this.onLoadingEnded();
|
|
||||||
// });
|
|
||||||
|
|
||||||
// }).start();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<OrdiniUscitaElencoListModel> convertDataModelToListModel(List<OrdiniUscitaElencoDTO> dataList) {
|
private List<OrdiniUscitaElencoListModel> convertDataModelToListModel(List<OrdiniUscitaElencoDTO> dataList) {
|
||||||
|
|||||||
@@ -266,13 +266,13 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
null,
|
null,
|
||||||
() -> onComplete.run(true),
|
() -> onComplete.run(true),
|
||||||
() -> onComplete.run(false)
|
() -> onComplete.run(false)
|
||||||
).show(getActivity().getSupportFragmentManager(), "tag");
|
).show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
getActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
if (ex instanceof InvalidPesoKGException) {
|
if (ex instanceof InvalidPesoKGException) {
|
||||||
UtilityToast.showToast(ex.getMessage());
|
UtilityToast.showToast(ex.getMessage());
|
||||||
@@ -287,7 +287,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
@Override
|
@Override
|
||||||
public void onLUClienteRequired(RunnableArgss<VtbDest, String> onComplete, Runnable onAbort) {
|
public void onLUClienteRequired(RunnableArgss<VtbDest, String> onComplete, Runnable onAbort) {
|
||||||
DialogAskClienteView.newInstance(onComplete, onAbort)
|
DialogAskClienteView.newInstance(onComplete, onAbort)
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -346,10 +346,10 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
.setPartitaMag(resultDTO.getPartitaMag())
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
.setDataScad(resultDTO.getDataScad());
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
})
|
})
|
||||||
.setOnAbort(this::closeProgress)
|
.setOnAbort(this::onLoadingEnded)
|
||||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -244,10 +244,9 @@ public class PickingLiberoViewModel {
|
|||||||
this.sendOnLoadingStarted();
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
MtbColt mtbColt = new MtbColt();
|
MtbColt mtbColt = new MtbColt();
|
||||||
mtbColt.initDefaultFields();
|
mtbColt.initDefaultFields(mDefaultGestione)
|
||||||
mtbColt.setGestione(mDefaultGestione)
|
|
||||||
.setRifOrd(mDefaultGestione == GestioneEnum.LAVORAZIONE ? "PICKING LIBERO" : null)
|
.setRifOrd(mDefaultGestione == GestioneEnum.LAVORAZIONE ? "PICKING LIBERO" : null)
|
||||||
.setCodAnag(SettingsManager.iDB().getProduzioneDefaultCodAnag())
|
// .setCodAnag(SettingsManager.iDB().getProduzioneDefaultCodAnag())
|
||||||
.setSegno(-1)
|
.setSegno(-1)
|
||||||
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||||
|
|
||||||
|
|||||||
@@ -239,24 +239,20 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
return pickingResiListModels;
|
return pickingResiListModels;
|
||||||
}
|
}
|
||||||
|
|
||||||
private RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewmodel.processBarcodeDTO(data, () -> {
|
this.mViewmodel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
public void createNewLU() {
|
public void createNewLU() {
|
||||||
this.mBindings.mainFab.close(true);
|
this.mBindings.mainFab.close(true);
|
||||||
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewmodel.createNewLU(null, null, () -> {
|
this.mViewmodel.createNewLU(null, null, () -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,7 +282,7 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
if (ex instanceof InvalidPesoKGException) {
|
if (ex instanceof InvalidPesoKGException) {
|
||||||
UtilityToast.showToast(ex.getMessage());
|
UtilityToast.showToast(ex.getMessage());
|
||||||
@@ -332,7 +328,7 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
.setPartitaMag(resultDTO.getPartitaMag())
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
.setDataScad(resultDTO.getDataScad());
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
})
|
})
|
||||||
.setOnAbort(() -> {
|
.setOnAbort(() -> {
|
||||||
@@ -400,7 +396,7 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
DialogSimpleMessageView.makeErrorDialog(
|
DialogSimpleMessageView.makeErrorDialog(
|
||||||
new SpannableString(ex.getMessage()),
|
new SpannableString(ex.getMessage()),
|
||||||
null,
|
null,
|
||||||
@@ -409,14 +405,4 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
onComplete)
|
onComplete)
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import it.integry.integrywmsnative.core.model.MtbColr;
|
|||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.model.MtbTCol;
|
import it.integry.integrywmsnative.core.model.MtbTCol;
|
||||||
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||||
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
@@ -125,8 +126,7 @@ public class PickingResiViewModel {
|
|||||||
|
|
||||||
public void createNewLU(Integer customNumCollo, String customSerCollo, Runnable onComplete) {
|
public void createNewLU(Integer customNumCollo, String customSerCollo, Runnable onComplete) {
|
||||||
MtbColt mtbColt = new MtbColt();
|
MtbColt mtbColt = new MtbColt();
|
||||||
mtbColt.initDefaultFields();
|
mtbColt.initDefaultFields(GestioneEnum.fromString(mDefaultGestioneOfLU))
|
||||||
mtbColt.setGestione(mDefaultGestioneOfLU)
|
|
||||||
.setSegno(mDefaultSegnoOfLU)
|
.setSegno(mDefaultSegnoOfLU)
|
||||||
.setCodAnag(mDefaultCodAnagOfLU)
|
.setCodAnag(mDefaultCodAnagOfLU)
|
||||||
.setCodMdep(mDefaultCodMdepOfLU)
|
.setCodMdep(mDefaultCodMdepOfLU)
|
||||||
|
|||||||
@@ -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.rest.model.SitArtOrdDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
import it.integry.integrywmsnative.databinding.FragmentProdFabbisognoLineeProdBinding;
|
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.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaView;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.ProdFabbisognoLineeProdDTO;
|
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());
|
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) {
|
private void startPickingActivity(List<ProdFabbisognoLineeProdDTO> fabbisognoList) {
|
||||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||||
|
|
||||||
|
|||||||
@@ -22,14 +22,12 @@ import javax.inject.Inject;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.MainApplication;
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.R;
|
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.BaseDialogFragment;
|
||||||
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgsss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgsss;
|
||||||
import it.integry.integrywmsnative.core.model.JtbFasi;
|
import it.integry.integrywmsnative.core.model.JtbFasi;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
import it.integry.integrywmsnative.databinding.DialogAskMagazzinoProssimitaBinding;
|
import it.integry.integrywmsnative.databinding.DialogAskMagazzinoProssimitaBinding;
|
||||||
|
|
||||||
public class DialogAskMagazzinoProssimitaView extends BaseDialogFragment implements DialogAskMagazzinoProssimitaViewModel.Listener {
|
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 -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data);
|
this.mViewModel.processBarcodeDTO(data);
|
||||||
};
|
};
|
||||||
@@ -228,7 +226,7 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
DialogSimpleMessageView.makeErrorDialog(
|
DialogSimpleMessageView.makeErrorDialog(
|
||||||
new SpannableString(ex.getMessage()),
|
new SpannableString(ex.getMessage()),
|
||||||
null,
|
null,
|
||||||
|
|||||||
@@ -110,10 +110,10 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
private void initRecyclerView() {
|
private void initRecyclerView() {
|
||||||
mBindings.mainList.setNestedScrollingEnabled(false);
|
mBindings.mainList.setNestedScrollingEnabled(false);
|
||||||
mBindings.mainList.setHasFixedSize(true);
|
mBindings.mainList.setHasFixedSize(true);
|
||||||
mBindings.mainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
mBindings.mainList.setLayoutManager(new LinearLayoutManager(requireActivity()));
|
||||||
|
|
||||||
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(getActivity(), SimpleDividerItemDecoration.VERTICAL);
|
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(requireActivity(), SimpleDividerItemDecoration.VERTICAL);
|
||||||
itemDecorator.setDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.divider));
|
itemDecorator.setDrawable(ContextCompat.getDrawable(requireActivity(), R.drawable.divider));
|
||||||
mBindings.mainList.addItemDecoration(itemDecorator);
|
mBindings.mainList.addItemDecoration(itemDecorator);
|
||||||
|
|
||||||
mAdapter = new ProdRientroMerceOrderDetailMtbColtListAdapter(new ObservableArrayList<>());
|
mAdapter = new ProdRientroMerceOrderDetailMtbColtListAdapter(new ObservableArrayList<>());
|
||||||
@@ -167,7 +167,7 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
|
|
||||||
|
|
||||||
public void addULButtonClick() {
|
public void addULButtonClick() {
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
String codProd = this.currentOrder.getValue().getCodProd();
|
String codProd = this.currentOrder.getValue().getCodProd();
|
||||||
mArticoloRESTConsumer.getByCodMart(codProd, mtbAart -> {
|
mArticoloRESTConsumer.getByCodMart(codProd, mtbAart -> {
|
||||||
@@ -188,7 +188,7 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
|
|
||||||
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()
|
DialogInputLUProdDTO dialogInputLUProdDTO = new DialogInputLUProdDTO()
|
||||||
.setMtbAart(mtbAart)
|
.setMtbAart(mtbAart)
|
||||||
@@ -216,9 +216,9 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
|
|
||||||
this.mViewModel.createLU(pickedQuantityDTO);
|
this.mViewModel.createLU(pickedQuantityDTO);
|
||||||
}, () -> {
|
}, () -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
})
|
})
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
|
||||||
}, this::onError);
|
}, this::onError);
|
||||||
|
|
||||||
@@ -248,63 +248,63 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
if (currentOrder.getValue() != null) {
|
if (currentOrder.getValue() != null) {
|
||||||
switch (currentOrder.getValue().getStatoEnum()) {
|
switch (currentOrder.getValue().getStatoEnum()) {
|
||||||
case IN_CORSO:
|
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:
|
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:
|
case PROGRAMMATO:
|
||||||
default:
|
default:
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.ic_clock_circle_outline_24dp);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.ic_clock_circle_outline_24dp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.ic_clock_circle_outline_24dp);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.ic_clock_circle_outline_24dp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getOrderStatusIconTintColor() {
|
public Integer getOrderStatusIconTintColor() {
|
||||||
if (currentOrder.getValue() != null) {
|
if (currentOrder.getValue() != null) {
|
||||||
switch (currentOrder.getValue().getStatoEnum()) {
|
switch (currentOrder.getValue().getStatoEnum()) {
|
||||||
case IN_CORSO:
|
case IN_CORSO:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.green_800);
|
return ContextCompat.getColor(requireActivity(), R.color.green_800);
|
||||||
case PAUSA:
|
case PAUSA:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.yellow_800);
|
return ContextCompat.getColor(requireActivity(), R.color.yellow_800);
|
||||||
case PROGRAMMATO:
|
case PROGRAMMATO:
|
||||||
default:
|
default:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.blue_800);
|
return ContextCompat.getColor(requireActivity(), R.color.blue_800);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return ContextCompat.getColor(getActivity(), R.color.blue_800);
|
return ContextCompat.getColor(requireActivity(), R.color.blue_800);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Drawable getOrderStatusLabelBackgroud() {
|
public Drawable getOrderStatusLabelBackgroud() {
|
||||||
if (currentOrder.getValue() != null) {
|
if (currentOrder.getValue() != null) {
|
||||||
switch (currentOrder.getValue().getStatoEnum()) {
|
switch (currentOrder.getValue().getStatoEnum()) {
|
||||||
case IN_CORSO:
|
case IN_CORSO:
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.label_success_text);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.label_success_text);
|
||||||
case PAUSA:
|
case PAUSA:
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.label_warning_text);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.label_warning_text);
|
||||||
case PROGRAMMATO:
|
case PROGRAMMATO:
|
||||||
default:
|
default:
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.label_primary_text);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.label_primary_text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.label_primary_text);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.label_primary_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getOrderStatusLabelTextColor() {
|
public Integer getOrderStatusLabelTextColor() {
|
||||||
if (currentOrder.getValue() != null) {
|
if (currentOrder.getValue() != null) {
|
||||||
switch (currentOrder.getValue().getStatoEnum()) {
|
switch (currentOrder.getValue().getStatoEnum()) {
|
||||||
case IN_CORSO:
|
case IN_CORSO:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.green_800);
|
return ContextCompat.getColor(requireActivity(), R.color.green_800);
|
||||||
case PAUSA:
|
case PAUSA:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.yellow_800);
|
return ContextCompat.getColor(requireActivity(), R.color.yellow_800);
|
||||||
case PROGRAMMATO:
|
case PROGRAMMATO:
|
||||||
default:
|
default:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.blue_800);
|
return ContextCompat.getColor(requireActivity(), R.color.blue_800);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return ContextCompat.getColor(getActivity(), R.color.blue_800);
|
return ContextCompat.getColor(requireActivity(), R.color.blue_800);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -334,7 +334,7 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
|
|||||||
@Override
|
@Override
|
||||||
public void onWarning(String warningText, Runnable action) {
|
public void onWarning(String warningText, Runnable action) {
|
||||||
this.requireActivity().runOnUiThread(() -> {
|
this.requireActivity().runOnUiThread(() -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
DialogSimpleMessageView
|
DialogSimpleMessageView
|
||||||
.makeWarningDialog(new SpannableString(Html.fromHtml(warningText)), null, action)
|
.makeWarningDialog(new SpannableString(Html.fromHtml(warningText)), null, action)
|
||||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
|||||||
@@ -13,11 +13,8 @@ import androidx.databinding.DataBindingUtil;
|
|||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
|
||||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
import com.ravikoradiya.liveadapter.Type;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@@ -35,6 +32,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.databinding.ActivityPvOrdineAcquistoEditBinding;
|
import it.integry.integrywmsnative.databinding.ActivityPvOrdineAcquistoEditBinding;
|
||||||
|
import it.integry.integrywmsnative.databinding.FragmentPvArticoliOrdineAcquistoListSingleItemBinding;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.DialogEditArticoloView;
|
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.dialog.DialogEditArticoloView;
|
||||||
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.ui.OrdineAcquistoArtListModel;
|
import it.integry.integrywmsnative.gest.pv_ordine_acquisto_edit.ui.OrdineAcquistoArtListModel;
|
||||||
import it.integry.integrywmsnative.ui.FabMenuCustomAnimations;
|
import it.integry.integrywmsnative.ui.FabMenuCustomAnimations;
|
||||||
@@ -134,20 +132,17 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity implements PVOrdi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initRecyclerView() {
|
private void initRecyclerView() {
|
||||||
// this.mViewModel.getArticoli().observe(this, updatedData -> {
|
|
||||||
// this.mArticoliMutableData.clear();
|
|
||||||
// this.mArticoliMutableData.addAll(convertDataModelToListModel(updatedData));
|
|
||||||
//// this.noItemsToPick.set(!isThereAnyItemToPick(updatedData));
|
|
||||||
// });
|
|
||||||
|
|
||||||
// var mAdapter = new OrdineAcquistoArtListAdapter(this, mArticoliMutableData)
|
var itemType = new Type<ArticoloOrdine, FragmentPvArticoliOrdineAcquistoListSingleItemBinding>(R.layout.fragment_pv_articoli_ordine_acquisto__list_single_item, BR.articolo);
|
||||||
// .setOnItemClicked(this::selectAction);
|
itemType.onClick(x -> {
|
||||||
|
this.selectAction(x.getBinding().getArticolo());
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
var liveAdapter = new LiveAdapter(this.mViewModel.getArticoli(), this, BR.articolo)
|
new LiveAdapter(this.mViewModel.getArticoli(), this)
|
||||||
.map(ArticoloOrdine.class, R.layout.fragment_pv_articoli_ordine_acquisto__list_single_item)
|
.map(ArticoloOrdine.class, itemType)
|
||||||
.into(mBinding.articoliOrdineList);
|
.into(mBinding.articoliOrdineList);
|
||||||
|
|
||||||
// mBinding.articoliOrdineList.setAdapter(mAdapter);
|
|
||||||
mBinding.articoliOrdineList.setHasFixedSize(true);
|
mBinding.articoliOrdineList.setHasFixedSize(true);
|
||||||
mBinding.articoliOrdineList.setLayoutManager(new LinearLayoutManager(this));
|
mBinding.articoliOrdineList.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|
||||||
@@ -156,20 +151,6 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity implements PVOrdi
|
|||||||
mBinding.articoliOrdineList.addItemDecoration(itemDecorator);
|
mBinding.articoliOrdineList.addItemDecoration(itemDecorator);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<OrdineAcquistoArtListModel> convertDataModelToListModel
|
|
||||||
(List<ArticoloOrdine> dataList) {
|
|
||||||
return Stream.of(dataList)
|
|
||||||
.distinctBy(ArticoloOrdine::getArticoloOrdineId)
|
|
||||||
.sortBy(x -> x.getDataIns().getTime())
|
|
||||||
.map(x -> new OrdineAcquistoArtListModel()
|
|
||||||
.setBadge1(x.getCodMart())
|
|
||||||
.setDescription(x.getDescrizione())
|
|
||||||
.setQuantity(BigDecimal.valueOf(x.getQtaOrd()))
|
|
||||||
.setUntMis(x.getUntMis())
|
|
||||||
.setOriginalModel(x))
|
|
||||||
.toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void selectAction(ArticoloOrdine articoloOrdine) {
|
private void selectAction(ArticoloOrdine articoloOrdine) {
|
||||||
mBinding.closeActivityFab.close(false);
|
mBinding.closeActivityFab.close(false);
|
||||||
@@ -179,7 +160,12 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity implements PVOrdi
|
|||||||
articoloOrdine.getDescrizione(),
|
articoloOrdine.getDescrizione(),
|
||||||
articoloOrdine.getQtaOrd() + " " + articoloOrdine.getUntMis(),
|
articoloOrdine.getQtaOrd() + " " + articoloOrdine.getUntMis(),
|
||||||
() -> {
|
() -> {
|
||||||
this.onItemDispatched(articoloOrdine);
|
this.mViewModel.checkArticolo(mOrdine, articoloOrdine.getCodMart(),
|
||||||
|
artOrd -> {
|
||||||
|
this.onItemDispatched(artOrd);
|
||||||
|
BarcodeManager.enable();
|
||||||
|
},
|
||||||
|
this::onError);
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
},
|
},
|
||||||
() -> {
|
() -> {
|
||||||
@@ -204,9 +190,7 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity implements PVOrdi
|
|||||||
mBinding.closeActivityFab.close(false);
|
mBinding.closeActivityFab.close(false);
|
||||||
this.onLoadingStarted();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
this.mViewModel.processBarcodeDTO(data, this::onLoadingEnded);
|
||||||
this.onLoadingEnded();
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -227,6 +211,11 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity implements PVOrdi
|
|||||||
}).show(this.getSupportFragmentManager(), "tag");
|
}).show(this.getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getColorFromResource(int resId) {
|
||||||
|
return getResources().getColor(resId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void exportOrdine() {
|
public void exportOrdine() {
|
||||||
this.mViewModel.exportOrdine(() -> {
|
this.mViewModel.exportOrdine(() -> {
|
||||||
@@ -252,11 +241,13 @@ public class PVOrdineAcquistoEditActivity extends BaseActivity implements PVOrdi
|
|||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
DialogSimpleInputHelper.makeInputDialog(this, "Inserisci il codice a barre/codice articolo da cercare", codice -> {
|
DialogSimpleInputHelper.makeInputDialog(this, "Inserisci il codice a barre/codice articolo da cercare", codice -> {
|
||||||
this.onLoadingStarted();
|
this.onLoadingStarted();
|
||||||
this.mViewModel.loadArticolo(codice,
|
this.mViewModel.checkArticolo(mOrdine, codice,
|
||||||
() -> {
|
articoloOrdine -> {
|
||||||
|
this.onItemDispatched(articoloOrdine);
|
||||||
this.onLoadingEnded();
|
this.onLoadingEnded();
|
||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
}
|
},
|
||||||
|
this::onError
|
||||||
);
|
);
|
||||||
}, BarcodeManager::enable).show();
|
}, BarcodeManager::enable).show();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import androidx.lifecycle.MutableLiveData;
|
|||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -11,6 +12,7 @@ import java.util.Objects;
|
|||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloGriglia;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
import it.integry.integrywmsnative.core.data_store.db.entity.ArticoloOrdine;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
import it.integry.integrywmsnative.core.data_store.db.entity.Griglia;
|
||||||
@@ -22,6 +24,7 @@ import it.integry.integrywmsnative.core.data_store.db.repository.OrdineRepositor
|
|||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PVOrdiniAcquistoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.PVOrdiniAcquistoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
|
||||||
public class PVOrdineAcquistoEditViewModel {
|
public class PVOrdineAcquistoEditViewModel {
|
||||||
|
|
||||||
@@ -69,15 +72,29 @@ public class PVOrdineAcquistoEditViewModel {
|
|||||||
|
|
||||||
this.loadGriglia(ordine.getIdGriglia(), griglia -> {
|
this.loadGriglia(ordine.getIdGriglia(), griglia -> {
|
||||||
mCurrentGriglia.postValue(griglia);
|
mCurrentGriglia.postValue(griglia);
|
||||||
|
|
||||||
this.loadArticoli(mCurrentOrdine, articoli -> {
|
this.loadArticoli(mCurrentOrdine, articoli -> {
|
||||||
|
articoli = Stream.of(articoli).map(this::setBgTint).toList();
|
||||||
this.mArticoli.postValue(articoli);
|
this.mArticoli.postValue(articoli);
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ArticoloOrdine setBgTint(ArticoloOrdine art) {
|
||||||
|
int chk = art.checkQtaProposta();
|
||||||
|
switch (chk) {
|
||||||
|
case -1:
|
||||||
|
art.setBgTint(this.mListener.getColorFromResource(R.color.red_600));
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
art.setBgTint(this.mListener.getColorFromResource(R.color.orange_600));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
art.setBgTint(this.mListener.getColorFromResource(R.color.colorPrimary));
|
||||||
|
}
|
||||||
|
return art;
|
||||||
|
}
|
||||||
|
|
||||||
public MutableLiveData<Griglia> getCurrentGriglia() {
|
public MutableLiveData<Griglia> getCurrentGriglia() {
|
||||||
return mCurrentGriglia;
|
return mCurrentGriglia;
|
||||||
}
|
}
|
||||||
@@ -87,42 +104,20 @@ public class PVOrdineAcquistoEditViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void saveArticolo(ArticoloOrdine articolo) {
|
public void saveArticolo(ArticoloOrdine articolo) {
|
||||||
|
setBgTint(articolo);
|
||||||
var newList = this.mArticoli.getValue();
|
var newList = this.mArticoli.getValue();
|
||||||
|
|
||||||
var alreadySavedItem = Stream.of(newList)
|
var alreadySavedItem = Stream.of(newList)
|
||||||
.filter(x -> Objects.equals(x.getCodMart(), articolo.getCodMart()))
|
.filter(x -> Objects.equals(x.getCodMart(), articolo.getCodMart()))
|
||||||
.findFirst();
|
.findFirst();
|
||||||
|
|
||||||
if(alreadySavedItem.isPresent()) newList.remove(alreadySavedItem.get());
|
if (alreadySavedItem.isPresent()) newList.remove(alreadySavedItem.get());
|
||||||
|
|
||||||
newList.add(articolo);
|
newList.add(articolo);
|
||||||
this.mArticoli.postValue(newList);
|
this.mArticoli.postValue(newList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void loadArticolo(String barcode, Runnable onSuccess) {
|
|
||||||
try {
|
|
||||||
mArticoliOrdineRepository.findArticoloByScanAndOrdine(mCurrentOrdine, barcode, (articolo) -> {
|
|
||||||
if (articolo != null) {
|
|
||||||
onSuccess.run();
|
|
||||||
this.sendOnItemDispatched(articolo);
|
|
||||||
} else {
|
|
||||||
mArticoloGrigliaRepository.findArticoloByScanAndGriglia(barcode, mCurrentOrdine.getIdGriglia(), artGrid -> {
|
|
||||||
if (artGrid != null) {
|
|
||||||
onSuccess.run();
|
|
||||||
this.sendOnItemDispatched(artGrid.convertToArticoloOrdine(mCurrentOrdine));
|
|
||||||
} else {
|
|
||||||
this.sendError(new Exception("L' articolo ( " + barcode + " ) non è presente nella griglia"));
|
|
||||||
}
|
|
||||||
}, this::sendError);
|
|
||||||
}
|
|
||||||
}, this::sendError);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
this.sendError(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||||
this.checkArticolo(
|
this.checkArticolo(
|
||||||
mCurrentOrdine,
|
mCurrentOrdine,
|
||||||
@@ -152,27 +147,54 @@ public class PVOrdineAcquistoEditViewModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkArticolo(Ordine ordine, String barcode, RunnableArgs<ArticoloOrdine> onSuccess, RunnableArgs<Exception> onFail) {
|
public void checkArticolo(Ordine ordine, String barcode, RunnableArgs<ArticoloOrdine> onSuccess, RunnableArgs<Exception> onFail) {
|
||||||
try {
|
try {
|
||||||
mArticoliOrdineRepository.findArticoloByScanAndOrdine(ordine, barcode, (articolo) -> {
|
mArticoloGrigliaRepository.findArticoloByScanAndGriglia(barcode, ordine.getIdGriglia(), artGrid -> {
|
||||||
if (articolo != null) {
|
if (artGrid != null) {
|
||||||
onSuccess.run(articolo);
|
mArticoliOrdineRepository.findArticoloByScanAndOrdine(ordine, barcode, (articolo) -> {
|
||||||
} else {
|
if (articolo != null) {
|
||||||
mArticoloGrigliaRepository.findArticoloByScanAndGriglia(barcode, ordine.getIdGriglia(), artGrid -> {
|
articolo
|
||||||
if (artGrid != null) {
|
.setQtaPrevistaVendita(BigDecimal.valueOf(artGrid.getQtaPrevistaVendita()))
|
||||||
onSuccess.run(artGrid.convertToArticoloOrdine(ordine));
|
.setQtaProposta(BigDecimal.valueOf(artGrid.getQtaProposta()))
|
||||||
|
.setGiacenza(BigDecimal.valueOf(artGrid.getGiacenza()))
|
||||||
|
.setMediaSett(artGrid.getMediaSett());
|
||||||
|
|
||||||
|
articolo.setQtaMinOrdinabile(artGrid.getQtaMinOrdinabile());
|
||||||
|
articolo.setMerceDaRic(artGrid.getMerceDaRic());
|
||||||
|
articolo.setNewNoPromo(artGrid.isNewNoPromo());
|
||||||
|
articolo.setFlagQtaMultipla(artGrid.getFlagQtaMultipla());
|
||||||
|
|
||||||
|
onSuccess.run(articolo);
|
||||||
} else {
|
} else {
|
||||||
onFail.run(new Exception("L' articolo ( " + barcode + " ) non è presente nella griglia"));
|
ArticoloOrdine art = artGrid.convertToArticoloOrdine(ordine);
|
||||||
|
if (isAutoOrderOnScan()) {
|
||||||
|
art.setQtaOrd(art.getQtaCnf());
|
||||||
|
mArticoliOrdineRepository.saveArticoloToOrdine(art, () -> {
|
||||||
|
saveArticolo(art);
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
|
||||||
|
}, this::sendError);
|
||||||
|
} else {
|
||||||
|
onSuccess.run(art);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, onFail);
|
}, onFail);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
onFail.run(new Exception("L' articolo ( " + barcode + " ) non è presente nella griglia"));
|
||||||
}
|
}
|
||||||
}, onFail);
|
}, onFail);
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
onFail.run(e);
|
onFail.run(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isAutoOrderOnScan() {
|
||||||
|
return SettingsManager.iDB().getFlagOrdinaNuoviArticoliInGriglia();
|
||||||
|
}
|
||||||
|
|
||||||
private void getNewArticoli(int idGrigla, RunnableArgs<List<ArticoloGriglia>> onSuccess, RunnableArgs<Exception> onError) {
|
private void getNewArticoli(int idGrigla, RunnableArgs<List<ArticoloGriglia>> onSuccess, RunnableArgs<Exception> onError) {
|
||||||
mArticoloGrigliaRepository.findNewArticoliInGrigla(idGrigla, onSuccess, onError);
|
mArticoloGrigliaRepository.findNewArticoliInGrigla(idGrigla, onSuccess, onError);
|
||||||
}
|
}
|
||||||
@@ -252,6 +274,8 @@ public class PVOrdineAcquistoEditViewModel {
|
|||||||
public interface Listener extends ILoadingListener {
|
public interface Listener extends ILoadingListener {
|
||||||
void onItemDispatched(ArticoloOrdine articoloOrdine);
|
void onItemDispatched(ArticoloOrdine articoloOrdine);
|
||||||
|
|
||||||
|
int getColorFromResource(int resId);
|
||||||
|
|
||||||
void onError(Exception ex);
|
void onError(Exception ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class DialogEditArticoloViewModel {
|
|||||||
|
|
||||||
public void setQtaTot(BigDecimal newValue) {
|
public void setQtaTot(BigDecimal newValue) {
|
||||||
this.internalQtaTot = newValue;
|
this.internalQtaTot = newValue;
|
||||||
|
if (newValue == null) return;
|
||||||
this.internalNumCnf = UtilityBigDecimal.divide(newValue, internalQtaCnf)
|
this.internalNumCnf = UtilityBigDecimal.divide(newValue, internalQtaCnf)
|
||||||
.setScale(0, RoundingMode.CEILING);
|
.setScale(0, RoundingMode.CEILING);
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ public class DialogEditArticoloViewModel {
|
|||||||
|
|
||||||
|
|
||||||
public void save(RunnableArgs<ArticoloOrdine> onComplete) {
|
public void save(RunnableArgs<ArticoloOrdine> onComplete) {
|
||||||
if(UtilityBigDecimal.equalsOrLowerThan(this.internalQtaTot, BigDecimal.ZERO)) {
|
if (UtilityBigDecimal.equalsOrLowerThan(this.internalQtaTot, BigDecimal.ZERO)) {
|
||||||
this.mListener.onError(new Exception("La quantità ordinata deve essere maggiore di 0"));
|
this.mListener.onError(new Exception("La quantità ordinata deve essere maggiore di 0"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -214,13 +214,10 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -334,12 +331,12 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
() -> onComplete.run(true),
|
() -> onComplete.run(true),
|
||||||
() -> onComplete.run(false)
|
() -> onComplete.run(false)
|
||||||
)
|
)
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
if (ex instanceof InvalidPesoKGException) {
|
if (ex instanceof InvalidPesoKGException) {
|
||||||
UtilityToast.showToast(ex.getMessage());
|
UtilityToast.showToast(ex.getMessage());
|
||||||
@@ -391,11 +388,11 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
.setPartitaMag(resultDTO.getPartitaMag())
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
.setDataScad(resultDTO.getDataScad());
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
})
|
})
|
||||||
.setOnAbort(() -> {
|
.setOnAbort(() -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
})
|
})
|
||||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
boolean shouldAskPesoLU = SettingsManager.iDB().isFlagAskPesoColloSpedizione();
|
boolean shouldAskPesoLU = SettingsManager.iDB().isFlagAskPesoColloSpedizione();
|
||||||
boolean useQtaOrd = SettingsManager.iDB().isFlagSpedizioneUseQtaOrd();
|
boolean useQtaOrd = SettingsManager.iDB().isFlagSpedizioneUseQtaOrd();
|
||||||
|
|
||||||
if (!mEnableFakeGiacenza) this.openProgress();
|
if (!mEnableFakeGiacenza) this.onLoadingStarted();
|
||||||
mViewmodel.init(
|
mViewmodel.init(
|
||||||
codMdep,
|
codMdep,
|
||||||
!mEnableFakeGiacenza,
|
!mEnableFakeGiacenza,
|
||||||
@@ -622,13 +622,10 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewmodel.processBarcodeDTO(data, () -> {
|
this.mViewmodel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -660,10 +657,10 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
public void createNewUL() {
|
public void createNewUL() {
|
||||||
this.mBindings.spedizioneFab.close(true);
|
this.mBindings.spedizioneFab.close(true);
|
||||||
|
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.mViewmodel.createNewLU(null, null, () -> {
|
this.mViewmodel.createNewLU(null, null, () -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -683,16 +680,6 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
this.mViewmodel.closeOrder();
|
this.mViewmodel.closeOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUOpened(MtbColt mtbColt) {
|
public void onLUOpened(MtbColt mtbColt) {
|
||||||
this.addExtraItemsEnabled.set(SettingsManager.iDB().isFlagCanAddExtraItemSpedizione());
|
this.addExtraItemsEnabled.set(SettingsManager.iDB().isFlagCanAddExtraItemSpedizione());
|
||||||
@@ -737,7 +724,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
DialogSimpleMessageView.makeErrorDialog(
|
DialogSimpleMessageView.makeErrorDialog(
|
||||||
new SpannableString(ex.getMessage()),
|
new SpannableString(ex.getMessage()),
|
||||||
null,
|
null,
|
||||||
@@ -773,7 +760,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
if (ex instanceof InvalidPesoKGException) {
|
if (ex instanceof InvalidPesoKGException) {
|
||||||
UtilityToast.showToast(ex.getMessage());
|
UtilityToast.showToast(ex.getMessage());
|
||||||
@@ -834,7 +821,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
.setPartitaMag(resultDTO.getPartitaMag())
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
.setDataScad(resultDTO.getDataScad());
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
})
|
})
|
||||||
.setOnAbort(() -> {
|
.setOnAbort(() -> {
|
||||||
|
|||||||
@@ -1319,8 +1319,7 @@ public class SpedizioneViewModel {
|
|||||||
|
|
||||||
public void createNewLU(Integer customNumCollo, String customSerCollo, Runnable onComplete) {
|
public void createNewLU(Integer customNumCollo, String customSerCollo, Runnable onComplete) {
|
||||||
MtbColt mtbColt = new MtbColt();
|
MtbColt mtbColt = new MtbColt();
|
||||||
mtbColt.initDefaultFields();
|
mtbColt.initDefaultFields(mDefaultGestioneOfUL)
|
||||||
mtbColt.setGestione(mDefaultGestioneOfUL)
|
|
||||||
.setSegno(mDefaultSegnoCol)
|
.setSegno(mDefaultSegnoCol)
|
||||||
.setRifOrd(mDefaultRifOrdOfUL)
|
.setRifOrd(mDefaultRifOrdOfUL)
|
||||||
.setNumOrd(mDefaultNumOrdOfUL)
|
.setNumOrd(mDefaultNumOrdOfUL)
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ public class UltimeConsegneClienteFragment extends BaseFragment implements Ultim
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void refreshItems() {
|
private void refreshItems() {
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
String currentAnagFilter = mAppliedFilterViewModel != null ? mAppliedFilterViewModel.ragSoc.get() : null;
|
String currentAnagFilter = mAppliedFilterViewModel != null ? mAppliedFilterViewModel.ragSoc.get() : null;
|
||||||
String currentCodAnagFilter = null;
|
String currentCodAnagFilter = null;
|
||||||
@@ -247,22 +247,4 @@ public class UltimeConsegneClienteFragment extends BaseFragment implements Ultim
|
|||||||
this.mOnPreDestroyList.add(onPreDestroy);
|
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) {
|
private void filterItems(List<MtbAart> filteredMtbAarts) {
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
String currentAnagFilter = mAppliedFilterViewModel != null ? mAppliedFilterViewModel.ragSoc.get() : null;
|
String currentAnagFilter = mAppliedFilterViewModel != null ? mAppliedFilterViewModel.ragSoc.get() : null;
|
||||||
String currentCodAnagFilter = null;
|
String currentCodAnagFilter = null;
|
||||||
@@ -252,25 +252,6 @@ public class UltimiArriviFornitoreFragment extends BaseFragment implements ITitl
|
|||||||
this.mOnPreDestroyList.add(onPreDestroy);
|
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
|
@Override
|
||||||
public void onMtbColtScanned(MtbColt scannedMtbColt) {
|
public void onMtbColtScanned(MtbColt scannedMtbColt) {
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public class VersamentoMerceFragment extends BaseFragment implements ITitledFrag
|
|||||||
null, this::openLU)
|
null, this::openLU)
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.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 -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -54,20 +54,15 @@ public class VersamentoMerceViewModel {
|
|||||||
|
|
||||||
|
|
||||||
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||||
|
if (UtilityBarcode.isEtichettaPosizione(barcodeScanDTO, false)) {
|
||||||
new Thread(() -> {
|
this.executeEtichettaPosizione(barcodeScanDTO, onComplete);
|
||||||
if (UtilityBarcode.isEtichettaPosizione(barcodeScanDTO, false)) {
|
} else if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||||
this.executeEtichettaPosizione(barcodeScanDTO, onComplete);
|
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), true, onComplete);
|
||||||
} else if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||||
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), true, onComplete);
|
this.executeEtichettaEan128(barcodeScanDTO, onComplete);
|
||||||
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
} else {
|
||||||
this.executeEtichettaEan128(barcodeScanDTO, onComplete);
|
onComplete.run();
|
||||||
} else {
|
}
|
||||||
onComplete.run();
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -84,9 +79,8 @@ public class VersamentoMerceViewModel {
|
|||||||
} else if (mtbColtList.size() == 1) {
|
} else if (mtbColtList.size() == 1) {
|
||||||
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||||
|
|
||||||
onComplete.run();
|
|
||||||
//TAKE HERE
|
//TAKE HERE
|
||||||
pickMerceULtoUL(mtbColt);
|
pickMerceULtoUL(mtbColt, onComplete);
|
||||||
|
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
} else {
|
} else {
|
||||||
@@ -150,12 +144,11 @@ public class VersamentoMerceViewModel {
|
|||||||
if (mtbColt == null) {
|
if (mtbColt == null) {
|
||||||
this.mColliMagazzinoRESTConsumer.createColloFromEtichettaAnonima(sscc, GestioneEnum.LAVORAZIONE, mtbColtAnonimo -> {
|
this.mColliMagazzinoRESTConsumer.createColloFromEtichettaAnonima(sscc, GestioneEnum.LAVORAZIONE, mtbColtAnonimo -> {
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
pickMerceULtoUL(mtbColtAnonimo);
|
pickMerceULtoUL(mtbColtAnonimo, onComplete);
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
onComplete.run();
|
pickMerceULtoUL(mtbColt, onComplete);
|
||||||
pickMerceULtoUL(mtbColt);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,7 +157,8 @@ public class VersamentoMerceViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void pickMerceULtoUL(MtbColt destMtbColt) {
|
private void pickMerceULtoUL(MtbColt destMtbColt, Runnable onComplete) {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
MtbColt sourceMtbColt = mCurrentMtbColt.getValue();
|
MtbColt sourceMtbColt = mCurrentMtbColt.getValue();
|
||||||
|
|
||||||
if (!UtilityString.equalsIgnoreCase(sourceMtbColt.getCodMdep(), destMtbColt.getCodMdep())) {
|
if (!UtilityString.equalsIgnoreCase(sourceMtbColt.getCodMdep(), destMtbColt.getCodMdep())) {
|
||||||
@@ -181,21 +175,24 @@ public class VersamentoMerceViewModel {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
this.sendOnArtsChooseRequired(mtbColrsToPick, pickedAarts -> {
|
this.sendOnArtsChooseRequired(mtbColrsToPick, pickedAarts -> {
|
||||||
List<MtbColr> destNewMtbColr = new ArrayList<>();
|
List<MtbColr> destNewMtbColr = new ArrayList<>();
|
||||||
|
|
||||||
askQuantities(pickedAarts.iterator(), destNewMtbColr, () -> {
|
askQuantities(pickedAarts.iterator(), destNewMtbColr, () -> {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
MtbColt clonedSourceTestata = (MtbColt) sourceMtbColt.clone();
|
MtbColt clonedSourceTestata = (MtbColt) sourceMtbColt.clone();
|
||||||
clonedSourceTestata.setMtbColr(new ObservableArrayList<>());
|
clonedSourceTestata.setMtbColr(new ObservableArrayList<>());
|
||||||
clonedSourceTestata.getMtbColr().addAll(destNewMtbColr);
|
clonedSourceTestata.getMtbColr().addAll(destNewMtbColr);
|
||||||
|
|
||||||
this.sendOnLoadingStarted();
|
|
||||||
|
|
||||||
this.mColliMagazzinoRESTConsumer.spostaArtsTraUL(
|
this.mColliMagazzinoRESTConsumer.spostaArtsTraUL(
|
||||||
clonedSourceTestata,
|
clonedSourceTestata,
|
||||||
destMtbColt,
|
destMtbColt,
|
||||||
this::sendOnDataSaved,
|
() -> {
|
||||||
|
this.sendOnDataSaved();
|
||||||
|
onComplete.run();
|
||||||
|
},
|
||||||
this::sendError
|
this::sendError
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -37,11 +37,9 @@ import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
import it.integry.integrywmsnative.core.utility.UtilityDialog;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.databinding.DialogChooseArtsFromListaArtsLayoutBinding;
|
import it.integry.integrywmsnative.databinding.DialogChooseArtsFromListaArtsLayoutBinding;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
|
||||||
|
|
||||||
public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
||||||
|
|
||||||
@@ -62,7 +60,6 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
private final List<DialogChooseArtsFromListaArtsItemModel> mDataset;
|
private final List<DialogChooseArtsFromListaArtsItemModel> mDataset;
|
||||||
|
|
||||||
private int mBarcodeScannerIstanceID;
|
private int mBarcodeScannerIstanceID;
|
||||||
private DialogProgressView mCurrentProgress;
|
|
||||||
private MtbAart selectedArt;
|
private MtbAart selectedArt;
|
||||||
|
|
||||||
public static DialogChooseArtsFromListaArts newInstance(List<MtbColr> listaMtbColr, RunnableArgs<List<MtbColr>> onItemsChoosed, Runnable onAbort) {
|
public static DialogChooseArtsFromListaArts newInstance(List<MtbColr> listaMtbColr, RunnableArgs<List<MtbColr>> onItemsChoosed, Runnable onAbort) {
|
||||||
@@ -258,9 +255,7 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||||
BarcodeManager.disable();
|
onLoadingStarted();
|
||||||
|
|
||||||
openProgress();
|
|
||||||
|
|
||||||
|
|
||||||
if (UtilityBarcode.isEan13(data)) {
|
if (UtilityBarcode.isEan13(data)) {
|
||||||
@@ -268,8 +263,7 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
} else if (UtilityBarcode.isEtichetta128(data)) {
|
} else if (UtilityBarcode.isEtichetta128(data)) {
|
||||||
this.executeEtichettaEan128(data);
|
this.executeEtichettaEan128(data);
|
||||||
} else {
|
} else {
|
||||||
closeProgress();
|
onLoadingEnded();
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -293,8 +287,7 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
this.loadArticolo(barcodeProd, ean128Model);
|
this.loadArticolo(barcodeProd, ean128Model);
|
||||||
} else {
|
} else {
|
||||||
DialogCommon.showNoArtFoundDialog(context, () -> {
|
DialogCommon.showNoArtFoundDialog(context, () -> {
|
||||||
BarcodeManager.enable();
|
onLoadingEnded();
|
||||||
closeProgress();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -303,16 +296,11 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
} else {
|
} else {
|
||||||
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
|
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
|
||||||
DialogCommon.showNoArtFoundDialog(context, () -> {
|
DialogCommon.showNoArtFoundDialog(context, () -> {
|
||||||
BarcodeManager.enable();
|
onLoadingEnded();
|
||||||
closeProgress();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}, ex -> {
|
}, this::onError);
|
||||||
closeProgress();
|
|
||||||
UtilityExceptions.defaultException(context, ex);
|
|
||||||
BarcodeManager.enable();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -329,22 +317,16 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
|
|
||||||
this.searchArtInList(mtbAartList.get(0), ean128Model);
|
this.searchArtInList(mtbAartList.get(0), ean128Model);
|
||||||
|
|
||||||
BarcodeManager.enable();
|
onLoadingEnded();
|
||||||
closeProgress();
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
DialogCommon.showNoArtFoundDialog(context, () -> {
|
DialogCommon.showNoArtFoundDialog(context, () -> {
|
||||||
BarcodeManager.enable();
|
onLoadingEnded();
|
||||||
closeProgress();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}, ex -> {
|
}, this::onError);
|
||||||
closeProgress();
|
|
||||||
BarcodeManager.enable();
|
|
||||||
UtilityExceptions.defaultException(context, ex);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -385,20 +367,4 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
this.dismiss();
|
this.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void openProgress() {
|
|
||||||
requireActivity().runOnUiThread(() -> {
|
|
||||||
if (this.mCurrentProgress == null) {
|
|
||||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(getActivity());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void closeProgress() {
|
|
||||||
requireActivity().runOnUiThread(() -> {
|
|
||||||
if (mCurrentProgress != null) {
|
|
||||||
mCurrentProgress.dismiss();
|
|
||||||
mCurrentProgress = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,12 +175,10 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
BarcodeManager.enable();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -104,8 +104,7 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
|
|||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, (status, mtbAart, ean128Model, mtbColrList) -> {
|
this.mViewModel.processBarcodeDTO(data, (status, mtbAart, ean128Model, mtbColrList) -> {
|
||||||
|
|
||||||
@@ -130,8 +129,7 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
|
|
||||||
dismiss();
|
dismiss();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import android.view.ViewGroup;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
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.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
import it.integry.integrywmsnative.databinding.DialogScanOrCreateLuBinding;
|
import it.integry.integrywmsnative.databinding.DialogScanOrCreateLuBinding;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.basket_lu.DialogBasketLU;
|
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 -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -159,7 +155,7 @@ public class DialogScanOrCreateLUView extends BaseDialogFragment implements Dial
|
|||||||
}, () -> {
|
}, () -> {
|
||||||
onConfirm.run(false);
|
onConfirm.run(false);
|
||||||
})
|
})
|
||||||
.show(((AppCompatActivity) getActivity()).getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -169,21 +165,4 @@ public class DialogScanOrCreateLUView extends BaseDialogFragment implements Dial
|
|||||||
dismiss();
|
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -250,7 +250,7 @@
|
|||||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@{UtilityNumber.decimalToString(view.articolo.getCnfDaRic())}"
|
android:text="@{UtilityNumber.decimalToString(view.articolo.merceDaRic)}"
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
tools:text="1" />
|
tools:text="1" />
|
||||||
@@ -281,7 +281,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="0dp"
|
android:layout_marginStart="0dp"
|
||||||
android:text="@{UtilityNumber.decimalToString(view.articolo.merceDaRic)}"
|
android:text="@{UtilityNumber.decimalToString(view.articolo.getCnfDaRic())}"
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/badge_round_corner"
|
android:background="@drawable/badge_round_corner"
|
||||||
android:backgroundTint="@color/colorPrimary"
|
android:backgroundTint="@{articolo.bgTint}"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:paddingLeft="6dp"
|
android:paddingLeft="6dp"
|
||||||
android:paddingTop="2dp"
|
android:paddingTop="2dp"
|
||||||
@@ -104,6 +104,7 @@
|
|||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
tools:backgroundTint="@color/colorPrimary"
|
||||||
tools:text="280.45\nCONF" />
|
tools:text="280.45\nCONF" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
package it.integry.integrywmsnative;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example local unit test, which will execute on the development machine (host).
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
public class ExampleUnitTest {
|
|
||||||
@Test
|
|
||||||
public void addition_isCorrect() throws Exception {
|
|
||||||
assertEquals(4, 2 + 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
package it.integry.barcode_base_android_library;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import androidx.test.platform.app.InstrumentationRegistry;
|
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instrumented test, which will execute on an Android device.
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
|
||||||
public class ExampleInstrumentedTest {
|
|
||||||
@Test
|
|
||||||
public void useAppContext() {
|
|
||||||
// Context of the app under test.
|
|
||||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
|
||||||
|
|
||||||
assertEquals("it.integry.barcode_base_android_library.test", appContext.getPackageName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package it.integry.barcode_base_android_library;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example local unit test, which will execute on the development machine (host).
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
public class ExampleUnitTest {
|
|
||||||
@Test
|
|
||||||
public void addition_isCorrect() {
|
|
||||||
assertEquals(4, 2 + 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
package it.integry.honeywellscannerlibrary;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import androidx.test.InstrumentationRegistry;
|
|
||||||
import androidx.test.runner.AndroidJUnit4;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instrumented test, which will execute on an Android device.
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
|
||||||
public class ExampleInstrumentedTest {
|
|
||||||
@Test
|
|
||||||
public void useAppContext() {
|
|
||||||
// Context of the app under test.
|
|
||||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
|
||||||
|
|
||||||
assertEquals("it.integry.honeywellscannerlibrary.test", appContext.getPackageName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package it.integry.honeywellscannerlibrary;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example local unit test, which will execute on the development machine (host).
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
public class ExampleUnitTest {
|
|
||||||
@Test
|
|
||||||
public void addition_isCorrect() {
|
|
||||||
assertEquals(4, 2 + 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
package it.integry.keyobardemulatorscannerlibrary;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import androidx.test.platform.app.InstrumentationRegistry;
|
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instrumented test, which will execute on an Android device.
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
|
||||||
public class ExampleInstrumentedTest {
|
|
||||||
@Test
|
|
||||||
public void useAppContext() {
|
|
||||||
// Context of the app under test.
|
|
||||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
|
||||||
|
|
||||||
assertEquals("it.integry.keyobardemulatorscannerlibrary.test", appContext.getPackageName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package it.integry.keyobardemulatorscannerlibrary;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example local unit test, which will execute on the development machine (host).
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
public class ExampleUnitTest {
|
|
||||||
@Test
|
|
||||||
public void addition_isCorrect() {
|
|
||||||
assertEquals(4, 2 + 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
package it.integry.pointmobilescannerlibrary;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import androidx.test.InstrumentationRegistry;
|
|
||||||
import androidx.test.runner.AndroidJUnit4;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instrumented test, which will execute on an Android device.
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
|
||||||
public class ExampleInstrumentedTest {
|
|
||||||
@Test
|
|
||||||
public void useAppContext() {
|
|
||||||
// Context of the app under test.
|
|
||||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
|
||||||
|
|
||||||
assertEquals("it.integry.pointmobilescannerlibrary.test", appContext.getPackageName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package it.integry.pointmobilescannerlibrary;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example local unit test, which will execute on the development machine (host).
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
public class ExampleUnitTest {
|
|
||||||
@Test
|
|
||||||
public void addition_isCorrect() {
|
|
||||||
assertEquals(4, 2 + 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
package it.integry.zebrascannerlibrary;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import androidx.test.InstrumentationRegistry;
|
|
||||||
import androidx.test.runner.AndroidJUnit4;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instrumented test, which will execute on an Android device.
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
|
||||||
public class ExampleInstrumentedTest {
|
|
||||||
@Test
|
|
||||||
public void useAppContext() {
|
|
||||||
// Context of the app under test.
|
|
||||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
|
||||||
|
|
||||||
assertEquals("it.integry.zebrascannerlibrary.test", appContext.getPackageName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package it.integry.zebrascannerlibrary;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example local unit test, which will execute on the development machine (host).
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
public class ExampleUnitTest {
|
|
||||||
@Test
|
|
||||||
public void addition_isCorrect() {
|
|
||||||
assertEquals(4, 2 + 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user