Finish v1.33.11(382)
This commit is contained in:
commit
43df6fc9f5
@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 380
|
def appVersionCode = 382
|
||||||
def appVersionName = '1.33.09'
|
def appVersionName = '1.33.11'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import it.integry.integrywmsnative.core.data_store.db.dao.InventarioRowDao;
|
|||||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.dao.OrdineDao;
|
import it.integry.integrywmsnative.core.data_store.db.dao.OrdineDao;
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.dao.RawDao;
|
||||||
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;
|
||||||
@ -76,6 +77,8 @@ public abstract class AppDatabase extends RoomDatabase {
|
|||||||
return sInstance;
|
return sInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract RawDao rawDao();
|
||||||
|
|
||||||
public abstract ArticoloGrigliaDao articoloGrigliaDao();
|
public abstract ArticoloGrigliaDao articoloGrigliaDao();
|
||||||
|
|
||||||
public abstract GrigliaDao grigliaDao();
|
public abstract GrigliaDao grigliaDao();
|
||||||
@ -93,6 +96,7 @@ public abstract class AppDatabase extends RoomDatabase {
|
|||||||
public abstract InventarioRowDao inventarioRowDao();
|
public abstract InventarioRowDao inventarioRowDao();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static final Migration MIGRATION_10_11 = new Migration(10, 11) {
|
static final Migration MIGRATION_10_11 = new Migration(10, 11) {
|
||||||
@Override
|
@Override
|
||||||
public void migrate(SupportSQLiteDatabase database) {
|
public void migrate(SupportSQLiteDatabase database) {
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import it.integry.integrywmsnative.core.data_store.db.dao.InventarioRowDao;
|
|||||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColrDao;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
import it.integry.integrywmsnative.core.data_store.db.dao.MtbColtDao;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.dao.OrdineDao;
|
import it.integry.integrywmsnative.core.data_store.db.dao.OrdineDao;
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.dao.RawDao;
|
||||||
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.repository.ArticoloGrigliaRepository;
|
import it.integry.integrywmsnative.core.data_store.db.repository.ArticoloGrigliaRepository;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.repository.GrigliaRepository;
|
import it.integry.integrywmsnative.core.data_store.db.repository.GrigliaRepository;
|
||||||
@ -53,7 +54,11 @@ public class RoomModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
@Provides
|
||||||
|
RawDao providesRawDao(AppDatabase appDatabase) {
|
||||||
|
return appDatabase.rawDao();
|
||||||
|
}
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Provides
|
@Provides
|
||||||
@ -104,12 +109,6 @@ public class RoomModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Provides
|
@Provides
|
||||||
InventarioRowMapper providesInventarioRowMapper() {
|
InventarioRowMapper providesInventarioRowMapper() {
|
||||||
@ -123,62 +122,50 @@ public class RoomModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
InventarioLocalDataSource providesInventarioLocalDataSource(ExecutorService executorService, InventarioDao inventarioDao) {
|
InventarioLocalDataSource providesInventarioLocalDataSource(ExecutorService executorService, InventarioDao inventarioDao) {
|
||||||
return new InventarioLocalDataSource(executorService, inventarioDao);
|
return new InventarioLocalDataSource(executorService, inventarioDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
InventarioRowLocalDataSource providesInventarioRowLocalDataSource(ExecutorService executorService, InventarioRowDao inventarioRowDao) {
|
InventarioRowLocalDataSource providesInventarioRowLocalDataSource(ExecutorService executorService, InventarioRowDao inventarioRowDao) {
|
||||||
return new InventarioRowLocalDataSource(executorService, inventarioRowDao);
|
return new InventarioRowLocalDataSource(executorService, inventarioRowDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
ArticoloGrigliaRepository providesArticoloGrigliaRepository(ExecutorService executorService, Handler handler, ArticoloGrigliaDao articoloGrigliaDao) {
|
ArticoloGrigliaRepository providesArticoloGrigliaRepository(ExecutorService executorService, Handler handler, ArticoloGrigliaDao articoloGrigliaDao) {
|
||||||
return new ArticoliGrigliaDataSource(executorService, handler, articoloGrigliaDao);
|
return new ArticoliGrigliaDataSource(executorService, handler, articoloGrigliaDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
ArticoliOrdineRepository providesArticoliOrdineRepository(ExecutorService executorService, Handler handler, ArticoloOrdineDao articoloOrdineDao) {
|
ArticoliOrdineRepository providesArticoliOrdineRepository(ExecutorService executorService, Handler handler, ArticoloOrdineDao articoloOrdineDao) {
|
||||||
return new ArticoliOrdineDataSource(executorService, handler, articoloOrdineDao);
|
return new ArticoliOrdineDataSource(executorService, handler, articoloOrdineDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
GrigliaRepository providesGrigliaRepository(ExecutorService executorService, Handler handler, GrigliaDao grigliaDao) {
|
GrigliaRepository providesGrigliaRepository(ExecutorService executorService, Handler handler, GrigliaDao grigliaDao) {
|
||||||
return new GrigliaDataSource(executorService, handler, grigliaDao);
|
return new GrigliaDataSource(executorService, handler, grigliaDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
OrdineRepository providesOrdineRepository(ExecutorService executorService, Handler handler, OrdineDao ordineDao) {
|
OrdineRepository providesOrdineRepository(ExecutorService executorService, Handler handler, OrdineDao ordineDao) {
|
||||||
return new OrdineDataSource(executorService, handler, ordineDao);
|
return new OrdineDataSource(executorService, handler, ordineDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
MtbColtRepository providesMtbColtRepository(ExecutorService executorService, Handler handler, MtbColtDao mtbColtDao) {
|
MtbColtRepository providesMtbColtRepository(ExecutorService executorService, Handler handler, MtbColtDao mtbColtDao) {
|
||||||
return new SqlMtbColtDataSource(executorService, handler, mtbColtDao);
|
return new SqlMtbColtDataSource(executorService, handler, mtbColtDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
MtbColrDataSource providesMtbColrRepository(ExecutorService executorService, Handler handler, MtbColrDao mtbColrDao) {
|
MtbColrDataSource providesMtbColrRepository(ExecutorService executorService, Handler handler, MtbColrDao mtbColrDao) {
|
||||||
return new SqlMtbColrDataSource(executorService, handler, mtbColrDao);
|
return new SqlMtbColrDataSource(executorService, handler, mtbColrDao);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
InventarioRepository providesInventarioRepository(ExecutorService executorService, Handler handler,
|
InventarioRepository providesInventarioRepository(ExecutorService executorService, Handler handler,
|
||||||
InventarioLocalDataSource inventarioLocalDataSource,
|
InventarioLocalDataSource inventarioLocalDataSource,
|
||||||
@ -187,7 +174,6 @@ public class RoomModule {
|
|||||||
return new InventarioRepository(inventarioLocalDataSource, inventarioRESTConsumer, inventarioMapper, handler, executorService);
|
return new InventarioRepository(inventarioLocalDataSource, inventarioRESTConsumer, inventarioMapper, handler, executorService);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
@Provides
|
||||||
InventarioRowRepository providesInventarioRowRepository(ExecutorService executorService, Handler handler,
|
InventarioRowRepository providesInventarioRowRepository(ExecutorService executorService, Handler handler,
|
||||||
InventarioRowLocalDataSource inventarioRowLocalDataSource,
|
InventarioRowLocalDataSource inventarioRowLocalDataSource,
|
||||||
|
|||||||
@ -0,0 +1,13 @@
|
|||||||
|
package it.integry.integrywmsnative.core.data_store.db.dao;
|
||||||
|
|
||||||
|
import androidx.room.Dao;
|
||||||
|
import androidx.room.RawQuery;
|
||||||
|
import androidx.sqlite.db.SupportSQLiteQuery;
|
||||||
|
|
||||||
|
@Dao
|
||||||
|
public interface RawDao {
|
||||||
|
|
||||||
|
@RawQuery
|
||||||
|
int vacuumDb(SupportSQLiteQuery supportSQLiteQuery);
|
||||||
|
|
||||||
|
}
|
||||||
@ -62,7 +62,7 @@ public class InventarioRepository extends _BaseRepository<MtbInvent, InventarioR
|
|||||||
try {
|
try {
|
||||||
var startRetrieve = new Date();
|
var startRetrieve = new Date();
|
||||||
var remoteData = remoteDataSource.makeSynchronousRetrieveRequest();
|
var remoteData = remoteDataSource.makeSynchronousRetrieveRequest();
|
||||||
Log.d("Timing [INVENTORIES RETRIEVE]", ((new Date().getTime() - startRetrieve.getTime()) / 1000) + " secs");
|
Log.d("Time INVENTORY RETRIEVE", ((new Date().getTime() - startRetrieve.getTime()) / 1000) + " secs");
|
||||||
|
|
||||||
if (remoteData == null) remoteData = new ArrayList<>();
|
if (remoteData == null) remoteData = new ArrayList<>();
|
||||||
|
|
||||||
|
|||||||
@ -169,7 +169,7 @@ public class PickingInventarioViewModel extends ViewModel {
|
|||||||
private List<InventarioRowRoomDTO> searchArtInAlreadyScannedItems(InventarioArtDTO inventarioArtDTO) {
|
private List<InventarioRowRoomDTO> searchArtInAlreadyScannedItems(InventarioArtDTO inventarioArtDTO) {
|
||||||
final List<InventarioRowRoomDTO> inventarioRows = this.currentInventarioRows.getValue();
|
final List<InventarioRowRoomDTO> inventarioRows = this.currentInventarioRows.getValue();
|
||||||
|
|
||||||
if (inventarioRows == null) return null;
|
if (inventarioRows == null || inventarioRows.isEmpty()) return null;
|
||||||
|
|
||||||
return Stream.of(inventarioRows).filter(x -> x.getCodMart() != null ? x.getCodMart().equalsIgnoreCase(inventarioArtDTO.getCodMart()) : inventarioArtDTO.getBarcode().contains(x.getScanCodBarre())).toList();
|
return Stream.of(inventarioRows).filter(x -> x.getCodMart() != null ? x.getCodMart().equalsIgnoreCase(inventarioArtDTO.getCodMart()) : inventarioArtDTO.getBarcode().contains(x.getScanCodBarre())).toList();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,8 +28,9 @@ public class ProdRientroMerceViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void refreshOrderList() {
|
public void refreshOrderList() {
|
||||||
new Thread(this::sendOnOrdersLoadingStarted).start();
|
this.sendOnOrdersLoadingStarted();
|
||||||
String codAnag = SettingsManager.iDB().getFilterFornitoreProd();
|
String codAnag = SettingsManager.iDB().getFilterFornitoreProd();
|
||||||
|
|
||||||
this.mMesRESTConsumer.getOrdiniLavorazione("I", null, codAnag, ordiniLavorazioneList -> {
|
this.mMesRESTConsumer.getOrdiniLavorazione("I", null, codAnag, ordiniLavorazioneList -> {
|
||||||
this.mOrdiniLavorazioneAperti.postValue(ordiniLavorazioneList);
|
this.mOrdiniLavorazioneAperti.postValue(ordiniLavorazioneList);
|
||||||
this.sendOnOrdersLoadingEnded();
|
this.sendOnOrdersLoadingEnded();
|
||||||
|
|||||||
@ -15,16 +15,19 @@ import androidx.preference.EditTextPreference;
|
|||||||
import androidx.preference.ListPreference;
|
import androidx.preference.ListPreference;
|
||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
import androidx.preference.PreferenceFragmentCompat;
|
import androidx.preference.PreferenceFragmentCompat;
|
||||||
|
import androidx.sqlite.db.SimpleSQLiteQuery;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.harrysoft.androidbluetoothserial.BluetoothManager;
|
import com.harrysoft.androidbluetoothserial.BluetoothManager;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@ -34,6 +37,7 @@ 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.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.context.AppContext;
|
import it.integry.integrywmsnative.core.context.AppContext;
|
||||||
|
import it.integry.integrywmsnative.core.data_store.db.dao.RawDao;
|
||||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.model.MailAttachmentDTO;
|
import it.integry.integrywmsnative.core.rest.model.MailAttachmentDTO;
|
||||||
@ -48,6 +52,9 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
|||||||
@Inject
|
@Inject
|
||||||
public AppContext appContext;
|
public AppContext appContext;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public RawDao rawDao;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public SystemRESTConsumer systemRESTConsumer;
|
public SystemRESTConsumer systemRESTConsumer;
|
||||||
|
|
||||||
@ -226,29 +233,52 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
|||||||
executorService.execute(() -> {
|
executorService.execute(() -> {
|
||||||
|
|
||||||
|
|
||||||
File yourFile = appContext.getLogFilePath();
|
File logFilePath = appContext.getLogFilePath();
|
||||||
var files = yourFile.listFiles();
|
var files = logFilePath.listFiles();
|
||||||
|
|
||||||
var fileToShare = Stream.of(files)
|
var fileToShare = Stream.of(files)
|
||||||
.sortBy(x -> -1 * x.lastModified())
|
.sortBy(x -> -1 * x.lastModified())
|
||||||
.findFirstOrElse(null);
|
.findFirstOrElse(null);
|
||||||
try {
|
try {
|
||||||
var htmlContent = createAppLogAttachment(fileToShare);
|
List<MailAttachmentDTO> attachmentDTOList = new ArrayList<>();
|
||||||
|
|
||||||
byte[] buffer = htmlContent.getBytes();//specify the size to allow.
|
if(fileToShare != null) {
|
||||||
String base64 = Base64.encodeToString(buffer, Base64.NO_WRAP);
|
var htmlContent = createAppLogAttachment(fileToShare);
|
||||||
|
|
||||||
var attachment = new MailAttachmentDTO()
|
byte[] buffer = htmlContent.getBytes();//specify the size to allow.
|
||||||
.setFileName("wms_log.html")
|
String base64 = Base64.encodeToString(buffer, Base64.NO_WRAP);
|
||||||
.setFileb64Content(base64);
|
|
||||||
|
var logAttachment = new MailAttachmentDTO()
|
||||||
|
.setFileName("wms_log.html")
|
||||||
|
.setFileb64Content(base64);
|
||||||
|
attachmentDTOList.add(logAttachment);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rawDao.vacuumDb(new SimpleSQLiteQuery("pragma wal_checkpoint(full)"));
|
||||||
|
File[] dbFiles = new File[3];
|
||||||
|
dbFiles[0] = requireContext().getDatabasePath("integry_wms");
|
||||||
|
dbFiles[1] = requireContext().getDatabasePath("integry_wms-shm");
|
||||||
|
dbFiles[2] = requireContext().getDatabasePath("integry_wms-wal");
|
||||||
|
|
||||||
|
for(int i = 0; i < dbFiles.length; i++){
|
||||||
|
byte[] dbFileBytes = new byte[(int) dbFiles[i].length()];
|
||||||
|
FileInputStream inputStream = new FileInputStream(dbFiles[i]);
|
||||||
|
final int read = inputStream.read(dbFileBytes);
|
||||||
|
inputStream.close();
|
||||||
|
|
||||||
|
var dbAttachment = new MailAttachmentDTO()
|
||||||
|
.setFileName(dbFiles[i].getName())
|
||||||
|
.setFileb64Content(Base64.encodeToString(dbFileBytes, Base64.NO_WRAP));
|
||||||
|
attachmentDTOList.add(dbAttachment);
|
||||||
|
}
|
||||||
|
|
||||||
var mailRequest = new MailRequestDTO()
|
var mailRequest = new MailRequestDTO()
|
||||||
.setTo("developer@integry.it")
|
.setTo("developer@integry.it")
|
||||||
.setMsgText("Questo è una mail che contiene il log del WMS")
|
.setMsgText("Questo è una mail che contiene il log del WMS")
|
||||||
.setSubject("U vuemmeess")
|
.setSubject("U vuemmeess")
|
||||||
.setAttachments(new ArrayList<>());
|
.setAttachments(attachmentDTOList);
|
||||||
|
|
||||||
mailRequest.getAttachments().add(attachment);
|
|
||||||
|
|
||||||
systemRESTConsumer.sendMail(mailRequest, this::closeProgress, ex -> {
|
systemRESTConsumer.sendMail(mailRequest, this::closeProgress, ex -> {
|
||||||
this.closeProgress();
|
this.closeProgress();
|
||||||
@ -370,7 +400,13 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
|||||||
htmlContent.append("<hr/>");
|
htmlContent.append("<hr/>");
|
||||||
}
|
}
|
||||||
|
|
||||||
htmlContent.append("\n" + "<script type=\"text/javascript\">\n" + " document.querySelectorAll(\".message\").forEach(el => el.innerHTML = el.innerHTML.replaceAll(/at it\\.integry.*?(?:<br>)/g, '<b>$&</b>'));\n" + "</script>\n" + "</body>\n" + "</html>");
|
htmlContent.append("""
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
document.querySelectorAll(".message").forEach(el => el.innerHTML = el.innerHTML.replaceAll(/at it\\.integry.*?(?:<br>)/g, '<b>$&</b>'));
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>""");
|
||||||
|
|
||||||
return htmlContent.toString();
|
return htmlContent.toString();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user