Compare commits
119 Commits
v1.46.18(5
...
v1.47.18(5
| Author | SHA1 | Date | |
|---|---|---|---|
| f9f02452d7 | |||
| 63d1d9ecf0 | |||
| 9c72a2a628 | |||
| 5f1b7ef4a4 | |||
| c36bc9d8c2 | |||
| ba9da26ca0 | |||
| b2ad4fdb62 | |||
| 60e725f554 | |||
| 2f6f9b54c2 | |||
| a2ef35e353 | |||
| b06f058ecf | |||
| e67cbd3760 | |||
| ce9d304043 | |||
| fc30b8253d | |||
| e8da16cb8a | |||
| dff725ea92 | |||
| e4248c8c48 | |||
| 819cc97113 | |||
| 05d806f9f2 | |||
| 6fdadffe77 | |||
| 5ae9371c51 | |||
| 4861c689d7 | |||
| 1c63908b3b | |||
| a622e89058 | |||
| ac4500e2a2 | |||
| 6ebcbc2d6c | |||
| 150be3cae2 | |||
| 72edf5228a | |||
| b72a3321d9 | |||
| 5bf71a1b0c | |||
| ee10427048 | |||
| 7fb7cbf8ec | |||
| 3a43e9238b | |||
| 007d58a17e | |||
| 998a59cffc | |||
| 11b353a91d | |||
| 8772d11e02 | |||
| 3d772e3722 | |||
| 41cfbc273e | |||
| bc67098ae0 | |||
| 0e49c93678 | |||
| ed93b88ee8 | |||
| 2cb184f24b | |||
| 126846aef2 | |||
| 8ac595c6c5 | |||
| fc2c0fbe0c | |||
| 0aa0b09afa | |||
| 9436236eaa | |||
| fc5568a046 | |||
| 590e9ec24e | |||
| 984a4a156b | |||
| 04afb4cfca | |||
| 81eda94fe0 | |||
| 8f02dfbee4 | |||
| 75e1447a54 | |||
| d8f9886f82 | |||
| 3279c4e2af | |||
| 6f070e6998 | |||
| df4bfcc955 | |||
| c1983cf73c | |||
| da9bbd0b1c | |||
| cd84d3e9a8 | |||
| 595f4a8797 | |||
| 388f08a02f | |||
| c562735661 | |||
| ab137ad828 | |||
| b56f209084 | |||
| 5107897888 | |||
| d91eaf3412 | |||
| caa6a7cd75 | |||
| 567b288e4d | |||
| 86121bfa93 | |||
| 669a38732f | |||
| e3e7a7d7c6 | |||
| 75914ab9c9 | |||
| d1976f3e21 | |||
| 5ef5c4b28a | |||
| 2c3d4bbc22 | |||
| fd8bb8e7da | |||
| 60a088a7f4 | |||
| 8ca5207a58 | |||
| f2cc31e08a | |||
| e541031efe | |||
| d4b220d1e6 | |||
| 798835cb4c | |||
| ba72284c87 | |||
| 603c5dd8b7 | |||
| 43fc8be493 | |||
| 22bace2402 | |||
| 3b86460f48 | |||
| ddac54b513 | |||
| a385b01584 | |||
| 7920166110 | |||
| e6f4cc9d6d | |||
| 13d9c40119 | |||
| 1d7125a821 | |||
| deb4d77203 | |||
| 520a1cb07a | |||
| c620e9cb96 | |||
| 6ef4961074 | |||
| 688a8e4bad | |||
| 12796b11e5 | |||
| f7dc857587 | |||
| f99c0e5514 | |||
| f1c304eaeb | |||
| 7b3fde1d71 | |||
| 3c337fc138 | |||
| 021f6974f1 | |||
| 92abfe1da4 | |||
| 6338c1dfa6 | |||
| 657d85be86 | |||
| 97c907c992 | |||
| caed709b64 | |||
| 13800eecab | |||
| c4357f662c | |||
| 67a8ca94db | |||
| 0bfd56c011 | |||
| eead844ac1 | |||
| 00067ca1c9 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -149,3 +149,5 @@ crashlytics.properties
|
|||||||
crashlytics-build.properties
|
crashlytics-build.properties
|
||||||
### AndroidStudio Patch ###
|
### AndroidStudio Patch ###
|
||||||
!/gradle/wrapper/gradle-wrapper.jar
|
!/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
/.idea/copilot.data.migration.agent.xml
|
||||||
|
/.idea/copilot.data.migration.edit.xml
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ pipeline {
|
|||||||
environment {
|
environment {
|
||||||
// ANDROID_HOME = "/usr/local/android/sdk" // Cambia in base al tuo sistema
|
// ANDROID_HOME = "/usr/local/android/sdk" // Cambia in base al tuo sistema
|
||||||
JAVA_HOME = tool 'JDK 17.0.6 x64' // Nome dello strumento configurato in Jenkins
|
JAVA_HOME = tool 'JDK 17.0.6 x64' // Nome dello strumento configurato in Jenkins
|
||||||
PATH = "${env.JAVA_HOME}/bin:${env.PATH}"
|
PATH = "${env.JAVA_HOME}\\bin;${env.PATH}"
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
@@ -44,8 +44,10 @@ pipeline {
|
|||||||
post {
|
post {
|
||||||
success {
|
success {
|
||||||
script {
|
script {
|
||||||
bat "curl -k https://devservices.studioml.it/ems-api/updateWMSApp"
|
bat 'curl -k "https://devservices.studioml.it/ems-api/updateWMSApp?overrideForced=false"'
|
||||||
bat "curl -k https://services.studioml.it/ems-api/updateWMSApp"
|
bat 'curl -k "https://devservices.studioml.it/ems-api/updateWMSApp?overrideForced=false&suffix=beta"'
|
||||||
|
bat 'curl -k "https://services.studioml.it/ems-api/updateWMSApp?overrideForced=false"'
|
||||||
|
bat 'curl -k "https://services.studioml.it/ems-api/updateWMSApp?overrideForced=false&suffix=beta"'
|
||||||
if (env.GIT_BRANCH == "master" || env.GIT_BRANCH == "master-beta") {
|
if (env.GIT_BRANCH == "master" || env.GIT_BRANCH == "master-beta") {
|
||||||
office365ConnectorSend adaptiveCards: true, color: '#008000', message: 'WMS è stato compilato con successo', status: 'SUCCESS', webhookUrl: 'https://prod-89.westeurope.logic.azure.com:443/workflows/260580715a9d4447a54dea861a865536/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=EMqPHohvE5o5IGj_gir_iQaAufR4r8ZJxlFx52jklSE'
|
office365ConnectorSend adaptiveCards: true, color: '#008000', message: 'WMS è stato compilato con successo', status: 'SUCCESS', webhookUrl: 'https://prod-89.westeurope.logic.azure.com:443/workflows/260580715a9d4447a54dea861a865536/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=EMqPHohvE5o5IGj_gir_iQaAufR4r8ZJxlFx52jklSE'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,11 @@ apply plugin: 'com.google.firebase.crashlytics'
|
|||||||
//apply plugin: 'kotlin-android'
|
//apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 506
|
def appVersionCode = 531
|
||||||
def appVersionName = '1.46.18'
|
def appVersionName = '1.47.18'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
@@ -34,7 +35,7 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "it.integry.integrywmsnative"
|
applicationId "it.integry.integrywmsnative"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 35
|
targetSdk 36
|
||||||
versionCode appVersionCode
|
versionCode appVersionCode
|
||||||
versionName appVersionName
|
versionName appVersionName
|
||||||
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
@@ -51,12 +52,18 @@ android {
|
|||||||
buildTypes {
|
buildTypes {
|
||||||
debug {
|
debug {
|
||||||
ext.enableCrashlytics = false
|
ext.enableCrashlytics = false
|
||||||
|
// minifyEnabled true // Abilita la minimizzazione del codice
|
||||||
|
// shrinkResources true // Rimuove risorse non utilizzate
|
||||||
|
// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
minifyEnabled true // Abilita la minimizzazione del codice
|
// minifyEnabled true // Abilita la minimizzazione del codice
|
||||||
shrinkResources true // Rimuove risorse non utilizzate
|
// shrinkResources true // Rimuove risorse non utilizzate
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
|
firebaseCrashlytics {
|
||||||
|
mappingFileUploadEnabled true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,12 +82,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
build {
|
|
||||||
doLast {
|
|
||||||
delete "$projectDir/build/outputs/apk/release/version.txt"
|
|
||||||
file("$projectDir/build/outputs/apk/release/version.txt").text = appVersionCode + '\n' + appVersionName + '\n' + 'forced=true'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gradle.projectsEvaluated {
|
gradle.projectsEvaluated {
|
||||||
tasks.withType(JavaCompile.class).tap {
|
tasks.withType(JavaCompile.class).tap {
|
||||||
@@ -93,7 +95,7 @@ android {
|
|||||||
abortOnError false
|
abortOnError false
|
||||||
}
|
}
|
||||||
namespace 'it.integry.integrywmsnative'
|
namespace 'it.integry.integrywmsnative'
|
||||||
compileSdk 35
|
compileSdk 36
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
@@ -108,23 +110,22 @@ dependencies {
|
|||||||
// exclude group: 'com.android.support', module: 'support-annotations'
|
// exclude group: 'com.android.support', module: 'support-annotations'
|
||||||
// })
|
// })
|
||||||
// implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
// implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
|
|
||||||
implementation 'com.github.lupaulus:logger:2.3.2'
|
implementation 'com.github.lupaulus:logger:2.3.2'
|
||||||
|
|
||||||
//Firebase
|
|
||||||
|
|
||||||
// Import the Firebase BoM
|
// Import the Firebase BoM
|
||||||
implementation platform('com.google.firebase:firebase-bom:33.14.0')
|
implementation platform('com.google.firebase:firebase-bom:33.16.0')
|
||||||
implementation 'com.google.firebase:firebase-analytics'
|
implementation 'com.google.firebase:firebase-analytics'
|
||||||
implementation 'com.google.firebase:firebase-crashlytics'
|
implementation 'com.google.firebase:firebase-crashlytics'
|
||||||
implementation 'com.google.firebase:firebase-perf'
|
implementation 'com.google.firebase:firebase-perf'
|
||||||
implementation 'com.google.android.gms:play-services-basement:18.7.0'
|
implementation 'com.google.android.gms:play-services-basement:18.7.1'
|
||||||
|
|
||||||
//JJWT
|
//JJWT
|
||||||
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
|
implementation 'io.jsonwebtoken:jjwt-api:0.13.0'
|
||||||
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
|
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.13.0'
|
||||||
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'
|
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.13.0'
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
implementation 'androidx.appcompat:appcompat:1.7.1'
|
||||||
implementation 'com.google.android.material:material:1.12.0'
|
implementation 'com.google.android.material:material:1.12.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
|
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
@@ -137,14 +138,14 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0"
|
implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0"
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.11.0'
|
implementation 'com.squareup.retrofit2:retrofit:3.0.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.11.0'
|
implementation 'com.squareup.retrofit2:converter-gson:3.0.0'
|
||||||
implementation 'com.annimon:stream:1.2.2'
|
implementation 'com.annimon:stream:1.2.2'
|
||||||
implementation 'androidx.lifecycle:lifecycle-runtime:2.9.0'
|
implementation 'androidx.lifecycle:lifecycle-runtime:2.9.3'
|
||||||
implementation 'org.apache.commons:commons-text:1.9'
|
implementation 'org.apache.commons:commons-text:1.14.0'
|
||||||
|
|
||||||
//MVVM
|
//MVVM
|
||||||
def dagger2_version = '2.55'
|
def dagger2_version = '2.57.1'
|
||||||
implementation "com.google.dagger:dagger:$dagger2_version"
|
implementation "com.google.dagger:dagger:$dagger2_version"
|
||||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
||||||
implementation "com.google.dagger:dagger-android:$dagger2_version"
|
implementation "com.google.dagger:dagger-android:$dagger2_version"
|
||||||
@@ -160,7 +161,7 @@ dependencies {
|
|||||||
implementation 'com.github.pedromassango:doubleClick:3.0'
|
implementation 'com.github.pedromassango:doubleClick:3.0'
|
||||||
|
|
||||||
//SQLite ROOM
|
//SQLite ROOM
|
||||||
def room_version = "2.7.1"
|
def room_version = "2.7.2"
|
||||||
|
|
||||||
implementation "androidx.room:room-runtime:$room_version"
|
implementation "androidx.room:room-runtime:$room_version"
|
||||||
annotationProcessor "androidx.room:room-compiler:$room_version"
|
annotationProcessor "androidx.room:room-compiler:$room_version"
|
||||||
@@ -186,11 +187,13 @@ dependencies {
|
|||||||
implementation 'com.github.harry1453:android-bluetooth-serial:v1.1.2'
|
implementation 'com.github.harry1453:android-bluetooth-serial:v1.1.2'
|
||||||
|
|
||||||
// RxJava is also required.
|
// RxJava is also required.
|
||||||
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
|
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
|
||||||
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
|
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
||||||
|
|
||||||
//Barcode generator
|
//Barcode generator
|
||||||
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||||
|
|
||||||
|
implementation("org.javatuples:javatuples:1.2")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -214,7 +217,33 @@ tasks.register('addBetaSuffix') {
|
|||||||
"output.outputFileName = \"${filename.replace('.apk', '-beta.apk')}\""
|
"output.outputFileName = \"${filename.replace('.apk', '-beta.apk')}\""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Modifica direttamente la riga che crea 'version.txt' in 'version-beta.txt'
|
||||||
|
content = content.replace(
|
||||||
|
"def versionFile = new File(outputDir, \"version.txt\")",
|
||||||
|
"def versionFile = new File(outputDir, \"version-beta.txt\")"
|
||||||
|
)
|
||||||
|
|
||||||
// Sovrascrivi il file
|
// Sovrascrivi il file
|
||||||
gradleFile.write(content)
|
gradleFile.write(content)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register('createVersionFile') {
|
||||||
|
doLast {
|
||||||
|
def outputDir = file("${projectDir}/build/outputs/apk/release")
|
||||||
|
def versionFile = new File(outputDir, "version.txt")
|
||||||
|
|
||||||
|
// Cancella il file se esiste
|
||||||
|
if (versionFile.exists()) {
|
||||||
|
versionFile.delete()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Crea il file con i contenuti desiderati
|
||||||
|
versionFile.write("${android.defaultConfig.versionCode}\n${android.defaultConfig.versionName}\nforced=true")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
afterEvaluate {
|
||||||
|
tasks.assembleRelease.finalizedBy createVersionFile
|
||||||
|
}
|
||||||
|
|||||||
23
app/proguard-rules.pro
vendored
23
app/proguard-rules.pro
vendored
@@ -23,3 +23,26 @@
|
|||||||
# If you keep the line number information, uncomment this to
|
# If you keep the line number information, uncomment this to
|
||||||
# hide the original source file name.
|
# hide the original source file name.
|
||||||
#-renamesourcefileattribute SourceFile
|
#-renamesourcefileattribute SourceFile
|
||||||
|
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
|
||||||
|
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
|
||||||
|
-keep class * extends com.google.gson.TypeAdapter
|
||||||
|
-keep class * implements com.google.gson.TypeAdapterFactory
|
||||||
|
-keep class * implements com.google.gson.JsonSerializer
|
||||||
|
-keep class * implements com.google.gson.JsonDeserializer
|
||||||
|
# Prevent R8 from leaving Data object members always null
|
||||||
|
-keepclasseswithmembers class * {
|
||||||
|
<init>(...);
|
||||||
|
@com.google.gson.annotations.SerializedName <fields>;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Per JJWT
|
||||||
|
-keep class io.jsonwebtoken.** { *; }
|
||||||
|
-keepnames class io.jsonwebtoken.* { *; }
|
||||||
|
-keepnames interface io.jsonwebtoken.* { *; }
|
||||||
|
|
||||||
|
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
|
||||||
|
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
|
||||||
|
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
|
||||||
|
|
||||||
|
-keep class it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse { *; }
|
||||||
|
-keep class * extends it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse { *; }
|
||||||
@@ -24,19 +24,4 @@ public class CommonConst {
|
|||||||
public static String RECOVER_COLLO_FILE = "recover_ul.json";
|
public static String RECOVER_COLLO_FILE = "recover_ul.json";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Mail {
|
|
||||||
|
|
||||||
public static String[] forErrorsDebug = {
|
|
||||||
"g.scorrano@integry.it",
|
|
||||||
"v.castellana@integry.it"
|
|
||||||
};
|
|
||||||
|
|
||||||
public static String[] forErrors = {
|
|
||||||
// "syslogs@integry.it",
|
|
||||||
"g.scorrano@integry.it",
|
|
||||||
"v.castellana@integry.it"
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ public class JwtUtils {
|
|||||||
private final static String SIGNING_KEY = "gICy3bjD56i/YFnBZZKe5ibiz3Snsp08nybGGziCV4ZcvyXBbyqWUnJ2wTrRXhOuf/xdljPXX0yBaqdAgvKthQ==";
|
private final static String SIGNING_KEY = "gICy3bjD56i/YFnBZZKe5ibiz3Snsp08nybGGziCV4ZcvyXBbyqWUnJ2wTrRXhOuf/xdljPXX0yBaqdAgvKthQ==";
|
||||||
|
|
||||||
public static Claims parseJwt(String token) {
|
public static Claims parseJwt(String token) {
|
||||||
Jws<Claims> jws = Jwts.parserBuilder()
|
Jws<Claims> jws = Jwts.parser()
|
||||||
.setSigningKey(Keys.hmacShaKeyFor(Decoders.BASE64.decode(SIGNING_KEY)))
|
.verifyWith(Keys.hmacShaKeyFor(Decoders.BASE64.decode(SIGNING_KEY)))
|
||||||
.build()
|
.build()
|
||||||
.parseClaimsJws(token);
|
.parseSignedClaims(token);
|
||||||
|
|
||||||
return jws.getBody();
|
return jws.getPayload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,11 +89,25 @@ public class AppContext {
|
|||||||
private void initLogger() {
|
private void initLogger() {
|
||||||
Logger.addLogAdapter(new AndroidLogAdapter());
|
Logger.addLogAdapter(new AndroidLogAdapter());
|
||||||
|
|
||||||
logsFolder = new File(mApplicationContext.getExternalFilesDir(null).getAbsolutePath());
|
File dataDir = mApplicationContext.getExternalFilesDir(null);
|
||||||
int maxBytesSize = 5 * 1024 * 1024;
|
|
||||||
Logger.addLogAdapter(new DiskLogAdapter(logsFolder, maxBytesSize));
|
logsFolder = new File(dataDir, "logs");
|
||||||
|
|
||||||
|
if (!logsFolder.exists())
|
||||||
|
logsFolder.mkdirs();
|
||||||
|
|
||||||
|
//Temporary clean
|
||||||
|
File[] wrongFilesToBeDeleted = dataDir.listFiles((file, s) -> s.startsWith("logs_"));
|
||||||
|
|
||||||
|
if (wrongFilesToBeDeleted != null)
|
||||||
|
for (File fileToDelete : wrongFilesToBeDeleted) {
|
||||||
|
fileToDelete.delete();
|
||||||
|
}
|
||||||
|
|
||||||
removeOldLogs(logsFolder);
|
removeOldLogs(logsFolder);
|
||||||
|
|
||||||
|
int maxBytesSize = 5 * 1024 * 1024;
|
||||||
|
Logger.addLogAdapter(new DiskLogAdapter(logsFolder, maxBytesSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeOldLogs(File logsFolder) {
|
private void removeOldLogs(File logsFolder) {
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ import androidx.databinding.BaseObservable;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.CommonConst;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
|
||||||
|
|
||||||
public class BindableFloat extends BaseObservable {
|
public class BindableFloat extends BaseObservable {
|
||||||
private Float value;
|
private Float value;
|
||||||
|
|
||||||
@@ -15,10 +12,6 @@ public class BindableFloat extends BaseObservable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getBigDecimal() {
|
public BigDecimal getBigDecimal() {
|
||||||
int numberOfDigits = UtilityNumber.countNumberOfDecimalDigits(get());
|
|
||||||
|
|
||||||
if(numberOfDigits > CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS) numberOfDigits = CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS;
|
|
||||||
|
|
||||||
return BigDecimal.valueOf(get());
|
return BigDecimal.valueOf(get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ public class Converters {
|
|||||||
BigDecimal value = null;
|
BigDecimal value = null;
|
||||||
|
|
||||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||||
value = new BigDecimal(s.toString());
|
value = UtilityNumber.parseBigDecimal(s.toString(), Locale.getDefault());
|
||||||
|
|
||||||
observableBigDecimal.set(value);
|
observableBigDecimal.set(value);
|
||||||
}
|
}
|
||||||
@@ -271,7 +271,7 @@ public class Converters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
BigDecimal newValue = observableBigDecimal.get();
|
BigDecimal newValue = observableBigDecimal.get();
|
||||||
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
|
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? UtilityNumber.parseBigDecimal(view.getText().toString(), Locale.getDefault()) : null;
|
||||||
|
|
||||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||||
view.setText(UtilityNumber.decimalToString(newValue));
|
view.setText(UtilityNumber.decimalToString(newValue));
|
||||||
@@ -292,7 +292,7 @@ public class Converters {
|
|||||||
String newValueString = s.toString().trim();
|
String newValueString = s.toString().trim();
|
||||||
|
|
||||||
if (!UtilityString.isNullOrEmpty(newValueString))
|
if (!UtilityString.isNullOrEmpty(newValueString))
|
||||||
value = new BigDecimal(newValueString);
|
value = UtilityNumber.parseBigDecimal(newValueString, Locale.getDefault());
|
||||||
|
|
||||||
observableBigDecimal.set(value);
|
observableBigDecimal.set(value);
|
||||||
}
|
}
|
||||||
@@ -301,7 +301,7 @@ public class Converters {
|
|||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
BigDecimal newValue = observableBigDecimal.get();
|
BigDecimal newValue = observableBigDecimal.get();
|
||||||
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
|
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? UtilityNumber.parseBigDecimal(view.getText().toString(), Locale.getDefault()) : null;
|
||||||
|
|
||||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||||
view.setText(UtilityNumber.decimalToString(newValue));
|
view.setText(UtilityNumber.decimalToString(newValue));
|
||||||
@@ -322,7 +322,7 @@ public class Converters {
|
|||||||
String newValueString = s.toString().trim();
|
String newValueString = s.toString().trim();
|
||||||
|
|
||||||
if (!UtilityString.isNullOrEmpty(newValueString))
|
if (!UtilityString.isNullOrEmpty(newValueString))
|
||||||
value = new BigDecimal(newValueString);
|
value = UtilityNumber.parseBigDecimal(newValueString, Locale.getDefault());
|
||||||
|
|
||||||
observableBigDecimal.set(value);
|
observableBigDecimal.set(value);
|
||||||
}
|
}
|
||||||
@@ -331,7 +331,7 @@ public class Converters {
|
|||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
BigDecimal newValue = observableBigDecimal.get();
|
BigDecimal newValue = observableBigDecimal.get();
|
||||||
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
|
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? UtilityNumber.parseBigDecimal(view.getText().toString(), Locale.getDefault()) : null;
|
||||||
|
|
||||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||||
view.setText(UtilityNumber.decimalToString(newValue));
|
view.setText(UtilityNumber.decimalToString(newValue));
|
||||||
@@ -350,7 +350,8 @@ public class Converters {
|
|||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
BigDecimal value = null;
|
BigDecimal value = null;
|
||||||
if (!UtilityString.isNullOrEmpty(s.toString()))
|
if (!UtilityString.isNullOrEmpty(s.toString()))
|
||||||
value = new BigDecimal(s.toString());
|
value = UtilityNumber.parseBigDecimal(s.toString(), Locale.getDefault());
|
||||||
|
|
||||||
bindableBigDecimal.set(value);
|
bindableBigDecimal.set(value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -358,7 +359,7 @@ public class Converters {
|
|||||||
view.addTextChangedListener(watcher);
|
view.addTextChangedListener(watcher);
|
||||||
}
|
}
|
||||||
BigDecimal newValue = bindableBigDecimal.get();
|
BigDecimal newValue = bindableBigDecimal.get();
|
||||||
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? new BigDecimal(view.getText().toString()) : null;
|
BigDecimal viewValue = !view.getText().toString().trim().isEmpty() ? UtilityNumber.parseBigDecimal(view.getText().toString(), Locale.getDefault()) : null;
|
||||||
|
|
||||||
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
if (!UtilityBigDecimal.equalsTo(viewValue, newValue)) {
|
||||||
view.setText(UtilityNumber.decimalToString(newValue));
|
view.setText(UtilityNumber.decimalToString(newValue));
|
||||||
|
|||||||
@@ -66,9 +66,6 @@ public class Ean128Service {
|
|||||||
|
|
||||||
switch (aiModel.AI) {
|
switch (aiModel.AI) {
|
||||||
case SSCC -> {
|
case SSCC -> {
|
||||||
if (aiValue.length() > 0 && (aiValue.charAt(0) == '0' || aiValue.charAt(0) == '9')) {
|
|
||||||
aiValue = new StringBuilder(aiValue.substring(1));
|
|
||||||
}
|
|
||||||
model.Sscc = aiValue.toString();
|
model.Sscc = aiValue.toString();
|
||||||
}
|
}
|
||||||
case GTIN -> {
|
case GTIN -> {
|
||||||
|
|||||||
@@ -5,8 +5,11 @@ import java.util.List;
|
|||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.pv.CloseVerificaRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.pv.DeleteRowVerificaRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.pv.GiacenzaPvDTO;
|
import it.integry.integrywmsnative.core.rest.model.pv.GiacenzaPvDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.pv.SaveNewVerificaRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.pv.SaveNewRowVerificaRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.pv.UpdateRowVerificaRequestDTO;
|
||||||
|
|
||||||
public class GiacenzaPvRESTConsumer extends _BaseRESTConsumer {
|
public class GiacenzaPvRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
@@ -30,12 +33,36 @@ public class GiacenzaPvRESTConsumer extends _BaseRESTConsumer {
|
|||||||
return giacenzeList != null ? giacenzeList : new ArrayList<>();
|
return giacenzeList != null ? giacenzeList : new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveNewVerificaSynchronized(SaveNewVerificaRequestDTO saveNewVerificaRequest) throws Exception {
|
public void saveNewRowSynchronized(SaveNewRowVerificaRequestDTO saveNewRowVerificaRequest) throws Exception {
|
||||||
GiacenzaPvRESTConsumerService giacenzaPvRESTConsumerService = restBuilder.getService(GiacenzaPvRESTConsumerService.class, 0);
|
GiacenzaPvRESTConsumerService giacenzaPvRESTConsumerService = restBuilder.getService(GiacenzaPvRESTConsumerService.class, 0);
|
||||||
var response = giacenzaPvRESTConsumerService.saveNewVerifica(saveNewVerificaRequest)
|
var response = giacenzaPvRESTConsumerService.saveNewRowVerifica(saveNewRowVerificaRequest)
|
||||||
.execute();
|
.execute();
|
||||||
|
|
||||||
analyzeAnswer(response, "save-verifica-pv");
|
analyzeAnswer(response, "save-row-verifica-pv");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateRowSynchronized(UpdateRowVerificaRequestDTO updateRowVerificaRequest) throws Exception {
|
||||||
|
GiacenzaPvRESTConsumerService giacenzaPvRESTConsumerService = restBuilder.getService(GiacenzaPvRESTConsumerService.class, 0);
|
||||||
|
var response = giacenzaPvRESTConsumerService.updateRowVerifica(updateRowVerificaRequest)
|
||||||
|
.execute();
|
||||||
|
|
||||||
|
analyzeAnswer(response, "update-row-verifica-pv");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteRowSynchronized(DeleteRowVerificaRequestDTO deleteRowVerificaRequest) throws Exception {
|
||||||
|
GiacenzaPvRESTConsumerService giacenzaPvRESTConsumerService = restBuilder.getService(GiacenzaPvRESTConsumerService.class, 0);
|
||||||
|
var response = giacenzaPvRESTConsumerService.deleteRowVerifica(deleteRowVerificaRequest)
|
||||||
|
.execute();
|
||||||
|
|
||||||
|
analyzeAnswer(response, "delete-row-verifica-pv");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void closeVerifica(CloseVerificaRequestDTO closeVerificaRequestDTO) throws Exception {
|
||||||
|
GiacenzaPvRESTConsumerService giacenzaPvRESTConsumerService = restBuilder.getService(GiacenzaPvRESTConsumerService.class, 0);
|
||||||
|
var response = giacenzaPvRESTConsumerService.closeVerifica(closeVerificaRequestDTO)
|
||||||
|
.execute();
|
||||||
|
|
||||||
|
analyzeAnswer(response, "close-verifica-pv");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,11 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.pv.CloseVerificaRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.pv.DeleteRowVerificaRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.pv.GiacenzaPvDTO;
|
import it.integry.integrywmsnative.core.rest.model.pv.GiacenzaPvDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.pv.SaveNewVerificaRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.pv.SaveNewRowVerificaRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.pv.UpdateRowVerificaRequestDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
@@ -17,6 +20,15 @@ public interface GiacenzaPvRESTConsumerService {
|
|||||||
Call<ServiceRESTResponse<List<GiacenzaPvDTO>>> retrieve(@Query("codMdep") String codMdep);
|
Call<ServiceRESTResponse<List<GiacenzaPvDTO>>> retrieve(@Query("codMdep") String codMdep);
|
||||||
|
|
||||||
|
|
||||||
@POST("wms/pv/verifica_giacenze/save_new_verifica")
|
@POST("wms/pv/verifica_giacenze/save_new_row")
|
||||||
Call<ServiceRESTResponse<Void>> saveNewVerifica(@Body SaveNewVerificaRequestDTO saveNewVerificaRequest);
|
Call<ServiceRESTResponse<Void>> saveNewRowVerifica(@Body SaveNewRowVerificaRequestDTO saveNewRowVerificaRequest);
|
||||||
|
|
||||||
|
@POST("wms/pv/verifica_giacenze/update_row")
|
||||||
|
Call<ServiceRESTResponse<Void>> updateRowVerifica(@Body UpdateRowVerificaRequestDTO updateRowVerificaRequest);
|
||||||
|
|
||||||
|
@POST("wms/pv/verifica_giacenze/delete_row")
|
||||||
|
Call<ServiceRESTResponse<Void>> deleteRowVerifica(@Body DeleteRowVerificaRequestDTO deleteRowVerificaRequest);
|
||||||
|
|
||||||
|
@POST("wms/pv/verifica_giacenze/close_verifica")
|
||||||
|
Call<ServiceRESTResponse<Void>> closeVerifica(@Body CloseVerificaRequestDTO closeVerificaRequest);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
@@ -9,6 +10,7 @@ import it.integry.integrywmsnative.core.model.MtbColt;
|
|||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.model.materiali.RecuperaMaterialiRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.materiali.RecuperaMaterialiRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.materiali.VersaMaterialiRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.materiali.VersaMaterialiRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULRestDTO;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class MaterialiRESTConsumer extends _BaseRESTConsumer {
|
public class MaterialiRESTConsumer extends _BaseRESTConsumer {
|
||||||
@@ -21,6 +23,28 @@ public class MaterialiRESTConsumer extends _BaseRESTConsumer {
|
|||||||
this.executorService = executorService;
|
this.executorService = executorService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<HistoryVersamentoProdULRestDTO> makeSynchronousRetrieveLastVersamentiRequest(String codJfas) throws Exception {
|
||||||
|
var materialiRESTConsumerService = restBuilder.getService(MaterialiRESTConsumerService.class);
|
||||||
|
|
||||||
|
var response = materialiRESTConsumerService.retrieveLastVersamenti(codJfas)
|
||||||
|
.execute();
|
||||||
|
|
||||||
|
|
||||||
|
var data = analyzeAnswer(response, "retrieveLastVersamenti");
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void makeRetrieveLastVersamentiRequest(String codJfas, final RunnableArgs<List<HistoryVersamentoProdULRestDTO>> onComplete, final RunnableArgs<Exception> onFailed) {
|
||||||
|
executorService.execute(() -> {
|
||||||
|
try {
|
||||||
|
var response = makeSynchronousRetrieveLastVersamentiRequest(codJfas);
|
||||||
|
if (onComplete != null) onComplete.run(response);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
if (onFailed != null) onFailed.run(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public MtbColt makeSynchronousRecuperaRequest(RecuperaMaterialiRequestDTO request) throws Exception {
|
public MtbColt makeSynchronousRecuperaRequest(RecuperaMaterialiRequestDTO request) throws Exception {
|
||||||
var materialiRESTConsumerService = restBuilder.getService(MaterialiRESTConsumerService.class);
|
var materialiRESTConsumerService = restBuilder.getService(MaterialiRESTConsumerService.class);
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,26 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.materiali.RecuperaMaterialiRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.materiali.RecuperaMaterialiRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.materiali.RecuperaMaterialiResponseDTO;
|
import it.integry.integrywmsnative.core.rest.model.materiali.RecuperaMaterialiResponseDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.materiali.VersaMaterialiRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.materiali.VersaMaterialiRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.materiali.VersaMaterialiResponseDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULRestDTO;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.http.Body;
|
import retrofit2.http.Body;
|
||||||
|
import retrofit2.http.GET;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
public interface MaterialiRESTConsumerService {
|
public interface MaterialiRESTConsumerService {
|
||||||
|
|
||||||
@POST("wms/materiali/versa")
|
@POST("wms/materiali/versa")
|
||||||
Call<ServiceRESTResponse<RecuperaMaterialiResponseDTO>> versa(@Body VersaMaterialiRequestDTO request);
|
Call<ServiceRESTResponse<VersaMaterialiResponseDTO>> versa(@Body VersaMaterialiRequestDTO request);
|
||||||
|
|
||||||
|
@GET("wms/materiali/retrieveLastVersamenti")
|
||||||
|
Call<ServiceRESTResponse<List<HistoryVersamentoProdULRestDTO>>> retrieveLastVersamenti(@Query("codJfas") String codJfas);
|
||||||
|
|
||||||
@POST("wms/materiali/recupera")
|
@POST("wms/materiali/recupera")
|
||||||
Call<ServiceRESTResponse<RecuperaMaterialiResponseDTO>> recupera(@Body RecuperaMaterialiRequestDTO request);
|
Call<ServiceRESTResponse<RecuperaMaterialiResponseDTO>> recupera(@Body RecuperaMaterialiRequestDTO request);
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
@@ -17,8 +14,6 @@ import java.util.concurrent.ExecutorService;
|
|||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.BuildConfig;
|
|
||||||
import it.integry.integrywmsnative.core.CommonConst;
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
|
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
|
||||||
@@ -27,9 +22,7 @@ import it.integry.integrywmsnative.core.rest.model.MailRequestDTO;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.NativeSqlRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
import it.integry.integrywmsnative.core.rest.model.system.LatestAppVersionInfoDTO;
|
import it.integry.integrywmsnative.core.rest.model.system.LatestAppVersionInfoDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityGson;
|
import it.integry.integrywmsnative.core.utility.UtilityGson;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
|
|
||||||
@@ -110,36 +103,6 @@ public class SystemRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void sendErrorLogMail(String message, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
|
|
||||||
String currentAzienda = UtilityString.isNullOrEmpty(SettingsManager.i().getUserSession().getProfileDB()) ? "" : " [" + SettingsManager.i().getUserSession().getProfileDB() + "]";
|
|
||||||
|
|
||||||
String dest = "";
|
|
||||||
if (BuildConfig.DEBUG) {
|
|
||||||
dest = TextUtils.join(";", CommonConst.Mail.forErrorsDebug);
|
|
||||||
} else {
|
|
||||||
dest = TextUtils.join(";", CommonConst.Mail.forErrors);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
MailRequestDTO mailDTO = new MailRequestDTO()
|
|
||||||
.setFrom("sender@integry.it")
|
|
||||||
.setFromName((BuildConfig.DEBUG ? "[DEBUG] " : "") + "WMS Android")
|
|
||||||
.setTo(dest)
|
|
||||||
.setSubject("Bug notification" + currentAzienda)
|
|
||||||
.setMsgText(message)
|
|
||||||
.setHtml(true);
|
|
||||||
|
|
||||||
sendMail(mailDTO, () -> {
|
|
||||||
if (onComplete != null) onComplete.run();
|
|
||||||
}, ex -> {
|
|
||||||
Log.e(SystemRESTConsumer.class.getName(), "", ex);
|
|
||||||
if (onFailed != null) onFailed.run(ex);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void sendMailSynchronized(MailRequestDTO mailDTO) throws Exception {
|
public void sendMailSynchronized(MailRequestDTO mailDTO) throws Exception {
|
||||||
SystemRESTConsumerService service = restBuilder.getService(SystemRESTConsumerService.class);
|
SystemRESTConsumerService service = restBuilder.getService(SystemRESTConsumerService.class);
|
||||||
var response = service.sendMail(mailDTO).execute();
|
var response = service.sendMail(mailDTO).execute();
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.model;
|
package it.integry.integrywmsnative.core.rest.model;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
public class AvailableCodMdepsDTO {
|
public class AvailableCodMdepsDTO {
|
||||||
|
|
||||||
|
@SerializedName("codMdep")
|
||||||
private String codMdep;
|
private String codMdep;
|
||||||
|
|
||||||
|
@SerializedName("descrizione")
|
||||||
private String descrizione;
|
private String descrizione;
|
||||||
|
|
||||||
public String getCodMdep() {
|
public String getCodMdep() {
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model.pv;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
public class CloseVerificaRequestDTO {
|
||||||
|
|
||||||
|
private String codMdep;
|
||||||
|
private LocalDateTime dataVerifica;
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CloseVerificaRequestDTO setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getDataVerifica() {
|
||||||
|
return dataVerifica;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CloseVerificaRequestDTO setDataVerifica(LocalDateTime dataVerifica) {
|
||||||
|
this.dataVerifica = dataVerifica;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model.pv;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
public class DeleteRowVerificaRequestDTO {
|
||||||
|
|
||||||
|
private String codMdep;
|
||||||
|
private LocalDateTime dataVerifica;
|
||||||
|
private VerificaGiacenzeRowDTO row;
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DeleteRowVerificaRequestDTO setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getDataVerifica() {
|
||||||
|
return dataVerifica;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DeleteRowVerificaRequestDTO setDataVerifica(LocalDateTime dataVerifica) {
|
||||||
|
this.dataVerifica = dataVerifica;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VerificaGiacenzeRowDTO getRow() {
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DeleteRowVerificaRequestDTO setRow(VerificaGiacenzeRowDTO row) {
|
||||||
|
this.row = row;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model.pv;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
public class SaveNewRowVerificaRequestDTO {
|
||||||
|
|
||||||
|
private String codMdep;
|
||||||
|
private LocalDateTime dataVerifica;
|
||||||
|
private VerificaGiacenzeRowDTO row;
|
||||||
|
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SaveNewRowVerificaRequestDTO setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getDataVerifica() {
|
||||||
|
return dataVerifica;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SaveNewRowVerificaRequestDTO setDataVerifica(LocalDateTime dataVerifica) {
|
||||||
|
this.dataVerifica = dataVerifica;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VerificaGiacenzeRowDTO getRow() {
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SaveNewRowVerificaRequestDTO setRow(VerificaGiacenzeRowDTO row) {
|
||||||
|
this.row = row;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.model.pv;
|
|
||||||
|
|
||||||
public class SaveNewVerificaRequestDTO {
|
|
||||||
|
|
||||||
private VerificaGiacenzeDTO data;
|
|
||||||
|
|
||||||
public VerificaGiacenzeDTO getData() {
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SaveNewVerificaRequestDTO setData(VerificaGiacenzeDTO data) {
|
|
||||||
this.data = data;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.model.pv;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
public class UpdateRowVerificaRequestDTO {
|
||||||
|
|
||||||
|
private String codMdep;
|
||||||
|
private LocalDateTime dataVerifica;
|
||||||
|
private VerificaGiacenzeRowDTO row;
|
||||||
|
|
||||||
|
|
||||||
|
public String getCodMdep() {
|
||||||
|
return codMdep;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpdateRowVerificaRequestDTO setCodMdep(String codMdep) {
|
||||||
|
this.codMdep = codMdep;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocalDateTime getDataVerifica() {
|
||||||
|
return dataVerifica;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpdateRowVerificaRequestDTO setDataVerifica(LocalDateTime dataVerifica) {
|
||||||
|
this.dataVerifica = dataVerifica;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VerificaGiacenzeRowDTO getRow() {
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpdateRowVerificaRequestDTO setRow(VerificaGiacenzeRowDTO row) {
|
||||||
|
this.row = row;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -98,6 +98,7 @@ public class DBSettingsModel {
|
|||||||
private boolean flagAccettazioneGroupListForn = false;
|
private boolean flagAccettazioneGroupListForn = false;
|
||||||
private boolean flagSpedizioneEnableFastPicking = false;
|
private boolean flagSpedizioneEnableFastPicking = false;
|
||||||
private boolean flagAccettazioneBollaEditableQtaTot = true;
|
private boolean flagAccettazioneBollaEditableQtaTot = true;
|
||||||
|
private boolean flagViewSwitchDepoButton = true;
|
||||||
|
|
||||||
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
public boolean isFlagSpedizioneEnableFakeGiacenza() {
|
||||||
return flagSpedizioneEnableFakeGiacenza;
|
return flagSpedizioneEnableFakeGiacenza;
|
||||||
@@ -824,4 +825,12 @@ public class DBSettingsModel {
|
|||||||
public void setFlagAccettazioneBollaEditableQtaTot(boolean flagAccettazioneBollaEditableQtaTot) {
|
public void setFlagAccettazioneBollaEditableQtaTot(boolean flagAccettazioneBollaEditableQtaTot) {
|
||||||
this.flagAccettazioneBollaEditableQtaTot = flagAccettazioneBollaEditableQtaTot;
|
this.flagAccettazioneBollaEditableQtaTot = flagAccettazioneBollaEditableQtaTot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isFlagViewSwitchDepoButton() {
|
||||||
|
return flagViewSwitchDepoButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlagViewSwitchDepoButton(boolean flagViewSwitchDepoButton) {
|
||||||
|
this.flagViewSwitchDepoButton = flagViewSwitchDepoButton;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,8 +39,6 @@ public class SettingsManager {
|
|||||||
private static SettingsModel settingsModelIstance;
|
private static SettingsModel settingsModelIstance;
|
||||||
private static DBSettingsModel dbSettingsModelIstance;
|
private static DBSettingsModel dbSettingsModelIstance;
|
||||||
|
|
||||||
private static boolean firstStart = false;
|
|
||||||
|
|
||||||
private static Context mContext;
|
private static Context mContext;
|
||||||
private static SystemRESTConsumer mSystemRESTConsumer;
|
private static SystemRESTConsumer mSystemRESTConsumer;
|
||||||
private static ImballiRESTConsumer mImballiRESTConsumer;
|
private static ImballiRESTConsumer mImballiRESTConsumer;
|
||||||
@@ -65,15 +63,15 @@ public class SettingsManager {
|
|||||||
public void init() {
|
public void init() {
|
||||||
settingsModelIstance = (SettingsModel) Stash.getObject(TAG, SettingsModel.class);
|
settingsModelIstance = (SettingsModel) Stash.getObject(TAG, SettingsModel.class);
|
||||||
|
|
||||||
if (settingsModelIstance == null) {
|
if (settingsModelIstance == null)
|
||||||
settingsModelIstance = new SettingsModel();
|
settingsModelIstance = new SettingsModel();
|
||||||
|
|
||||||
|
|
||||||
|
if (settingsModelIstance.getServer() == null)
|
||||||
settingsModelIstance.setServer(new SettingsModel.Server());
|
settingsModelIstance.setServer(new SettingsModel.Server());
|
||||||
firstStart = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
dbSettingsModelIstance = new DBSettingsModel();
|
dbSettingsModelIstance = new DBSettingsModel();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SettingsModel getSettings() {
|
public SettingsModel getSettings() {
|
||||||
@@ -89,10 +87,6 @@ public class SettingsManager {
|
|||||||
return dbSettingsModelIstance;
|
return dbSettingsModelIstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isFirstStart() {
|
|
||||||
return firstStart;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isInstanceAvailable() {
|
public static boolean isInstanceAvailable() {
|
||||||
return i() != null;
|
return i() != null;
|
||||||
}
|
}
|
||||||
@@ -623,6 +617,13 @@ public class SettingsManager {
|
|||||||
.setKeySection("ENABLE_ART_CREATION")
|
.setKeySection("ENABLE_ART_CREATION")
|
||||||
.setSetter(dbSettingsModelIstance::setFlagEnableArtCreation));
|
.setSetter(dbSettingsModelIstance::setFlagEnableArtCreation));
|
||||||
|
|
||||||
|
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
|
||||||
|
.setGestName("PICKING")
|
||||||
|
.setSection("SETUP")
|
||||||
|
.setKeySection("VIEW_SWITCH_DEPO_BUTTON")
|
||||||
|
.setSetter(dbSettingsModelIstance::setFlagViewSwitchDepoButton)
|
||||||
|
);
|
||||||
|
|
||||||
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
|
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
|
||||||
.setGestName("PICKING")
|
.setGestName("PICKING")
|
||||||
.setSection("SETUP")
|
.setSection("SETUP")
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public class UtilityBarcode {
|
|||||||
|
|
||||||
|
|
||||||
public static boolean isEanPeso(BarcodeScanDTO barcodeScanDTO) {
|
public static boolean isEanPeso(BarcodeScanDTO barcodeScanDTO) {
|
||||||
return (isEtichetta128(barcodeScanDTO) || isEan13(barcodeScanDTO)) && barcodeScanDTO.getStringValue().startsWith("2");
|
return (isEtichetta128(barcodeScanDTO) || isEan13(barcodeScanDTO)) && barcodeScanDTO.getStringValue().length() == 13 && barcodeScanDTO.getStringValue().startsWith("2");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isEan8(BarcodeScanDTO barcodeScanDTO) {
|
public static boolean isEan8(BarcodeScanDTO barcodeScanDTO) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.utility;
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.text.DecimalFormatSymbols;
|
import java.text.DecimalFormatSymbols;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
@@ -9,7 +10,8 @@ import it.integry.integrywmsnative.core.CommonConst;
|
|||||||
|
|
||||||
public class UtilityNumber {
|
public class UtilityNumber {
|
||||||
|
|
||||||
private static DecimalFormat decimalFormatInstance;
|
// Locale italiano per la formattazione
|
||||||
|
private static final Locale ITALIAN_LOCALE = new Locale("it", "IT");
|
||||||
|
|
||||||
public static String decimalToString(Float bigDecimal){
|
public static String decimalToString(Float bigDecimal){
|
||||||
if(bigDecimal == null) return "0";
|
if(bigDecimal == null) return "0";
|
||||||
@@ -23,71 +25,59 @@ public class UtilityNumber {
|
|||||||
|
|
||||||
public static String decimalToString(BigDecimal bigDecimal, int decimal){
|
public static String decimalToString(BigDecimal bigDecimal, int decimal){
|
||||||
if(bigDecimal == null) return "0";
|
if(bigDecimal == null) return "0";
|
||||||
return decimalToString(bigDecimal.floatValue(), decimal);
|
|
||||||
|
// Usa stripTrailingZeros per rimuovere gli zeri finali
|
||||||
|
BigDecimal stripped = bigDecimal.stripTrailingZeros();
|
||||||
|
// Limita il numero di decimali visualizzati
|
||||||
|
int scale = Math.min(stripped.scale(), decimal);
|
||||||
|
stripped = stripped.setScale(scale, RoundingMode.DOWN);
|
||||||
|
|
||||||
|
// Configura il formato italiano con virgola come separatore decimale
|
||||||
|
DecimalFormatSymbols italianSymbols = new DecimalFormatSymbols(ITALIAN_LOCALE);
|
||||||
|
italianSymbols.setDecimalSeparator(',');
|
||||||
|
|
||||||
|
// Crea il pattern dinamico basato sul numero di decimali
|
||||||
|
StringBuilder patternBuilder = new StringBuilder("0");
|
||||||
|
if (scale > 0) {
|
||||||
|
patternBuilder.append(".");
|
||||||
|
for (int i = 0; i < scale; i++) {
|
||||||
|
patternBuilder.append("0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DecimalFormat formatter = new DecimalFormat(patternBuilder.toString(), italianSymbols);
|
||||||
|
String result = formatter.format(stripped);
|
||||||
|
|
||||||
|
// Se il risultato termina con ',', rimuovilo (per i numeri interi)
|
||||||
|
if (result.endsWith(",")) {
|
||||||
|
result = result.substring(0, result.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String decimalToString(float floatValue, int decimal) {
|
public static String decimalToString(float floatValue, int decimal) {
|
||||||
DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols(Locale.getDefault());
|
return decimalToString(BigDecimal.valueOf(floatValue), decimal);
|
||||||
otherSymbols.setDecimalSeparator('.');
|
|
||||||
otherSymbols.setGroupingSeparator(',');
|
|
||||||
|
|
||||||
final DecimalFormat decimalFormat = new DecimalFormat();
|
|
||||||
decimalFormat.setMaximumFractionDigits(decimal);
|
|
||||||
decimalFormat.setDecimalFormatSymbols(otherSymbols);
|
|
||||||
decimalFormat.setGroupingUsed(false);
|
|
||||||
decimalFormat.setMinimumFractionDigits(Math.min(2, decimal));
|
|
||||||
|
|
||||||
return decimalFormat.format(floatValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DecimalFormat getNumberFormatInstance() {
|
public static BigDecimal parseBigDecimal(String value, Locale locale) {
|
||||||
|
if (value == null || value.trim().isEmpty()) return null;
|
||||||
if(decimalFormatInstance == null) {
|
try {
|
||||||
DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols(Locale.getDefault());
|
DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);
|
||||||
otherSymbols.setDecimalSeparator('.');
|
DecimalFormat format = new DecimalFormat();
|
||||||
otherSymbols.setGroupingSeparator(',');
|
format.setDecimalFormatSymbols(symbols);
|
||||||
|
format.setParseBigDecimal(true);
|
||||||
decimalFormatInstance = new DecimalFormat();
|
return (BigDecimal) format.parse(value);
|
||||||
decimalFormatInstance.setMaximumFractionDigits(CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS);
|
} catch (Exception e) {
|
||||||
decimalFormatInstance.setDecimalFormatSymbols(otherSymbols);
|
return null;
|
||||||
decimalFormatInstance.setGroupingUsed(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return decimalFormatInstance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int countNumberOfDecimalDigits(Float value) {
|
/**
|
||||||
String text = getNumberFormatInstance().format(Math.abs(value));
|
* Parsa una stringa numerica italiana (con virgola come separatore decimale)
|
||||||
int integerPlaces = text.indexOf('.');
|
* e restituisce un BigDecimal
|
||||||
int decimalPlaces = text.length() - integerPlaces - 1;
|
*/
|
||||||
|
public static BigDecimal parseItalianBigDecimal(String value) {
|
||||||
return decimalPlaces;
|
return parseBigDecimal(value, ITALIAN_LOCALE);
|
||||||
}
|
|
||||||
|
|
||||||
public static String normalizeStringNumber(String numberString) {
|
|
||||||
return numberString.replaceAll(",", ".");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static Float decimalToFloat(BigDecimal bigDecimalValue) {
|
|
||||||
float multiplier = (float) Math.pow(10, CommonConst.Config.NUMBER_OF_DECIMAL_DIGITS);
|
|
||||||
|
|
||||||
Float floatValue = null;
|
|
||||||
|
|
||||||
if(bigDecimalValue != null) {
|
|
||||||
int intValue = (int) (bigDecimalValue.floatValue() * multiplier);
|
|
||||||
floatValue = Float.valueOf(intValue / multiplier);
|
|
||||||
}
|
|
||||||
|
|
||||||
return floatValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static float truncateToDecimal(float v, int i) {
|
|
||||||
int delta = 10*i;
|
|
||||||
|
|
||||||
return ((int)v*delta)/delta;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,9 +45,7 @@ public class DialogSelectDocInfo_FornitoreAdapter extends ArrayAdapter<DialogSel
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return this.getOriginalModel().getCodAnag() +
|
return this.getOriginalModel().getDescrizione();
|
||||||
(this.getOriginalModel().getCodVdes() != null ? " - " + this.getOriginalModel().getCodVdes() : "") +
|
|
||||||
" ( " + this.getOriginalModel().getDescrizione() + " )";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
package it.integry.integrywmsnative.gest.login.dto;
|
package it.integry.integrywmsnative.gest.login.dto;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class AuthTokenClaimsDTO {
|
public class AuthTokenClaimsDTO {
|
||||||
|
|
||||||
|
@SerializedName("deviceId")
|
||||||
private long deviceId;
|
private long deviceId;
|
||||||
|
|
||||||
|
@SerializedName("userDTO")
|
||||||
private User userDTO;
|
private User userDTO;
|
||||||
|
|
||||||
|
@SerializedName("profilesData")
|
||||||
private HashMap<String, AuthTokenProfileDetails> profilesData;
|
private HashMap<String, AuthTokenProfileDetails> profilesData;
|
||||||
|
|
||||||
public long getDeviceId() {
|
public long getDeviceId() {
|
||||||
@@ -36,11 +42,22 @@ public class AuthTokenClaimsDTO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class User {
|
public class User {
|
||||||
|
@SerializedName("username")
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
|
@SerializedName("email")
|
||||||
private Object email;
|
private Object email;
|
||||||
|
|
||||||
|
@SerializedName("fullname")
|
||||||
private String fullname;
|
private String fullname;
|
||||||
|
|
||||||
|
@SerializedName("keyGroup")
|
||||||
private int keyGroup;
|
private int keyGroup;
|
||||||
|
|
||||||
|
@SerializedName("attivo")
|
||||||
private boolean attivo;
|
private boolean attivo;
|
||||||
|
|
||||||
|
@SerializedName("type")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
@@ -99,6 +116,7 @@ public class AuthTokenClaimsDTO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class AuthTokenProfileDetails {
|
public static class AuthTokenProfileDetails {
|
||||||
|
@SerializedName("defaultDepo")
|
||||||
private AuthTokenDepoDetails defaultDepo;
|
private AuthTokenDepoDetails defaultDepo;
|
||||||
|
|
||||||
public AuthTokenDepoDetails getDefaultDepo() {
|
public AuthTokenDepoDetails getDefaultDepo() {
|
||||||
@@ -112,8 +130,13 @@ public class AuthTokenClaimsDTO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class AuthTokenDepoDetails {
|
public static class AuthTokenDepoDetails {
|
||||||
|
@SerializedName("codMdep")
|
||||||
private String codMdep;
|
private String codMdep;
|
||||||
|
|
||||||
|
@SerializedName("descrizione")
|
||||||
private String descrizione;
|
private String descrizione;
|
||||||
|
|
||||||
|
@SerializedName("codJfas")
|
||||||
private String codJfas;
|
private String codJfas;
|
||||||
|
|
||||||
public String getCodMdep() {
|
public String getCodMdep() {
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
package it.integry.integrywmsnative.gest.login.dto;
|
package it.integry.integrywmsnative.gest.login.dto;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
public class AuthenticationJwtResponseDTO {
|
public class AuthenticationJwtResponseDTO {
|
||||||
|
|
||||||
|
@SerializedName("accessToken")
|
||||||
private String accessToken;
|
private String accessToken;
|
||||||
|
|
||||||
|
@SerializedName("refreshToken")
|
||||||
private String refreshToken;
|
private String refreshToken;
|
||||||
|
|
||||||
|
@SerializedName("expiryDate")
|
||||||
private LocalDateTime expiryDate;
|
private LocalDateTime expiryDate;
|
||||||
|
|
||||||
|
@SerializedName("expireIn")
|
||||||
private long expireIn;
|
private long expireIn;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,22 @@
|
|||||||
package it.integry.integrywmsnative.gest.login.dto;
|
package it.integry.integrywmsnative.gest.login.dto;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
public class LoginAziendaDTO {
|
public class LoginAziendaDTO {
|
||||||
|
|
||||||
|
@SerializedName("profileDb")
|
||||||
private String profileDb;
|
private String profileDb;
|
||||||
|
|
||||||
|
@SerializedName("endpointRestApi")
|
||||||
private String endpointRestApi;
|
private String endpointRestApi;
|
||||||
|
|
||||||
|
@SerializedName("phpApi")
|
||||||
private String phpApi;
|
private String phpApi;
|
||||||
|
|
||||||
|
@SerializedName("repoPhoto")
|
||||||
private String repoPhoto;
|
private String repoPhoto;
|
||||||
|
|
||||||
|
@SerializedName("endpointPvm")
|
||||||
private String endpointPvm;
|
private String endpointPvm;
|
||||||
|
|
||||||
public String getProfileDb() {
|
public String getProfileDb() {
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
package it.integry.integrywmsnative.gest.login.dto;
|
package it.integry.integrywmsnative.gest.login.dto;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
public class LoginRequestDTO {
|
public class LoginRequestDTO {
|
||||||
|
|
||||||
|
@SerializedName("username")
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
|
@SerializedName("password")
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
@SerializedName("deviceId")
|
||||||
private String deviceId;
|
private String deviceId;
|
||||||
|
|
||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
package it.integry.integrywmsnative.gest.login.dto;
|
package it.integry.integrywmsnative.gest.login.dto;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class LoginResponseDTO {
|
public class LoginResponseDTO {
|
||||||
|
|
||||||
|
@SerializedName("fullName")
|
||||||
private String fullName;
|
private String fullName;
|
||||||
private List<String> availableProfiles;
|
|
||||||
|
|
||||||
|
@SerializedName("availableProfiles")
|
||||||
|
private List<String> availableProfiles;
|
||||||
|
|
||||||
public String getFullName() {
|
public String getFullName() {
|
||||||
return fullName;
|
return fullName;
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package it.integry.integrywmsnative.gest.login.dto;
|
package it.integry.integrywmsnative.gest.login.dto;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
public class RefreshRequestDTO {
|
public class RefreshRequestDTO {
|
||||||
|
@SerializedName("refreshToken")
|
||||||
private String refreshToken;
|
private String refreshToken;
|
||||||
|
|
||||||
public String getRefreshToken() {
|
public String getRefreshToken() {
|
||||||
|
|||||||
@@ -49,8 +49,12 @@ public class LoginViewModel {
|
|||||||
|
|
||||||
FirebaseInstallations.getInstance().getId().addOnCompleteListener(fid -> {
|
FirebaseInstallations.getInstance().getId().addOnCompleteListener(fid -> {
|
||||||
|
|
||||||
|
SettingsManager.i().createUserSession();
|
||||||
retrieveAvailableProfiles(protocol, host, port, username, password, selectedProfile -> {
|
retrieveAvailableProfiles(protocol, host, port, username, password, selectedProfile -> {
|
||||||
SettingsManager.i().createUserSession();
|
if(selectedProfile == null) {
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
authenticate(protocol, host, port, username, password, selectedProfile, fid.getResult(), fullName -> {
|
authenticate(protocol, host, port, username, password, selectedProfile, fid.getResult(), fullName -> {
|
||||||
|
|
||||||
@@ -126,6 +130,8 @@ public class LoginViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void authenticate(String protocol, String host, int port, String username, String password, String profileDb, String deviceSalt, RunnableArgs<String> onComplete) {
|
private void authenticate(String protocol, String host, int port, String username, String password, String profileDb, String deviceSalt, RunnableArgs<String> onComplete) {
|
||||||
|
|
||||||
|
|
||||||
mAuthenticationRESTConsumer.authenticate(protocol, host, port, username, password, profileDb, deviceSalt, sessionData -> {
|
mAuthenticationRESTConsumer.authenticate(protocol, host, port, username, password, profileDb, deviceSalt, sessionData -> {
|
||||||
|
|
||||||
var claims = JwtUtils.parseJwt(sessionData.getAccessToken());
|
var claims = JwtUtils.parseJwt(sessionData.getAccessToken());
|
||||||
|
|||||||
@@ -122,7 +122,13 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
BarcodeManager.removeCallback(mBarcodeScannerInstanceID);
|
BarcodeManager.removeCallback(mBarcodeScannerInstanceID);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mViewModel.init(codJfas);
|
mViewModel.init(codJfas);
|
||||||
|
mViewModel.refreshData(); // This will eventually trigger the LiveData observer for getOrderList
|
||||||
|
|
||||||
|
mBinding.swiperefresh.setOnRefreshListener(() -> {
|
||||||
|
mViewModel.refreshData();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -299,8 +305,30 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
@Override
|
@Override
|
||||||
public void onDataSaved() {
|
public void onDataSaved() {
|
||||||
this.onLoadingEnded();
|
this.onLoadingEnded();
|
||||||
this.requireActivity().runOnUiThread(() -> {
|
handler.post(() -> {
|
||||||
DialogCommon.showDataSaved(requireActivity(), this::popMe);
|
DialogCommon.showDataSaved(requireActivity(), this::popMe);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDataRefreshStarted() {
|
||||||
|
handler.post(() -> {
|
||||||
|
mBinding.swiperefresh.setRefreshing(true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDataRefreshEnded() {
|
||||||
|
handler.post(() -> {
|
||||||
|
mBinding.swiperefresh.setRefreshing(false);
|
||||||
|
// applyFilters(); // Non strettamente necessario qui se l'observer di getOrderList() fa il suo dovere
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Exception ex) {
|
||||||
|
super.onError(ex);
|
||||||
|
onDataRefreshEnded();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,28 +1,10 @@
|
|||||||
package it.integry.integrywmsnative.gest.prod_recupero_materiale;
|
package it.integry.integrywmsnative.gest.prod_recupero_materiale;
|
||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
import dagger.Provides;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.MaterialiRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.rest.ProdRecuperoMaterialeRESTConsumer;
|
|
||||||
|
|
||||||
@Module(subcomponents = ProdRecuperoMaterialeComponent.class)
|
@Module(subcomponents = ProdRecuperoMaterialeComponent.class)
|
||||||
public class ProdRecuperoMaterialeModule {
|
public class ProdRecuperoMaterialeModule {
|
||||||
|
|
||||||
@Provides
|
|
||||||
ProdRecuperoMaterialeRESTConsumer providesProdRecuperMaterialeRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
|
||||||
return new ProdRecuperoMaterialeRESTConsumer(systemRESTConsumer, articoloRESTConsumer);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Provides
|
|
||||||
ProdRecuperoMaterialeViewModel providesProdRecuperoMaterialeViewModel(ProdRecuperoMaterialeRESTConsumer prodRecuperoMaterialeRESTConsumer,
|
|
||||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
|
||||||
PrinterRESTConsumer printerRESTConsumer,
|
|
||||||
MaterialiRESTConsumer materialiRESTConsumer) {
|
|
||||||
return new ProdRecuperoMaterialeViewModel(prodRecuperoMaterialeRESTConsumer, colliMagazzinoRESTConsumer, printerRESTConsumer, materialiRESTConsumer);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ package it.integry.integrywmsnative.gest.prod_recupero_materiale;
|
|||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@@ -32,31 +34,46 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||||
private final PrinterRESTConsumer mPrinterRESTConsumer;
|
private final PrinterRESTConsumer mPrinterRESTConsumer;
|
||||||
private final MaterialiRESTConsumer mMaterialiRESTConsumer;
|
private final MaterialiRESTConsumer mMaterialiRESTConsumer;
|
||||||
|
private final ExecutorService mExecutorService;
|
||||||
|
|
||||||
private final MutableLiveData<List<HistoryVersamentoProdULDTO>> mUlList = new MutableLiveData<>();
|
private final MutableLiveData<List<HistoryVersamentoProdULDTO>> mUlList = new MutableLiveData<>();
|
||||||
|
|
||||||
private Listener mListener;
|
private Listener mListener;
|
||||||
|
|
||||||
|
private String mCodJfas;
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public ProdRecuperoMaterialeViewModel(ProdRecuperoMaterialeRESTConsumer prodRecuperoMaterialeRESTConsumer,
|
public ProdRecuperoMaterialeViewModel(ProdRecuperoMaterialeRESTConsumer prodRecuperoMaterialeRESTConsumer,
|
||||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer,
|
||||||
PrinterRESTConsumer printerRESTConsumer,
|
PrinterRESTConsumer printerRESTConsumer,
|
||||||
MaterialiRESTConsumer materialiRESTConsumer) {
|
MaterialiRESTConsumer materialiRESTConsumer,
|
||||||
|
ExecutorService executorService) {
|
||||||
this.mProdRecuperoMaterialeRESTConsumer = prodRecuperoMaterialeRESTConsumer;
|
this.mProdRecuperoMaterialeRESTConsumer = prodRecuperoMaterialeRESTConsumer;
|
||||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||||
this.mPrinterRESTConsumer = printerRESTConsumer;
|
this.mPrinterRESTConsumer = printerRESTConsumer;
|
||||||
this.mMaterialiRESTConsumer = materialiRESTConsumer;
|
this.mMaterialiRESTConsumer = materialiRESTConsumer;
|
||||||
|
this.mExecutorService = executorService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init(String codJfas) {
|
public void init(String codJfas) {
|
||||||
this.sendOnLoadingStarted();
|
this.mCodJfas = codJfas;
|
||||||
|
}
|
||||||
|
|
||||||
mProdRecuperoMaterialeRESTConsumer.loadLastULVersate(codJfas, ulList -> {
|
public void refreshData() {
|
||||||
this.mUlList.setValue(ulList);
|
this.sendOnDataRefreshStarted();
|
||||||
|
|
||||||
this.sendOnLoadingEnded();
|
this.mExecutorService.execute(() -> {
|
||||||
}, this::sendError);
|
try {
|
||||||
|
List<HistoryVersamentoProdULDTO> lastUlVersate = mProdRecuperoMaterialeRESTConsumer.loadLastULVersateSynchronized(mCodJfas);
|
||||||
|
lastUlVersate.sort(Comparator.comparing(HistoryVersamentoProdULDTO::getCodJfas));
|
||||||
|
|
||||||
|
this.mUlList.postValue(lastUlVersate);
|
||||||
|
this.sendOnDataRefreshEnded();
|
||||||
|
} catch (Exception e) {
|
||||||
|
this.sendError(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void processBarcodeDTO(BarcodeScanDTO data) {
|
public void processBarcodeDTO(BarcodeScanDTO data) {
|
||||||
@@ -204,6 +221,14 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendOnDataRefreshStarted() {
|
||||||
|
if (this.mListener != null) mListener.onDataRefreshStarted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnDataRefreshEnded() {
|
||||||
|
if (this.mListener != null) mListener.onDataRefreshEnded();
|
||||||
|
}
|
||||||
|
|
||||||
private void sendOnLoadingStarted() {
|
private void sendOnLoadingStarted() {
|
||||||
if (this.mListener != null) mListener.onLoadingStarted();
|
if (this.mListener != null) mListener.onLoadingStarted();
|
||||||
}
|
}
|
||||||
@@ -274,6 +299,10 @@ public class ProdRecuperoMaterialeViewModel {
|
|||||||
void onNoLUFound(Runnable onComplete);
|
void onNoLUFound(Runnable onComplete);
|
||||||
|
|
||||||
void onDataSaved();
|
void onDataSaved();
|
||||||
|
|
||||||
|
void onDataRefreshStarted();
|
||||||
|
|
||||||
|
void onDataRefreshEnded();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,310 +1,432 @@
|
|||||||
package it.integry.integrywmsnative.gest.prod_recupero_materiale.rest;
|
package it.integry.integrywmsnative.gest.prod_recupero_materiale.rest;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import androidx.annotation.NonNull;
|
||||||
import com.google.gson.reflect.TypeToken;
|
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.MaterialiRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDB;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULDTO;
|
||||||
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULRestDTO;
|
import it.integry.integrywmsnative.gest.prod_recupero_materiale.dto.HistoryVersamentoProdULRestDTO;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class ProdRecuperoMaterialeRESTConsumer extends _BaseRESTConsumer {
|
public class ProdRecuperoMaterialeRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
private final SystemRESTConsumer mSystemRESTConsumer;
|
|
||||||
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
private final ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||||
|
private final MaterialiRESTConsumer mMaterialiRESTConsumer;
|
||||||
|
|
||||||
public ProdRecuperoMaterialeRESTConsumer(SystemRESTConsumer systemRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
@Inject
|
||||||
this.mSystemRESTConsumer = systemRESTConsumer;
|
public ProdRecuperoMaterialeRESTConsumer(ArticoloRESTConsumer articoloRESTConsumer, MaterialiRESTConsumer materialiRESTConsumer) {
|
||||||
|
this.mMaterialiRESTConsumer = materialiRESTConsumer;
|
||||||
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
this.mArticoloRESTConsumer = articoloRESTConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void loadLastULVersate(RunnableArgs<List<HistoryVersamentoProdULDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public List<HistoryVersamentoProdULDTO> loadLastULVersateSynchronized() throws Exception {
|
||||||
loadLastULVersate(null, onComplete, onFailed);
|
return loadLastULVersateSynchronized(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadLastULVersate(String codJfas, RunnableArgs<List<HistoryVersamentoProdULDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public @NonNull List<HistoryVersamentoProdULDTO> loadLastULVersateSynchronized(String codJfas) throws Exception {
|
||||||
|
var ulList = mMaterialiRESTConsumer.makeSynchronousRetrieveLastVersamentiRequest(codJfas);
|
||||||
|
|
||||||
String sql = "WITH ul_list AS ( " +
|
if (ulList == null) {
|
||||||
" SELECT jtb_fasi.cod_jfas, " +
|
return new ArrayList<>();
|
||||||
" jtb_fasi.descrizione AS descrizione_fase, " +
|
}
|
||||||
" mtb_colr.gestione, " +
|
|
||||||
" mtb_colr.data_collo, " +
|
|
||||||
" mtb_colr.num_collo, " +
|
|
||||||
" mtb_colr.ser_collo, " +
|
|
||||||
" mtb_colr.cod_mart, " +
|
|
||||||
" mtb_colr.cod_col, " +
|
|
||||||
" mtb_colr.cod_tagl, " +
|
|
||||||
" SUM(mtb_colr.qta_col) AS qta_col, " +
|
|
||||||
" mtb_colr.qta_cnf AS qta_cnf, " +
|
|
||||||
" SUM(mtb_colr.num_cnf) AS num_cnf, " +
|
|
||||||
" mtb_colr.partita_mag, " +
|
|
||||||
" mtb_colr.cod_jcom, " +
|
|
||||||
" mtb_colr.num_collo_rif, " +
|
|
||||||
" mtb_colr.data_collo_rif, " +
|
|
||||||
" mtb_colr.ser_collo_rif, " +
|
|
||||||
" mtb_colr.gestione_rif, " +
|
|
||||||
" mtb_colt.segno, " +
|
|
||||||
" ISNULL(mtb_aart.descrizione_estesa, mtb_aart.descrizione) AS descrizione_art, " +
|
|
||||||
" mtb_aart.unt_mis, " +
|
|
||||||
" MAX(datetime_row) AS datetime_row, " +
|
|
||||||
" mtb_colr.num_ord, " +
|
|
||||||
" mtb_colr.data_ord, " +
|
|
||||||
" mtb_colr.gestione as gestione_ord, " +
|
|
||||||
" mtb_colr.riga_ord, " +
|
|
||||||
" dtb_ord_steps.hr_num as hr, " +
|
|
||||||
" CONVERT(INTEGER, ROUND((CAST(dtb_ord_steps.hr_num AS DECIMAL(20, 5)) / " +
|
|
||||||
" SUM(dtb_ord_steps.hr_num) OVER (PARTITION BY mtb_colr.num_collo)) * 100, " +
|
|
||||||
" SUM(CASE WHEN dtb_ord_steps.hr_num > 0 then dtb_ord_steps.hr_num else 1 end) OVER (PARTITION BY mtb_colr.num_collo)) * 100, " +
|
|
||||||
" 0) as percentage_hr " +
|
|
||||||
" FROM mtb_colr " +
|
|
||||||
" INNER JOIN mtb_colt ON mtb_colr.num_collo = mtb_colt.num_collo " +
|
|
||||||
" AND mtb_colr.data_collo = mtb_colt.data_collo " +
|
|
||||||
" AND mtb_colr.ser_collo = mtb_colt.ser_collo " +
|
|
||||||
" AND mtb_colr.gestione = mtb_colt.gestione " +
|
|
||||||
" " + (SettingsManager.iDB().isFlagVersamentoDirettoProduzione() ? "INNER" : "LEFT OUTER") + " join dtb_ord_steps ON dtb_ord_steps.data_ord = mtb_colr.data_ord " +
|
|
||||||
" AND dtb_ord_steps.gestione = mtb_colr.gestione " +
|
|
||||||
" AND dtb_ord_steps.num_ord = mtb_colr.num_ord " +
|
|
||||||
" AND dtb_ord_steps.data_iniz is not null " +
|
|
||||||
" AND dtb_ord_steps.data_fine is null " +
|
|
||||||
" INNER JOIN mtb_aart ON mtb_colr.cod_mart = mtb_aart.cod_mart " +
|
|
||||||
" LEFT OUTER JOIN jtb_fasi ON mtb_colt.cod_jfas = jtb_fasi.cod_jfas " +
|
|
||||||
" WHERE jtb_fasi.cod_jfas IS NOT NULL " +
|
|
||||||
(UtilityString.isNullOrEmpty(codJfas) ? "" : " AND jtb_fasi.cod_jfas = " + UtilityDB.valueToString(codJfas)) +
|
|
||||||
" AND segno = -1 " +
|
|
||||||
" AND mtb_colr.data_collo > DATEADD(DAY, -5, GETDATE()) " +
|
|
||||||
" GROUP BY jtb_fasi.cod_jfas, " +
|
|
||||||
" jtb_fasi.descrizione, " +
|
|
||||||
" mtb_colr.gestione, " +
|
|
||||||
" mtb_colr.data_collo, " +
|
|
||||||
" mtb_colr.num_collo, " +
|
|
||||||
" mtb_colr.ser_collo, " +
|
|
||||||
" mtb_colr.qta_cnf, " +
|
|
||||||
" mtb_colr.cod_mart, " +
|
|
||||||
" mtb_colr.cod_col, " +
|
|
||||||
" mtb_colr.cod_tagl, " +
|
|
||||||
" mtb_colr.ser_collo, " +
|
|
||||||
" mtb_colr.partita_mag, " +
|
|
||||||
" mtb_colr.cod_jcom, " +
|
|
||||||
" mtb_aart.descrizione_estesa, " +
|
|
||||||
" mtb_aart.descrizione, " +
|
|
||||||
" mtb_aart.unt_mis, " +
|
|
||||||
" mtb_colr.num_collo_rif, " +
|
|
||||||
" mtb_colr.data_collo_rif, " +
|
|
||||||
" mtb_colr.ser_collo_rif, " +
|
|
||||||
" mtb_colr.gestione_rif, " +
|
|
||||||
" mtb_colt.segno, " +
|
|
||||||
" mtb_colr.num_ord, " +
|
|
||||||
" mtb_colr.data_ord, " +
|
|
||||||
" mtb_colr.gestione, " +
|
|
||||||
" mtb_colr.riga_ord, " +
|
|
||||||
" dtb_ord_steps.hr_num " +
|
|
||||||
" HAVING SUM(mtb_colr.qta_col) > 0 " +
|
|
||||||
"), max_ul AS ( " +
|
|
||||||
" SELECT " +
|
|
||||||
" cod_jfas, " +
|
|
||||||
" descrizione_fase, " +
|
|
||||||
" gestione, " +
|
|
||||||
" cod_mart, " +
|
|
||||||
" cod_col, " +
|
|
||||||
" cod_tagl, " +
|
|
||||||
" ser_collo, " +
|
|
||||||
" partita_mag, " +
|
|
||||||
" cod_jcom, " +
|
|
||||||
" descrizione_art, " +
|
|
||||||
" unt_mis, " +
|
|
||||||
" num_collo_rif, " +
|
|
||||||
" data_collo_rif, " +
|
|
||||||
" ser_collo_rif, " +
|
|
||||||
" gestione_rif, " +
|
|
||||||
" segno, " +
|
|
||||||
" num_ord, " +
|
|
||||||
" data_ord, " +
|
|
||||||
" gestione_ord, " +
|
|
||||||
" riga_ord, " +
|
|
||||||
" hr, " +
|
|
||||||
" MAX (datetime_row) as max_datetime_row " +
|
|
||||||
" FROM ul_list " +
|
|
||||||
" GROUP BY cod_jfas, " +
|
|
||||||
" descrizione_fase, " +
|
|
||||||
" gestione, " +
|
|
||||||
" cod_mart, " +
|
|
||||||
" cod_col, " +
|
|
||||||
" cod_tagl, " +
|
|
||||||
" ser_collo, " +
|
|
||||||
" partita_mag, " +
|
|
||||||
" cod_jcom, " +
|
|
||||||
" descrizione_art, " +
|
|
||||||
" unt_mis, " +
|
|
||||||
" num_collo_rif, " +
|
|
||||||
" data_collo_rif, " +
|
|
||||||
" ser_collo_rif, " +
|
|
||||||
" gestione_rif, " +
|
|
||||||
" segno, " +
|
|
||||||
" num_ord, " +
|
|
||||||
" data_ord, " +
|
|
||||||
" gestione_ord, " +
|
|
||||||
" riga_ord, " +
|
|
||||||
" hr " +
|
|
||||||
") " +
|
|
||||||
" " +
|
|
||||||
"SELECT ul_list.* FROM max_ul " +
|
|
||||||
"LEFT OUTER JOIN ul_list ON " +
|
|
||||||
" ISNULL(max_ul.cod_jfas, '') = ISNULL(ul_list.cod_jfas, '') AND " +
|
|
||||||
" ISNULL(max_ul.descrizione_fase, '') = ISNULL(ul_list.descrizione_fase, '') AND " +
|
|
||||||
" ISNULL(max_ul.gestione, '') = ISNULL(ul_list.gestione, '') AND " +
|
|
||||||
" ISNULL(max_ul.cod_mart, '') = ISNULL(ul_list.cod_mart, '') AND " +
|
|
||||||
" ISNULL(max_ul.cod_col, '') = ISNULL(ul_list.cod_col, '') AND " +
|
|
||||||
" ISNULL(max_ul.cod_tagl, '') = ISNULL(ul_list.cod_tagl, '') AND " +
|
|
||||||
" ISNULL(max_ul.ser_collo, '') = ISNULL(ul_list.ser_collo, '') AND " +
|
|
||||||
" ISNULL(max_ul.partita_mag, '') = ISNULL(ul_list.partita_mag, '') AND " +
|
|
||||||
" ISNULL(max_ul.cod_jcom, '') = ISNULL(ul_list.cod_jcom, '') AND " +
|
|
||||||
" ISNULL(max_ul.descrizione_art, '') = ISNULL(ul_list.descrizione_art, '') AND " +
|
|
||||||
" ISNULL(max_ul.unt_mis, '') = ISNULL(ul_list.unt_mis, '') AND " +
|
|
||||||
" ISNULL(max_ul.num_collo_rif, '') = ISNULL(ul_list.num_collo_rif, '') AND " +
|
|
||||||
" ISNULL(max_ul.data_collo_rif, '') = ISNULL(ul_list.data_collo_rif, '') AND " +
|
|
||||||
" ISNULL(max_ul.ser_collo_rif, '') = ISNULL(ul_list.ser_collo_rif, '') AND " +
|
|
||||||
" ISNULL(max_ul.gestione_rif, '') = ISNULL(ul_list.gestione_rif, '') AND " +
|
|
||||||
" ISNULL(max_ul.segno, '') = ISNULL(ul_list.segno, '') AND " +
|
|
||||||
" ISNULL(max_ul.num_ord, '') = ISNULL(ul_list.num_ord, '') AND " +
|
|
||||||
" ISNULL(max_ul.data_ord, '') = ISNULL(ul_list.data_ord, '') AND " +
|
|
||||||
" ISNULL(max_ul.gestione_ord, '') = ISNULL(ul_list.gestione_ord, '') AND " +
|
|
||||||
" ISNULL(max_ul.riga_ord, '') = ISNULL(ul_list.riga_ord, '') AND " +
|
|
||||||
" ISNULL(max_ul.hr, '') = ISNULL(ul_list.hr, '') AND " +
|
|
||||||
" max_ul.max_datetime_row = ul_list.datetime_row";
|
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<HistoryVersamentoProdULRestDTO>>() {
|
List<HistoryVersamentoProdULDTO> newUlList = new ArrayList<>();
|
||||||
}.getType();
|
|
||||||
this.mSystemRESTConsumer.<ArrayList<HistoryVersamentoProdULRestDTO>>processSql(sql, typeOfObjectsList, ulList -> {
|
|
||||||
|
|
||||||
if (ulList == null) {
|
Map<HashMap<String, Object>, List<HistoryVersamentoProdULRestDTO>> ulListGrouped = ulList.stream()
|
||||||
onComplete.run(null);
|
.collect(Collectors.groupingBy(x -> {
|
||||||
return;
|
var keyMap = new HashMap<String, Object>();
|
||||||
|
keyMap.put("gestione", x.getGestione());
|
||||||
|
keyMap.put("data_collo", x.getDataCollo());
|
||||||
|
keyMap.put("ser_collo", x.getSerCollo());
|
||||||
|
keyMap.put("num_collo", x.getNumCollo());
|
||||||
|
keyMap.put("cod_mart", x.getCodMart());
|
||||||
|
keyMap.put("partita_mag", x.getPartitaMag());
|
||||||
|
keyMap.put("gestione_rif", x.getGestioneRif());
|
||||||
|
keyMap.put("data_collo_rif", x.getDataColloRif());
|
||||||
|
keyMap.put("ser_collo_rif", x.getSerColloRif());
|
||||||
|
keyMap.put("num_collo_rif", x.getNumColloRif());
|
||||||
|
return keyMap;
|
||||||
|
}, Collectors.toList()));
|
||||||
|
|
||||||
|
for (HashMap<String, Object> ulKey : ulListGrouped.keySet()) {
|
||||||
|
var matchingUls = ulList.stream().filter(x ->
|
||||||
|
Objects.equals(x.getGestione(), ulKey.get("gestione")) &&
|
||||||
|
Objects.equals(x.getDataCollo(), ulKey.get("data_collo")) &&
|
||||||
|
Objects.equals(x.getSerCollo(), ulKey.get("ser_collo")) &&
|
||||||
|
Objects.equals(x.getNumCollo(), ulKey.get("num_collo")) &&
|
||||||
|
Objects.equals(x.getCodMart(), ulKey.get("cod_mart")) &&
|
||||||
|
Objects.equals(x.getPartitaMag(), ulKey.get("partita_mag")) &&
|
||||||
|
Objects.equals(x.getGestioneRif(), ulKey.get("gestione_rif")) &&
|
||||||
|
Objects.equals(x.getDataColloRif(), ulKey.get("data_collo_rif")) &&
|
||||||
|
Objects.equals(x.getSerColloRif(), ulKey.get("ser_collo_rif")) &&
|
||||||
|
Objects.equals(x.getNumColloRif(), ulKey.get("num_collo_rif"))
|
||||||
|
).collect(Collectors.toUnmodifiableList());
|
||||||
|
|
||||||
|
ulKey.put("qta_col", matchingUls.stream().map(HistoryVersamentoProdULRestDTO::getQtaCol)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
|
ulKey.put("num_cnf", matchingUls.stream().map(HistoryVersamentoProdULRestDTO::getNumCnf)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||||
|
}
|
||||||
|
|
||||||
|
ulListGrouped.forEach((key, value) -> {
|
||||||
|
|
||||||
|
var listaOrdini = value.stream()
|
||||||
|
.filter(x -> x.getDataOrd() != null &&
|
||||||
|
x.getGestioneOrd() != null &&
|
||||||
|
x.getNumOrd() != null)
|
||||||
|
.map(x -> new HistoryVersamentoProdULDTO.OrdineDto()
|
||||||
|
.setData(x.getDataOrd())
|
||||||
|
.setNumero(x.getNumOrd())
|
||||||
|
.setGestione(x.getGestione())
|
||||||
|
.setRigaOrd(x.getRigaOrd())
|
||||||
|
.setQtaCol(x.getQtaCol())
|
||||||
|
.setNumCnf(x.getNumCnf())
|
||||||
|
.setPercentageHr(x.getPercentageHr()))
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toUnmodifiableList());
|
||||||
|
|
||||||
|
var restData = value.get(0);
|
||||||
|
var qtaCol = (BigDecimal) key.get("qta_col");
|
||||||
|
var numCnf = (BigDecimal) key.get("num_cnf");
|
||||||
|
|
||||||
|
newUlList.add(new HistoryVersamentoProdULDTO()
|
||||||
|
.setGestione(restData.getGestione())
|
||||||
|
.setDataCollo(restData.getDataCollo())
|
||||||
|
.setSerCollo(restData.getSerCollo())
|
||||||
|
.setNumCollo(restData.getNumCollo())
|
||||||
|
.setSegno(restData.getSegno())
|
||||||
|
.setCodMart(restData.getCodMart())
|
||||||
|
.setCodCol(restData.getCodCol())
|
||||||
|
.setCodTagl(restData.getCodTagl())
|
||||||
|
.setCodJfas(restData.getCodJfas())
|
||||||
|
.setDescrizioneArt(restData.getDescrizioneArt())
|
||||||
|
.setDescrizioneFase(restData.getDescrizioneFase())
|
||||||
|
.setQtaCol(qtaCol)
|
||||||
|
.setQtaCnf(restData.getQtaCnf())
|
||||||
|
.setNumCnf(numCnf)
|
||||||
|
.setPartitaMag(restData.getPartitaMag())
|
||||||
|
.setCodJcom(restData.getCodJcom())
|
||||||
|
.setDatetimeRow(restData.getDatetimeRow())
|
||||||
|
.setUntMis(restData.getUntMis())
|
||||||
|
.setGestioneRif(restData.getGestioneRif())
|
||||||
|
.setDataColloRif(restData.getDataColloRif())
|
||||||
|
.setSerColloRif(restData.getSerColloRif())
|
||||||
|
.setNumColloRif(restData.getNumColloRif())
|
||||||
|
.setOrdini(listaOrdini));
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
if (!newUlList.isEmpty()) {
|
||||||
|
List<String> codMarts = newUlList.stream()
|
||||||
|
.map(HistoryVersamentoProdULDTO::getCodMart)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toUnmodifiableList());
|
||||||
|
|
||||||
|
var arts = this.mArticoloRESTConsumer.getByCodMartsSynchronized(codMarts);
|
||||||
|
|
||||||
|
if (arts != null && !arts.isEmpty()) {
|
||||||
|
for (HistoryVersamentoProdULDTO value : newUlList) {
|
||||||
|
|
||||||
|
MtbAart foundMtbAart = arts.stream()
|
||||||
|
.filter(x -> x.getCodMart().equalsIgnoreCase(value.getCodMart()))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
|
||||||
|
value.setMtbAart(foundMtbAart);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<HistoryVersamentoProdULDTO> newUlList = new ArrayList<>();
|
return newUlList;
|
||||||
|
|
||||||
Stream.of(ulList)
|
|
||||||
.distinctBy(x -> {
|
|
||||||
HashMap<String, Object> hashMap = new HashMap<>();
|
|
||||||
hashMap.put("gestione", x.getGestione());
|
|
||||||
hashMap.put("data_collo", x.getDataCollo());
|
|
||||||
hashMap.put("ser_collo", x.getSerCollo());
|
|
||||||
hashMap.put("num_collo", x.getNumCollo());
|
|
||||||
hashMap.put("cod_mart", x.getCodMart());
|
|
||||||
hashMap.put("gestione_rif", x.getGestioneRif());
|
|
||||||
hashMap.put("data_collo_rif", x.getDataColloRif());
|
|
||||||
hashMap.put("ser_collo_rif", x.getSerColloRif());
|
|
||||||
hashMap.put("num_collo_rif", x.getNumColloRif());
|
|
||||||
|
|
||||||
return hashMap;
|
} else {
|
||||||
})
|
return newUlList;
|
||||||
.forEach(restDTO -> {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<HistoryVersamentoProdULDTO.OrdineDto> ordineList = ulList.stream()
|
|
||||||
.filter(x -> x.getNumCollo().equals(restDTO.getNumCollo()) &&
|
|
||||||
x.getDataCollo().equals(restDTO.getDataCollo()) &&
|
|
||||||
x.getSerCollo().equals(restDTO.getSerCollo()) &&
|
|
||||||
x.getGestione().equals(restDTO.getGestione()) &&
|
|
||||||
(x.getRigaOrd() == null || Objects.equals(x.getRigaOrd(), restDTO.getRigaOrd())))
|
|
||||||
.map(x -> new HistoryVersamentoProdULDTO.OrdineDto()
|
|
||||||
.setData(x.getDataOrd())
|
|
||||||
.setNumero(x.getNumOrd())
|
|
||||||
.setGestione(x.getGestione())
|
|
||||||
.setRigaOrd(x.getRigaOrd())
|
|
||||||
.setQtaCol(x.getQtaCol())
|
|
||||||
.setNumCnf(x.getNumCnf())
|
|
||||||
.setPercentageHr(x.getPercentageHr()))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
// BigDecimal qtaColTot = BigDecimal.ZERO;
|
// public void loadLastULVersate(String codJfas, RunnableArgs<List<HistoryVersamentoProdULDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
// BigDecimal numCnfColTot = BigDecimal.ZERO;
|
|
||||||
//
|
//
|
||||||
// for (HistoryVersamentoProdULDTO.OrdineDto ordine :
|
// String sql = "WITH ul_list AS ( " +
|
||||||
// ordineList) {
|
// " SELECT jtb_fasi.cod_jfas, " +
|
||||||
// qtaColTot = qtaColTot.add(ordine.getQtaCol());
|
// " jtb_fasi.descrizione AS descrizione_fase, " +
|
||||||
// numCnfColTot = numCnfColTot.add(ordine.getNumCnf());
|
// " mtb_colr.gestione, " +
|
||||||
|
// " mtb_colr.data_collo, " +
|
||||||
|
// " mtb_colr.num_collo, " +
|
||||||
|
// " mtb_colr.ser_collo, " +
|
||||||
|
// " mtb_colr.cod_mart, " +
|
||||||
|
// " mtb_colr.cod_col, " +
|
||||||
|
// " mtb_colr.cod_tagl, " +
|
||||||
|
// " SUM(mtb_colr.qta_col) AS qta_col, " +
|
||||||
|
// " mtb_colr.qta_cnf AS qta_cnf, " +
|
||||||
|
// " SUM(mtb_colr.num_cnf) AS num_cnf, " +
|
||||||
|
// " mtb_colr.partita_mag, " +
|
||||||
|
// " mtb_colr.cod_jcom, " +
|
||||||
|
// " mtb_colr.num_collo_rif, " +
|
||||||
|
// " mtb_colr.data_collo_rif, " +
|
||||||
|
// " mtb_colr.ser_collo_rif, " +
|
||||||
|
// " mtb_colr.gestione_rif, " +
|
||||||
|
// " mtb_colt.segno, " +
|
||||||
|
// " ISNULL(mtb_aart.descrizione_estesa, mtb_aart.descrizione) AS descrizione_art, " +
|
||||||
|
// " mtb_aart.unt_mis, " +
|
||||||
|
// " MAX(datetime_row) AS datetime_row, " +
|
||||||
|
// " mtb_colr.num_ord, " +
|
||||||
|
// " mtb_colr.data_ord, " +
|
||||||
|
// " mtb_colr.gestione as gestione_ord, " +
|
||||||
|
// " mtb_colr.riga_ord, " +
|
||||||
|
// " dtb_ord_steps.hr_num as hr, " +
|
||||||
|
// " CONVERT(INTEGER, ROUND((CAST(dtb_ord_steps.hr_num AS DECIMAL(20, 5)) / " +
|
||||||
|
// " SUM(dtb_ord_steps.hr_num) OVER (PARTITION BY mtb_colr.num_collo)), " +
|
||||||
|
// " SUM(CASE WHEN dtb_ord_steps.hr_num > 0 then dtb_ord_steps.hr_num else 1 end) OVER (PARTITION BY mtb_colr.num_collo)) * 100, " +
|
||||||
|
// " 0) as percentage_hr " +
|
||||||
|
// " FROM mtb_colr " +
|
||||||
|
// " INNER JOIN mtb_colt ON mtb_colr.num_collo = mtb_colt.num_collo " +
|
||||||
|
// " AND mtb_colr.data_collo = mtb_colt.data_collo " +
|
||||||
|
// " AND mtb_colr.ser_collo = mtb_colt.ser_collo " +
|
||||||
|
// " AND mtb_colr.gestione = mtb_colt.gestione " +
|
||||||
|
// " " + (SettingsManager.iDB().isFlagVersamentoDirettoProduzione() ? "INNER" : "LEFT OUTER") + " join dtb_ord_steps ON dtb_ord_steps.data_ord = mtb_colr.data_ord " +
|
||||||
|
// " AND dtb_ord_steps.gestione = mtb_colr.gestione " +
|
||||||
|
// " AND dtb_ord_steps.num_ord = mtb_colr.num_ord " +
|
||||||
|
// " AND dtb_ord_steps.data_iniz is not null " +
|
||||||
|
// " AND dtb_ord_steps.data_fine is null " +
|
||||||
|
// " INNER JOIN mtb_aart ON mtb_colr.cod_mart = mtb_aart.cod_mart " +
|
||||||
|
// " LEFT OUTER JOIN jtb_fasi ON mtb_colt.cod_jfas = jtb_fasi.cod_jfas " +
|
||||||
|
// " WHERE jtb_fasi.cod_jfas IS NOT NULL " +
|
||||||
|
// (UtilityString.isNullOrEmpty(codJfas) ? "" : " AND jtb_fasi.cod_jfas = " + UtilityDB.valueToString(codJfas)) +
|
||||||
|
// " AND segno = -1 " +
|
||||||
|
// " AND mtb_colr.data_collo > DATEADD(DAY, -5, GETDATE()) " +
|
||||||
|
// " GROUP BY jtb_fasi.cod_jfas, " +
|
||||||
|
// " jtb_fasi.descrizione, " +
|
||||||
|
// " mtb_colr.gestione, " +
|
||||||
|
// " mtb_colr.data_collo, " +
|
||||||
|
// " mtb_colr.num_collo, " +
|
||||||
|
// " mtb_colr.ser_collo, " +
|
||||||
|
// " mtb_colr.qta_cnf, " +
|
||||||
|
// " mtb_colr.cod_mart, " +
|
||||||
|
// " mtb_colr.cod_col, " +
|
||||||
|
// " mtb_colr.cod_tagl, " +
|
||||||
|
// " mtb_colr.ser_collo, " +
|
||||||
|
// " mtb_colr.partita_mag, " +
|
||||||
|
// " mtb_colr.cod_jcom, " +
|
||||||
|
// " mtb_aart.descrizione_estesa, " +
|
||||||
|
// " mtb_aart.descrizione, " +
|
||||||
|
// " mtb_aart.unt_mis, " +
|
||||||
|
// " mtb_colr.num_collo_rif, " +
|
||||||
|
// " mtb_colr.data_collo_rif, " +
|
||||||
|
// " mtb_colr.ser_collo_rif, " +
|
||||||
|
// " mtb_colr.gestione_rif, " +
|
||||||
|
// " mtb_colt.segno, " +
|
||||||
|
// " mtb_colr.num_ord, " +
|
||||||
|
// " mtb_colr.data_ord, " +
|
||||||
|
// " mtb_colr.gestione, " +
|
||||||
|
// " mtb_colr.riga_ord, " +
|
||||||
|
// " dtb_ord_steps.hr_num " +
|
||||||
|
// " HAVING SUM(mtb_colr.qta_col) > 0 " +
|
||||||
|
// "), max_ul AS ( " +
|
||||||
|
// " SELECT " +
|
||||||
|
// " cod_jfas, " +
|
||||||
|
// " descrizione_fase, " +
|
||||||
|
// " gestione, " +
|
||||||
|
// " cod_mart, " +
|
||||||
|
// " cod_col, " +
|
||||||
|
// " cod_tagl, " +
|
||||||
|
// " ser_collo, " +
|
||||||
|
// " partita_mag, " +
|
||||||
|
// " cod_jcom, " +
|
||||||
|
// " descrizione_art, " +
|
||||||
|
// " unt_mis, " +
|
||||||
|
// " num_collo_rif, " +
|
||||||
|
// " data_collo_rif, " +
|
||||||
|
// " ser_collo_rif, " +
|
||||||
|
// " gestione_rif, " +
|
||||||
|
// " segno, " +
|
||||||
|
// " num_ord, " +
|
||||||
|
// " data_ord, " +
|
||||||
|
// " gestione_ord, " +
|
||||||
|
// " riga_ord, " +
|
||||||
|
// " hr, " +
|
||||||
|
// " MAX (datetime_row) as max_datetime_row " +
|
||||||
|
// " FROM ul_list " +
|
||||||
|
// " GROUP BY cod_jfas, " +
|
||||||
|
// " descrizione_fase, " +
|
||||||
|
// " gestione, " +
|
||||||
|
// " cod_mart, " +
|
||||||
|
// " cod_col, " +
|
||||||
|
// " cod_tagl, " +
|
||||||
|
// " ser_collo, " +
|
||||||
|
// " partita_mag, " +
|
||||||
|
// " cod_jcom, " +
|
||||||
|
// " descrizione_art, " +
|
||||||
|
// " unt_mis, " +
|
||||||
|
// " num_collo_rif, " +
|
||||||
|
// " data_collo_rif, " +
|
||||||
|
// " ser_collo_rif, " +
|
||||||
|
// " gestione_rif, " +
|
||||||
|
// " segno, " +
|
||||||
|
// " num_ord, " +
|
||||||
|
// " data_ord, " +
|
||||||
|
// " gestione_ord, " +
|
||||||
|
// " riga_ord, " +
|
||||||
|
// " hr " +
|
||||||
|
// ") " +
|
||||||
|
// " " +
|
||||||
|
// "SELECT ul_list.* FROM max_ul " +
|
||||||
|
// "LEFT OUTER JOIN ul_list ON " +
|
||||||
|
// " ISNULL(max_ul.cod_jfas, '') = ISNULL(ul_list.cod_jfas, '') AND " +
|
||||||
|
// " ISNULL(max_ul.descrizione_fase, '') = ISNULL(ul_list.descrizione_fase, '') AND " +
|
||||||
|
// " ISNULL(max_ul.gestione, '') = ISNULL(ul_list.gestione, '') AND " +
|
||||||
|
// " ISNULL(max_ul.cod_mart, '') = ISNULL(ul_list.cod_mart, '') AND " +
|
||||||
|
// " ISNULL(max_ul.cod_col, '') = ISNULL(ul_list.cod_col, '') AND " +
|
||||||
|
// " ISNULL(max_ul.cod_tagl, '') = ISNULL(ul_list.cod_tagl, '') AND " +
|
||||||
|
// " ISNULL(max_ul.ser_collo, '') = ISNULL(ul_list.ser_collo, '') AND " +
|
||||||
|
// " ISNULL(max_ul.partita_mag, '') = ISNULL(ul_list.partita_mag, '') AND " +
|
||||||
|
// " ISNULL(max_ul.cod_jcom, '') = ISNULL(ul_list.cod_jcom, '') AND " +
|
||||||
|
// " ISNULL(max_ul.descrizione_art, '') = ISNULL(ul_list.descrizione_art, '') AND " +
|
||||||
|
// " ISNULL(max_ul.unt_mis, '') = ISNULL(ul_list.unt_mis, '') AND " +
|
||||||
|
// " ISNULL(max_ul.num_collo_rif, '') = ISNULL(ul_list.num_collo_rif, '') AND " +
|
||||||
|
// " ISNULL(max_ul.data_collo_rif, '') = ISNULL(ul_list.data_collo_rif, '') AND " +
|
||||||
|
// " ISNULL(max_ul.ser_collo_rif, '') = ISNULL(ul_list.ser_collo_rif, '') AND " +
|
||||||
|
// " ISNULL(max_ul.gestione_rif, '') = ISNULL(ul_list.gestione_rif, '') AND " +
|
||||||
|
// " ISNULL(max_ul.segno, '') = ISNULL(ul_list.segno, '') AND " +
|
||||||
|
// " ISNULL(max_ul.num_ord, '') = ISNULL(ul_list.num_ord, '') AND " +
|
||||||
|
// " ISNULL(max_ul.data_ord, '') = ISNULL(ul_list.data_ord, '') AND " +
|
||||||
|
// " ISNULL(max_ul.gestione_ord, '') = ISNULL(ul_list.gestione_ord, '') AND " +
|
||||||
|
// " ISNULL(max_ul.riga_ord, '') = ISNULL(ul_list.riga_ord, '') AND " +
|
||||||
|
// " ISNULL(max_ul.hr, '') = ISNULL(ul_list.hr, '') AND " +
|
||||||
|
// " max_ul.max_datetime_row = ul_list.datetime_row";
|
||||||
|
//
|
||||||
|
// Type typeOfObjectsList = new TypeToken<ArrayList<HistoryVersamentoProdULRestDTO>>() {
|
||||||
|
// }.getType();
|
||||||
|
// this.mSystemRESTConsumer.<ArrayList<HistoryVersamentoProdULRestDTO>>processSql(sql, typeOfObjectsList, ulList -> {
|
||||||
|
//
|
||||||
|
// if (ulList == null) {
|
||||||
|
// onComplete.run(null);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// List<HistoryVersamentoProdULDTO> newUlList = new ArrayList<>();
|
||||||
|
//
|
||||||
|
// Stream.of(ulList)
|
||||||
|
// .distinctBy(x -> {
|
||||||
|
// HashMap<String, Object> hashMap = new HashMap<>();
|
||||||
|
// hashMap.put("gestione", x.getGestione());
|
||||||
|
// hashMap.put("data_collo", x.getDataCollo());
|
||||||
|
// hashMap.put("ser_collo", x.getSerCollo());
|
||||||
|
// hashMap.put("num_collo", x.getNumCollo());
|
||||||
|
// hashMap.put("cod_mart", x.getCodMart());
|
||||||
|
// hashMap.put("gestione_rif", x.getGestioneRif());
|
||||||
|
// hashMap.put("data_collo_rif", x.getDataColloRif());
|
||||||
|
// hashMap.put("ser_collo_rif", x.getSerColloRif());
|
||||||
|
// hashMap.put("num_collo_rif", x.getNumColloRif());
|
||||||
|
//
|
||||||
|
// return hashMap;
|
||||||
|
// })
|
||||||
|
// .forEach(restDTO -> {
|
||||||
|
//
|
||||||
|
// List<HistoryVersamentoProdULDTO.OrdineDto> ordineList = ulList.stream()
|
||||||
|
// .filter(x -> x.getNumCollo().equals(restDTO.getNumCollo()) &&
|
||||||
|
// x.getDataCollo().equals(restDTO.getDataCollo()) &&
|
||||||
|
// x.getSerCollo().equals(restDTO.getSerCollo()) &&
|
||||||
|
// x.getGestione().equals(restDTO.getGestione()) &&
|
||||||
|
// (x.getRigaOrd() == null || Objects.equals(x.getRigaOrd(), restDTO.getRigaOrd())))
|
||||||
|
// .map(x -> new HistoryVersamentoProdULDTO.OrdineDto()
|
||||||
|
// .setData(x.getDataOrd())
|
||||||
|
// .setNumero(x.getNumOrd())
|
||||||
|
// .setGestione(x.getGestione())
|
||||||
|
// .setRigaOrd(x.getRigaOrd())
|
||||||
|
// .setQtaCol(x.getQtaCol())
|
||||||
|
// .setNumCnf(x.getNumCnf())
|
||||||
|
// .setPercentageHr(x.getPercentageHr()))
|
||||||
|
// .collect(Collectors.toList());
|
||||||
|
//
|
||||||
|
//// BigDecimal qtaColTot = BigDecimal.ZERO;
|
||||||
|
//// BigDecimal numCnfColTot = BigDecimal.ZERO;
|
||||||
|
////
|
||||||
|
//// for (HistoryVersamentoProdULDTO.OrdineDto ordine :
|
||||||
|
//// ordineList) {
|
||||||
|
//// qtaColTot = qtaColTot.add(ordine.getQtaCol());
|
||||||
|
//// numCnfColTot = numCnfColTot.add(ordine.getNumCnf());
|
||||||
|
//// }
|
||||||
|
//
|
||||||
|
// newUlList.add(new HistoryVersamentoProdULDTO()
|
||||||
|
// .setGestione(restDTO.getGestione())
|
||||||
|
// .setDataCollo(restDTO.getDataCollo())
|
||||||
|
// .setSerCollo(restDTO.getSerCollo())
|
||||||
|
// .setNumCollo(restDTO.getNumCollo())
|
||||||
|
// .setSegno(restDTO.getSegno())
|
||||||
|
// .setCodMart(restDTO.getCodMart())
|
||||||
|
// .setCodCol(restDTO.getCodCol())
|
||||||
|
// .setCodTagl(restDTO.getCodTagl())
|
||||||
|
// .setCodJfas(restDTO.getCodJfas())
|
||||||
|
// .setDescrizioneArt(restDTO.getDescrizioneArt())
|
||||||
|
// .setDescrizioneFase(restDTO.getDescrizioneFase())
|
||||||
|
// .setQtaCol(restDTO.getQtaCol())
|
||||||
|
// .setQtaCnf(restDTO.getQtaCnf())
|
||||||
|
// .setNumCnf(restDTO.getNumCnf())
|
||||||
|
// .setPartitaMag(restDTO.getPartitaMag())
|
||||||
|
// .setCodJcom(restDTO.getCodJcom())
|
||||||
|
// .setDatetimeRow(restDTO.getDatetimeRow())
|
||||||
|
// .setUntMis(restDTO.getUntMis())
|
||||||
|
// .setGestioneRif(restDTO.getGestioneRif())
|
||||||
|
// .setDataColloRif(restDTO.getDataColloRif())
|
||||||
|
// .setSerColloRif(restDTO.getSerColloRif())
|
||||||
|
// .setNumColloRif(restDTO.getNumColloRif())
|
||||||
|
// .setOrdini(ordineList));
|
||||||
|
//
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// if (!newUlList.isEmpty()) {
|
||||||
|
// List<String> codMarts = Stream.of(newUlList)
|
||||||
|
// .map(HistoryVersamentoProdULDTO::getCodMart)
|
||||||
|
// .withoutNulls()
|
||||||
|
// .distinct()
|
||||||
|
// .toList();
|
||||||
|
//
|
||||||
|
// this.mArticoloRESTConsumer.getByCodMarts(codMarts, arts -> {
|
||||||
|
//
|
||||||
|
// if (arts != null && !arts.isEmpty()) {
|
||||||
|
// for (HistoryVersamentoProdULDTO value : newUlList) {
|
||||||
|
//
|
||||||
|
// MtbAart foundMtbAart = null;
|
||||||
|
//
|
||||||
|
// List<MtbAart> mtbAartStream = Stream.of(arts)
|
||||||
|
// .filter(x -> x.getCodMart().equalsIgnoreCase(value.getCodMart())).toList();
|
||||||
|
//
|
||||||
|
// if (mtbAartStream != null && !mtbAartStream.isEmpty()) {
|
||||||
|
// foundMtbAart = mtbAartStream.get(0);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// value.setMtbAart(foundMtbAart);
|
||||||
// }
|
// }
|
||||||
|
// }
|
||||||
newUlList.add(new HistoryVersamentoProdULDTO()
|
//
|
||||||
.setGestione(restDTO.getGestione())
|
// onComplete.run(newUlList);
|
||||||
.setDataCollo(restDTO.getDataCollo())
|
//
|
||||||
.setSerCollo(restDTO.getSerCollo())
|
// }, onFailed);
|
||||||
.setNumCollo(restDTO.getNumCollo())
|
//
|
||||||
.setSegno(restDTO.getSegno())
|
// } else {
|
||||||
.setCodMart(restDTO.getCodMart())
|
// onComplete.run(newUlList);
|
||||||
.setCodCol(restDTO.getCodCol())
|
// }
|
||||||
.setCodTagl(restDTO.getCodTagl())
|
//
|
||||||
.setCodJfas(restDTO.getCodJfas())
|
// }, onFailed);
|
||||||
.setDescrizioneArt(restDTO.getDescrizioneArt())
|
// }
|
||||||
.setDescrizioneFase(restDTO.getDescrizioneFase())
|
|
||||||
.setQtaCol(restDTO.getQtaCol())
|
|
||||||
.setQtaCnf(restDTO.getQtaCnf())
|
|
||||||
.setNumCnf(restDTO.getNumCnf())
|
|
||||||
.setPartitaMag(restDTO.getPartitaMag())
|
|
||||||
.setCodJcom(restDTO.getCodJcom())
|
|
||||||
.setDatetimeRow(restDTO.getDatetimeRow())
|
|
||||||
.setUntMis(restDTO.getUntMis())
|
|
||||||
.setGestioneRif(restDTO.getGestioneRif())
|
|
||||||
.setDataColloRif(restDTO.getDataColloRif())
|
|
||||||
.setSerColloRif(restDTO.getSerColloRif())
|
|
||||||
.setNumColloRif(restDTO.getNumColloRif())
|
|
||||||
.setOrdini(ordineList));
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
if (!newUlList.isEmpty()) {
|
|
||||||
List<String> codMarts = Stream.of(newUlList)
|
|
||||||
.map(HistoryVersamentoProdULDTO::getCodMart)
|
|
||||||
.withoutNulls()
|
|
||||||
.distinct()
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
this.mArticoloRESTConsumer.getByCodMarts(codMarts, arts -> {
|
|
||||||
|
|
||||||
if (arts != null && !arts.isEmpty()) {
|
|
||||||
for (HistoryVersamentoProdULDTO value : newUlList) {
|
|
||||||
|
|
||||||
MtbAart foundMtbAart = null;
|
|
||||||
|
|
||||||
List<MtbAart> mtbAartStream = Stream.of(arts)
|
|
||||||
.filter(x -> x.getCodMart().equalsIgnoreCase(value.getCodMart())).toList();
|
|
||||||
|
|
||||||
if (mtbAartStream != null && !mtbAartStream.isEmpty()) {
|
|
||||||
foundMtbAart = mtbAartStream.get(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
value.setMtbAart(foundMtbAart);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onComplete.run(newUlList);
|
|
||||||
|
|
||||||
}, onFailed);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
onComplete.run(newUlList);
|
|
||||||
}
|
|
||||||
|
|
||||||
}, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class ProdRientroMerceOrderListFilterViewModel {
|
|||||||
|
|
||||||
public void init(List<OrdineLavorazioneDTO> initialList) {
|
public void init(List<OrdineLavorazioneDTO> initialList) {
|
||||||
this.initialOrderList = initialList;
|
this.initialOrderList = initialList;
|
||||||
this.currentFilteredOrderList.setValue(this.initialOrderList);
|
this.currentFilteredOrderList.postValue(this.initialOrderList);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MutableLiveData<List<OrdineLavorazioneDTO>> getMutableFilteredOrderList() {
|
public MutableLiveData<List<OrdineLavorazioneDTO>> getMutableFilteredOrderList() {
|
||||||
|
|||||||
@@ -252,7 +252,13 @@ public class VerificaGiacenzeFragment extends BaseFragment implements ITitledFra
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemDeleteRequest(VerificaGiacenzeRowEntity data) {
|
public void onItemDeleteRequest(VerificaGiacenzeRowEntity data) {
|
||||||
mViewModel.deleteRow(data);
|
executorService.execute(() -> {
|
||||||
|
try {
|
||||||
|
mViewModel.deleteRow(data);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
onError(ex);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -317,12 +323,12 @@ public class VerificaGiacenzeFragment extends BaseFragment implements ITitledFra
|
|||||||
return result.get();
|
return result.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveAndClose() {
|
public void Close() {
|
||||||
this.onLoadingStarted();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
executorService.execute(() -> {
|
executorService.execute(() -> {
|
||||||
try {
|
try {
|
||||||
mViewModel.save();
|
mViewModel.close();
|
||||||
this.onLoadingEnded();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
popMe();
|
popMe();
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import dagger.Module;
|
|||||||
import dagger.Provides;
|
import dagger.Provides;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.VerificaGiacenzeRepository;
|
import it.integry.integrywmsnative.core.data_store.db.respository_new.VerificaGiacenzeRepository;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.VerificaGiacenzeRowRepository;
|
import it.integry.integrywmsnative.core.data_store.db.respository_new.VerificaGiacenzeRowRepository;
|
||||||
import it.integry.integrywmsnative.core.mapper.VerificaGiacenzeMapper;
|
import it.integry.integrywmsnative.core.mapper.VerificaGiacenzeRowMapper;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaPvRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaPvRESTConsumer;
|
||||||
|
|
||||||
@@ -16,8 +16,8 @@ import it.integry.integrywmsnative.core.rest.consumers.GiacenzaPvRESTConsumer;
|
|||||||
public class VerificaGiacenzeModule {
|
public class VerificaGiacenzeModule {
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
VerificaGiacenzeViewModel providesVerificaGiacenzeViewModel(ExecutorService executorService, Handler handler, VerificaGiacenzeMapper verificaGiacenzeMapper, VerificaGiacenzeRepository verificaGiacenzeRepository, VerificaGiacenzeRowRepository verificaGiacenzeRowRepository, GiacenzaPvRESTConsumer giacenzaPvRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
VerificaGiacenzeViewModel providesVerificaGiacenzeViewModel(ExecutorService executorService, Handler handler, VerificaGiacenzeRowMapper verificaGiacenzeRowMapper, VerificaGiacenzeRepository verificaGiacenzeRepository, VerificaGiacenzeRowRepository verificaGiacenzeRowRepository, GiacenzaPvRESTConsumer giacenzaPvRESTConsumer, ArticoloRESTConsumer articoloRESTConsumer) {
|
||||||
return new VerificaGiacenzeViewModel(executorService, handler, verificaGiacenzeMapper, giacenzaPvRESTConsumer, verificaGiacenzeRepository, verificaGiacenzeRowRepository, articoloRESTConsumer);
|
return new VerificaGiacenzeViewModel(executorService, handler, verificaGiacenzeRowMapper, giacenzaPvRESTConsumer, verificaGiacenzeRepository, verificaGiacenzeRowRepository, articoloRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,6 @@ import java.time.LocalDateTime;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -23,14 +22,18 @@ import it.integry.integrywmsnative.core.data_store.db.entity.VerificaGiacenzeRow
|
|||||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.VerificaGiacenzeRepository;
|
import it.integry.integrywmsnative.core.data_store.db.respository_new.VerificaGiacenzeRepository;
|
||||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.VerificaGiacenzeRowRepository;
|
import it.integry.integrywmsnative.core.data_store.db.respository_new.VerificaGiacenzeRowRepository;
|
||||||
import it.integry.integrywmsnative.core.exception.NoArtsFoundException;
|
import it.integry.integrywmsnative.core.exception.NoArtsFoundException;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
import it.integry.integrywmsnative.core.mapper.VerificaGiacenzeMapper;
|
import it.integry.integrywmsnative.core.mapper.VerificaGiacenzeMapper;
|
||||||
|
import it.integry.integrywmsnative.core.mapper.VerificaGiacenzeRowMapper;
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.model.MtbAartBarCode;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaPvRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.GiacenzaPvRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.pv.CloseVerificaRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.pv.DeleteRowVerificaRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.pv.GiacenzaPvDTO;
|
import it.integry.integrywmsnative.core.rest.model.pv.GiacenzaPvDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.pv.SaveNewVerificaRequestDTO;
|
import it.integry.integrywmsnative.core.rest.model.pv.SaveNewRowVerificaRequestDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.pv.UpdateRowVerificaRequestDTO;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
@@ -39,7 +42,7 @@ public class VerificaGiacenzeViewModel {
|
|||||||
|
|
||||||
private final ExecutorService executorService;
|
private final ExecutorService executorService;
|
||||||
private final Handler handler;
|
private final Handler handler;
|
||||||
private final VerificaGiacenzeMapper verificaGiacenzeMapper;
|
private final VerificaGiacenzeRowMapper verificaGiacenzeRowMapper;
|
||||||
private final GiacenzaPvRESTConsumer giacenzaPvRESTConsumer;
|
private final GiacenzaPvRESTConsumer giacenzaPvRESTConsumer;
|
||||||
private final VerificaGiacenzeRepository verificaGiacenzeRepository;
|
private final VerificaGiacenzeRepository verificaGiacenzeRepository;
|
||||||
private final VerificaGiacenzeRowRepository verificaGiacenzeRowRepository;
|
private final VerificaGiacenzeRowRepository verificaGiacenzeRowRepository;
|
||||||
@@ -56,14 +59,14 @@ public class VerificaGiacenzeViewModel {
|
|||||||
@Inject
|
@Inject
|
||||||
public VerificaGiacenzeViewModel(ExecutorService executorService,
|
public VerificaGiacenzeViewModel(ExecutorService executorService,
|
||||||
Handler handler,
|
Handler handler,
|
||||||
VerificaGiacenzeMapper verificaGiacenzeMapper,
|
VerificaGiacenzeRowMapper verificaGiacenzeRowMapper,
|
||||||
GiacenzaPvRESTConsumer giacenzaPvRESTConsumer,
|
GiacenzaPvRESTConsumer giacenzaPvRESTConsumer,
|
||||||
VerificaGiacenzeRepository verificaGiacenzeRepository,
|
VerificaGiacenzeRepository verificaGiacenzeRepository,
|
||||||
VerificaGiacenzeRowRepository verificaGiacenzeRowRepository,
|
VerificaGiacenzeRowRepository verificaGiacenzeRowRepository,
|
||||||
ArticoloRESTConsumer articoloRESTConsumer) {
|
ArticoloRESTConsumer articoloRESTConsumer) {
|
||||||
this.executorService = executorService;
|
this.executorService = executorService;
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
this.verificaGiacenzeMapper = verificaGiacenzeMapper;
|
this.verificaGiacenzeRowMapper = verificaGiacenzeRowMapper;
|
||||||
this.giacenzaPvRESTConsumer = giacenzaPvRESTConsumer;
|
this.giacenzaPvRESTConsumer = giacenzaPvRESTConsumer;
|
||||||
this.verificaGiacenzeRepository = verificaGiacenzeRepository;
|
this.verificaGiacenzeRepository = verificaGiacenzeRepository;
|
||||||
this.verificaGiacenzeRowRepository = verificaGiacenzeRowRepository;
|
this.verificaGiacenzeRowRepository = verificaGiacenzeRowRepository;
|
||||||
@@ -168,19 +171,17 @@ public class VerificaGiacenzeViewModel {
|
|||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void close() throws Exception {
|
||||||
public void save() throws Exception {
|
|
||||||
if (currentVerificaRows.getValue().isEmpty()) {
|
if (currentVerificaRows.getValue().isEmpty()) {
|
||||||
delete();
|
delete();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
currentVerifica.getValue().setVerificaGiacenzeRowList(currentVerificaRows.getValue());
|
CloseVerificaRequestDTO request = new CloseVerificaRequestDTO()
|
||||||
|
.setCodMdep(Objects.requireNonNull(currentVerifica.getValue()).getCodMdep())
|
||||||
|
.setDataVerifica(Objects.requireNonNull(currentVerifica.getValue()).getData());
|
||||||
|
|
||||||
SaveNewVerificaRequestDTO saveRequest = new SaveNewVerificaRequestDTO()
|
giacenzaPvRESTConsumer.closeVerifica(request);
|
||||||
.setData(verificaGiacenzeMapper.mapRoomToRest(currentVerifica.getValue()));
|
|
||||||
|
|
||||||
giacenzaPvRESTConsumer.saveNewVerificaSynchronized(saveRequest);
|
|
||||||
|
|
||||||
delete();
|
delete();
|
||||||
}
|
}
|
||||||
@@ -300,6 +301,19 @@ public class VerificaGiacenzeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void insertRow(VerificaGiacenzeRowEntity rowEntity) {
|
public void insertRow(VerificaGiacenzeRowEntity rowEntity) {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
|
var saveRequest = new SaveNewRowVerificaRequestDTO()
|
||||||
|
.setCodMdep(Objects.requireNonNull(currentVerifica.getValue()).getCodMdep())
|
||||||
|
.setDataVerifica(Objects.requireNonNull(currentVerifica.getValue()).getData())
|
||||||
|
.setRow(verificaGiacenzeRowMapper.mapRoomToRest(rowEntity));
|
||||||
|
|
||||||
|
try {
|
||||||
|
giacenzaPvRESTConsumer.saveNewRowSynchronized(saveRequest);
|
||||||
|
} catch (Exception e) {
|
||||||
|
this.sendError(e);
|
||||||
|
}
|
||||||
|
|
||||||
verificaGiacenzeRowRepository.insert(rowEntity, insertedData -> {
|
verificaGiacenzeRowRepository.insert(rowEntity, insertedData -> {
|
||||||
handler.post(() -> {
|
handler.post(() -> {
|
||||||
currentVerificaRows.getValue().add(insertedData);
|
currentVerificaRows.getValue().add(insertedData);
|
||||||
@@ -309,6 +323,19 @@ public class VerificaGiacenzeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateRow(VerificaGiacenzeRowEntity rowEntity) {
|
public void updateRow(VerificaGiacenzeRowEntity rowEntity) {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
|
var updateRequest = new UpdateRowVerificaRequestDTO()
|
||||||
|
.setCodMdep(Objects.requireNonNull(currentVerifica.getValue()).getCodMdep())
|
||||||
|
.setDataVerifica(Objects.requireNonNull(currentVerifica.getValue()).getData())
|
||||||
|
.setRow(verificaGiacenzeRowMapper.mapRoomToRest(rowEntity));
|
||||||
|
|
||||||
|
try {
|
||||||
|
giacenzaPvRESTConsumer.updateRowSynchronized(updateRequest);
|
||||||
|
} catch (Exception e) {
|
||||||
|
this.sendError(e);
|
||||||
|
}
|
||||||
|
|
||||||
var indexInList = -1;
|
var indexInList = -1;
|
||||||
|
|
||||||
List<VerificaGiacenzeRowEntity> value = currentVerificaRows.getValue();
|
List<VerificaGiacenzeRowEntity> value = currentVerificaRows.getValue();
|
||||||
@@ -331,6 +358,19 @@ public class VerificaGiacenzeViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void deleteRow(VerificaGiacenzeRowEntity rowEntity) {
|
public void deleteRow(VerificaGiacenzeRowEntity rowEntity) {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
|
var deleteRequest = new DeleteRowVerificaRequestDTO()
|
||||||
|
.setCodMdep(Objects.requireNonNull(currentVerifica.getValue()).getCodMdep())
|
||||||
|
.setDataVerifica(Objects.requireNonNull(currentVerifica.getValue()).getData())
|
||||||
|
.setRow(verificaGiacenzeRowMapper.mapRoomToRest(rowEntity));
|
||||||
|
|
||||||
|
try {
|
||||||
|
giacenzaPvRESTConsumer.deleteRowSynchronized(deleteRequest);
|
||||||
|
} catch (Exception e) {
|
||||||
|
this.sendError(e);
|
||||||
|
}
|
||||||
|
|
||||||
verificaGiacenzeRowRepository.delete(rowEntity, () -> {
|
verificaGiacenzeRowRepository.delete(rowEntity, () -> {
|
||||||
|
|
||||||
handler.post(() -> {
|
handler.post(() -> {
|
||||||
@@ -343,6 +383,7 @@ public class VerificaGiacenzeViewModel {
|
|||||||
|
|
||||||
private void notifyRowChanged() {
|
private void notifyRowChanged() {
|
||||||
currentVerificaRows.postValue(currentVerificaRows.getValue());
|
currentVerificaRows.postValue(currentVerificaRows.getValue());
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
}
|
}
|
||||||
|
|
||||||
private PickedQuantityDTO sendOnItemDispatched(MtbAart mtbAart,
|
private PickedQuantityDTO sendOnItemDispatched(MtbAart mtbAart,
|
||||||
@@ -373,7 +414,15 @@ public class VerificaGiacenzeViewModel {
|
|||||||
this.listener.onError(ex);
|
this.listener.onError(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface Listener {
|
private void sendOnLoadingStarted() {
|
||||||
|
if (this.listener != null) listener.onLoadingStarted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnLoadingEnded() {
|
||||||
|
if (this.listener != null) listener.onLoadingEnded();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface Listener extends ILoadingListener {
|
||||||
PickedQuantityDTO onItemDispatched(MtbAart mtbAart,
|
PickedQuantityDTO onItemDispatched(MtbAart mtbAart,
|
||||||
BigDecimal initialNumCnf,
|
BigDecimal initialNumCnf,
|
||||||
BigDecimal initialQtaCnf,
|
BigDecimal initialQtaCnf,
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import androidx.sqlite.db.SimpleSQLiteQuery;
|
|||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
import com.google.firebase.crashlytics.CustomKeysAndValues;
|
||||||
|
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||||
import com.harrysoft.androidbluetoothserial.BluetoothManager;
|
import com.harrysoft.androidbluetoothserial.BluetoothManager;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
@@ -31,7 +33,9 @@ import java.util.Arrays;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@@ -256,78 +260,110 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
|||||||
private void exportLog() {
|
private void exportLog() {
|
||||||
var handler = new Handler(Looper.getMainLooper());
|
var handler = new Handler(Looper.getMainLooper());
|
||||||
|
|
||||||
DialogYesNoView.newInstance("Esportazione log", "Vuoi inviare il log degli eventi al supporto?", result -> {
|
executorService.execute(() -> {
|
||||||
if (result == DialogConsts.Results.NO || result == DialogConsts.Results.ABORT)
|
|
||||||
return;
|
|
||||||
|
|
||||||
this.openProgress();
|
if(!askConfirmToExportLog()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
executorService.execute(() -> {
|
this.openProgress();
|
||||||
|
|
||||||
|
|
||||||
File logFilePath = appContext.getLogFilePath();
|
File logFilePath = appContext.getLogFilePath();
|
||||||
var files = logFilePath.listFiles();
|
var files = logFilePath.listFiles(File::isFile);
|
||||||
|
|
||||||
var fileToShare = Arrays.stream(files)
|
var fileToShare = Arrays.stream(files)
|
||||||
.sorted(Comparator.reverseOrder())
|
.sorted(Comparator.reverseOrder())
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
try {
|
try {
|
||||||
List<MailAttachmentDTO> attachmentDTOList = new ArrayList<>();
|
List<MailAttachmentDTO> attachmentDTOList = new ArrayList<>();
|
||||||
|
|
||||||
if (fileToShare != null) {
|
if (fileToShare != null) {
|
||||||
var htmlContent = createAppLogAttachment(fileToShare);
|
try {
|
||||||
|
var htmlContent = createAppLogAttachment(fileToShare);
|
||||||
|
|
||||||
byte[] buffer = htmlContent.getBytes();//specify the size to allow.
|
byte[] buffer = htmlContent.getBytes();//specify the size to allow.
|
||||||
String base64 = Base64.encodeToString(buffer, Base64.NO_WRAP);
|
String base64 = Base64.encodeToString(buffer, Base64.NO_WRAP);
|
||||||
|
|
||||||
var logAttachment = new MailAttachmentDTO()
|
var logAttachment = new MailAttachmentDTO()
|
||||||
.setFileName("wms_log.html")
|
.setFileName("wms_log.html")
|
||||||
.setFileb64Content(base64);
|
.setFileb64Content(base64);
|
||||||
attachmentDTOList.add(logAttachment);
|
attachmentDTOList.add(logAttachment);
|
||||||
}
|
} catch (Exception ex) {
|
||||||
|
String rawLogFile = getRawLogAttachment(fileToShare);
|
||||||
|
|
||||||
|
byte[] buffer = rawLogFile.getBytes();//specify the size to allow.
|
||||||
|
String base64 = Base64.encodeToString(buffer, Base64.NO_WRAP);
|
||||||
|
|
||||||
|
var logAttachment = new MailAttachmentDTO()
|
||||||
|
.setFileName("raw_log.txt")
|
||||||
|
.setFileb64Content(base64);
|
||||||
|
attachmentDTOList.add(logAttachment);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
rawDao.vacuumDb(new SimpleSQLiteQuery("pragma wal_checkpoint(full)"));
|
rawDao.vacuumDb(new SimpleSQLiteQuery("pragma wal_checkpoint(full)"));
|
||||||
File[] dbFiles = new File[3];
|
rawDao.vacuumDb(new SimpleSQLiteQuery("VACUUM;"));
|
||||||
dbFiles[0] = requireContext().getDatabasePath("integry_wms");
|
File[] dbFiles = new File[3];
|
||||||
dbFiles[1] = requireContext().getDatabasePath("integry_wms-shm");
|
dbFiles[0] = requireContext().getDatabasePath("integry_wms");
|
||||||
dbFiles[2] = requireContext().getDatabasePath("integry_wms-wal");
|
dbFiles[1] = requireContext().getDatabasePath("integry_wms-shm");
|
||||||
|
dbFiles[2] = requireContext().getDatabasePath("integry_wms-wal");
|
||||||
|
|
||||||
for (int i = 0; i < dbFiles.length; i++) {
|
for (int i = 0; i < dbFiles.length; i++) {
|
||||||
byte[] dbFileBytes = new byte[(int) dbFiles[i].length()];
|
byte[] dbFileBytes = new byte[(int) dbFiles[i].length()];
|
||||||
FileInputStream inputStream = new FileInputStream(dbFiles[i]);
|
FileInputStream inputStream = new FileInputStream(dbFiles[i]);
|
||||||
final int read = inputStream.read(dbFileBytes);
|
final int read = inputStream.read(dbFileBytes);
|
||||||
inputStream.close();
|
inputStream.close();
|
||||||
|
|
||||||
var dbAttachment = new MailAttachmentDTO()
|
var dbAttachment = new MailAttachmentDTO()
|
||||||
.setFileName(dbFiles[i].getName())
|
.setFileName(dbFiles[i].getName())
|
||||||
.setFileb64Content(Base64.encodeToString(dbFileBytes, Base64.NO_WRAP));
|
.setFileb64Content(Base64.encodeToString(dbFileBytes, Base64.NO_WRAP));
|
||||||
attachmentDTOList.add(dbAttachment);
|
attachmentDTOList.add(dbAttachment);
|
||||||
}
|
}
|
||||||
|
|
||||||
var mailRequest = new MailRequestDTO()
|
var mailRequest = new MailRequestDTO()
|
||||||
.setTo("developer@integry.it")
|
.setTo("developer@integry.it")
|
||||||
.setMsgText("Questa è una mail contenente il log del WMS")
|
.setMsgText("Questa è una mail contenente il log del WMS")
|
||||||
.setSubject("Internal WMS log")
|
.setSubject("Internal WMS log")
|
||||||
.setAttachments(attachmentDTOList);
|
.setAttachments(attachmentDTOList);
|
||||||
|
|
||||||
|
|
||||||
systemRESTConsumer.sendMailSynchronized(mailRequest);
|
systemRESTConsumer.sendMailSynchronized(mailRequest);
|
||||||
|
|
||||||
this.closeProgress();
|
this.closeProgress();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
handler.post(() -> {
|
handler.post(() -> {
|
||||||
this.closeProgress();
|
FirebaseCrashlytics.getInstance().recordException(ex, new CustomKeysAndValues.Builder() {{
|
||||||
UtilityExceptions.defaultException(requireContext(), ex);
|
putString("ExportLog", "Error while exporting log");
|
||||||
});
|
}}.build());
|
||||||
}
|
this.closeProgress();
|
||||||
});
|
UtilityExceptions.defaultException(requireContext(), ex);
|
||||||
})
|
});
|
||||||
.show(getParentFragmentManager(), "tag");
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private boolean askConfirmToExportLog() {
|
||||||
|
CountDownLatch countDownLatch = new CountDownLatch(1);
|
||||||
|
AtomicBoolean userConfirmed = new AtomicBoolean(false);
|
||||||
|
|
||||||
|
DialogYesNoView.newInstance("Esportazione log", "Vuoi inviare il log degli eventi al supporto?", result -> {
|
||||||
|
userConfirmed.set(result != DialogConsts.Results.NO && result != DialogConsts.Results.ABORT);
|
||||||
|
countDownLatch.countDown();
|
||||||
|
}).show(getParentFragmentManager(), "tag");
|
||||||
|
|
||||||
|
try {
|
||||||
|
countDownLatch.await();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return userConfirmed.get();
|
||||||
|
}
|
||||||
|
|
||||||
private void openProgress() {
|
private void openProgress() {
|
||||||
// executorService.execute(() -> {
|
// executorService.execute(() -> {
|
||||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
|
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
|
||||||
@@ -437,4 +473,24 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
|||||||
|
|
||||||
return htmlContent.toString();
|
return htmlContent.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getRawLogAttachment(File logFile) {
|
||||||
|
//Read text from file
|
||||||
|
StringBuilder text = new StringBuilder();
|
||||||
|
|
||||||
|
try {
|
||||||
|
BufferedReader br = new BufferedReader(new FileReader(logFile));
|
||||||
|
String line;
|
||||||
|
|
||||||
|
while ((line = br.readLine()) != null) {
|
||||||
|
text.append(line);
|
||||||
|
text.append('\n');
|
||||||
|
}
|
||||||
|
br.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
//You'll need to add proper error handling here
|
||||||
|
}
|
||||||
|
|
||||||
|
return text.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -739,12 +739,12 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
public void addExtraItem() {
|
public void addExtraItem() {
|
||||||
handler.post(() -> {
|
handler.post(() -> {
|
||||||
DialogScanArtView
|
DialogScanArtView
|
||||||
.newInstance(!mEnableFakeGiacenza, (status, mtbAart, ean128Model, mtbColr) -> {
|
.newInstance(!mEnableFakeGiacenza, (status, mtbAart, ean128Model, mtbColt) -> {
|
||||||
if (status == DialogConsts.Results.YES) {
|
if (status == DialogConsts.Results.YES) {
|
||||||
|
|
||||||
executorService.execute(() -> {
|
executorService.execute(() -> {
|
||||||
try {
|
try {
|
||||||
this.mViewmodel.dispatchExtraItem(mtbAart, ean128Model, mtbColr);
|
this.mViewmodel.dispatchExtraItem(mtbAart, ean128Model, mtbColt);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
onError(e);
|
onError(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1224,7 +1224,7 @@ public class SpedizioneViewModel {
|
|||||||
return !stati.isEmpty() ? stati.get(0) : null;
|
return !stati.isEmpty() ? stati.get(0) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dispatchExtraItem(MtbAart mtbAart, Ean128Model ean128Model, MtbColr mtbColrToUse) throws Exception {
|
public void dispatchExtraItem(MtbAart mtbAart, Ean128Model ean128Model, MtbColt refMtbColt) throws Exception {
|
||||||
|
|
||||||
PickingObjectDTO pickingObjectDTO = new PickingObjectDTO().setMtbAart(mtbAart).setTempPickData(PickDataDTO.fromEan128(ean128Model));
|
PickingObjectDTO pickingObjectDTO = new PickingObjectDTO().setMtbAart(mtbAart).setTempPickData(PickDataDTO.fromEan128(ean128Model));
|
||||||
|
|
||||||
@@ -1243,12 +1243,23 @@ public class SpedizioneViewModel {
|
|||||||
String partitaMag = null;
|
String partitaMag = null;
|
||||||
LocalDate dataScad = null;
|
LocalDate dataScad = null;
|
||||||
|
|
||||||
MtbColt refMtbColt = null;
|
// MtbColt refMtbColt = null;
|
||||||
|
|
||||||
if (mtbColrToUse != null) {
|
if (refMtbColt != null && refMtbColt.getMtbColr() != null && !refMtbColt.getMtbColr().isEmpty()) {
|
||||||
refMtbColt = new MtbColt().setDataCollo(mtbColrToUse.getDataColloD()).setSerCollo(mtbColrToUse.getSerCollo()).setNumCollo(mtbColrToUse.getNumCollo()).setGestione(mtbColrToUse.getGestione()).setMtbColr(new ObservableArrayList<>());
|
MtbColr mtbColrToUse = refMtbColt.getMtbColr().get(0);
|
||||||
|
|
||||||
refMtbColt.getMtbColr().add(mtbColrToUse);
|
//Se il collo di riferimento non ha righe, lo creo al volo
|
||||||
|
// refMtbColt = new MtbColt()
|
||||||
|
// .setDataCollo(mtbColrToUse.getDataColloD())
|
||||||
|
// .setSerCollo(mtbColrToUse.getSerCollo())
|
||||||
|
// .setNumCollo(mtbColrToUse.getNumCollo())
|
||||||
|
// .setGestione(mtbColrToUse.getGestione())
|
||||||
|
//// .setCodMdep(mtbColrToUse.getCodMdepIn())
|
||||||
|
//// .setPosizione(mtbColrToUse.getPosizioneIn())
|
||||||
|
//// .setBarcodeUl(mtbColrToUse.getBarcodeUlIn())
|
||||||
|
// .setMtbColr(new ObservableArrayList<>());
|
||||||
|
//
|
||||||
|
// refMtbColt.getMtbColr().add(mtbColrToUse);
|
||||||
|
|
||||||
pickingObjectDTO.setMtbAart(mtbColrToUse.getMtbAart()).setTempPickData(new PickDataDTO().setSourceMtbColt(refMtbColt));
|
pickingObjectDTO.setMtbAart(mtbColrToUse.getMtbAart()).setTempPickData(new PickDataDTO().setSourceMtbColt(refMtbColt));
|
||||||
|
|
||||||
@@ -1521,9 +1532,6 @@ public class SpedizioneViewModel {
|
|||||||
.setMtbAart(null);
|
.setMtbAart(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
var clonedTargetMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
|
||||||
clonedTargetMtbColt.setMtbColr(null);
|
|
||||||
|
|
||||||
var insertUDSRowRequestDto = new InsertUDSRowRequestDTO()
|
var insertUDSRowRequestDto = new InsertUDSRowRequestDTO()
|
||||||
.setSourceMtbColr(clonedSourceMtbColr)
|
.setSourceMtbColr(clonedSourceMtbColr)
|
||||||
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
|
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
|
||||||
@@ -1531,7 +1539,7 @@ public class SpedizioneViewModel {
|
|||||||
.setQtaCnf(qtaCnf)
|
.setQtaCnf(qtaCnf)
|
||||||
.setNumCnf(numCnf)
|
.setNumCnf(numCnf)
|
||||||
.setPartitaMag(partitaMag)
|
.setPartitaMag(partitaMag)
|
||||||
.setTargetMtbColt(clonedTargetMtbColt);
|
.setTargetMtbColt(mCurrentMtbColt.clone(false));
|
||||||
|
|
||||||
if (dataScad != null)
|
if (dataScad != null)
|
||||||
insertUDSRowRequestDto
|
insertUDSRowRequestDto
|
||||||
@@ -1546,6 +1554,7 @@ public class SpedizioneViewModel {
|
|||||||
createdMtbColr = this.mColliScaricoRESTConsumer.insertUDSRowSynchronized(insertUDSRowRequestDto);
|
createdMtbColr = this.mColliScaricoRESTConsumer.insertUDSRowSynchronized(insertUDSRowRequestDto);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
this.sendError(ex);
|
this.sendError(ex);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pickingObjectDTO.getWithdrawMtbColrs().add(createdMtbColr);
|
pickingObjectDTO.getWithdrawMtbColrs().add(createdMtbColr);
|
||||||
@@ -2115,18 +2124,18 @@ public class SpedizioneViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void closeOrder() {
|
public void closeOrder() {
|
||||||
this.sendOnLoadingStarted();
|
|
||||||
|
|
||||||
if (SettingsManager.iDB().isFlagPrintEtichetteOnOrderClose() || SettingsManager.iDB().isFlagPrintPackingListOnOrderClose()) {
|
if (SettingsManager.iDB().isFlagPrintEtichetteOnOrderClose() || SettingsManager.iDB().isFlagPrintPackingListOnOrderClose()) {
|
||||||
var printRequestResult = this.sendOnCloseOrderPrintRequest();
|
var printRequestResult = this.sendOnCloseOrderPrintRequest();
|
||||||
|
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
this.onCloseOrderPrintRequested(printRequestResult);
|
this.onCloseOrderPrintRequested(printRequestResult);
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.mIsOrdTrasf && !UtilityString.isNullOrEmpty(SettingsManager.iDB().getCodDtipOrdTrasfV())) {
|
if (this.mIsOrdTrasf && !UtilityString.isNullOrEmpty(SettingsManager.iDB().getCodDtipOrdTrasfV())) {
|
||||||
this.sendCreateDocsRequest();
|
this.sendCreateDocsRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sendOnOrderClosed();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onCloseOrderPrintRequested(PrintOrderCloseDTO dto) {
|
private void onCloseOrderPrintRequested(PrintOrderCloseDTO dto) {
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
package it.integry.integrywmsnative.view.dialogs.ask_cliente.dto;
|
package it.integry.integrywmsnative.view.dialogs.ask_cliente.dto;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class DialogAskClienteClienteDTO {
|
public class DialogAskClienteClienteDTO {
|
||||||
|
|
||||||
|
@SerializedName("codAnag")
|
||||||
private String codAnag;
|
private String codAnag;
|
||||||
|
|
||||||
|
@SerializedName("ragSoc")
|
||||||
private String ragSoc;
|
private String ragSoc;
|
||||||
|
@SerializedName("codJcoms")
|
||||||
private ArrayList<String> codJcoms = new ArrayList<>();
|
private ArrayList<String> codJcoms = new ArrayList<>();
|
||||||
|
|
||||||
public String getCodAnag() {
|
public String getCodAnag() {
|
||||||
|
|||||||
@@ -1,23 +1,34 @@
|
|||||||
package it.integry.integrywmsnative.view.dialogs.ask_cliente.dto;
|
package it.integry.integrywmsnative.view.dialogs.ask_cliente.dto;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.VtbDest;
|
import it.integry.integrywmsnative.core.model.VtbDest;
|
||||||
|
|
||||||
public class DialogAskClienteDestinatarioDTO {
|
public class DialogAskClienteDestinatarioDTO {
|
||||||
|
|
||||||
|
|
||||||
|
@SerializedName("codAnag")
|
||||||
private String codAnag;
|
private String codAnag;
|
||||||
|
|
||||||
|
@SerializedName("codVdes")
|
||||||
private String codVdes;
|
private String codVdes;
|
||||||
|
|
||||||
|
@SerializedName("destinatario")
|
||||||
private String destinatario;
|
private String destinatario;
|
||||||
|
|
||||||
|
@SerializedName("indirizzo")
|
||||||
private String indirizzo;
|
private String indirizzo;
|
||||||
|
|
||||||
|
@SerializedName("cap")
|
||||||
private String cap;
|
private String cap;
|
||||||
|
|
||||||
|
@SerializedName("citta")
|
||||||
private String citta;
|
private String citta;
|
||||||
|
|
||||||
|
@SerializedName("prov")
|
||||||
private String prov;
|
private String prov;
|
||||||
|
|
||||||
|
@SerializedName("nazione")
|
||||||
private String nazione;
|
private String nazione;
|
||||||
|
|
||||||
public String getCodAnag() {
|
public String getCodAnag() {
|
||||||
|
|||||||
@@ -4,15 +4,19 @@ import android.app.Dialog;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
|
|
||||||
|
import org.javatuples.Quartet;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@@ -27,6 +31,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgssss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgssss;
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||||
import it.integry.integrywmsnative.databinding.DialogScanArtBinding;
|
import it.integry.integrywmsnative.databinding.DialogScanArtBinding;
|
||||||
@@ -38,6 +43,9 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
|
|||||||
@Inject
|
@Inject
|
||||||
DialogScanArtViewModel mViewModel;
|
DialogScanArtViewModel mViewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
Handler handler;
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
|
||||||
private final boolean mForceOnlyUL;
|
private final boolean mForceOnlyUL;
|
||||||
@@ -46,15 +54,15 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
|
|||||||
|
|
||||||
private int mBarcodeScannerInstanceID;
|
private int mBarcodeScannerInstanceID;
|
||||||
|
|
||||||
private RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColr> onPickingCompleted = null;
|
private RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> onPickingCompleted = null;
|
||||||
private RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest = null;
|
private RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest = null;
|
||||||
|
|
||||||
|
|
||||||
public static DialogScanArtView newInstance(boolean forceOnlyUL, @NotNull RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColr> onPickingCompleted, RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest) {
|
public static DialogScanArtView newInstance(boolean forceOnlyUL, @NotNull RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> onPickingCompleted, RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest) {
|
||||||
return new DialogScanArtView(forceOnlyUL, onPickingCompleted, onMagazzinoAutomaticoPickingRequest);
|
return new DialogScanArtView(forceOnlyUL, onPickingCompleted, onMagazzinoAutomaticoPickingRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DialogScanArtView(boolean forceOnlyUL, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColr> onItemChoosed, RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest) {
|
private DialogScanArtView(boolean forceOnlyUL, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> onItemChoosed, RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
mForceOnlyUL = forceOnlyUL;
|
mForceOnlyUL = forceOnlyUL;
|
||||||
@@ -122,37 +130,60 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
|
|||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||||
this.onLoadingStarted();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, (status, mtbAart, ean128Model, mtbColrList) -> {
|
executorService.execute(() -> {
|
||||||
|
|
||||||
var filteredMtbColrList = mtbColrList;
|
try {
|
||||||
|
|
||||||
if (mtbAart != null && filteredMtbColrList != null) {
|
Quartet<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> result = this.mViewModel.processBarcodeDTO(data, pickMagazzinoAutomaticoPosizione -> {
|
||||||
filteredMtbColrList = filteredMtbColrList.stream()
|
handler.post(() -> {
|
||||||
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbAart.getCodMart()))
|
this.onMagazzinoAutomaticoPickingRequest.run(pickMagazzinoAutomaticoPosizione);
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
this.onLoadingEnded();
|
||||||
|
dismiss();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
var status = result.getValue0();
|
||||||
|
var mtbAart = result.getValue1();
|
||||||
|
var ean128Model = result.getValue2();
|
||||||
|
var mtbColt = result.getValue3();
|
||||||
|
|
||||||
|
List<MtbColr> filteredMtbColrList = mtbColt.getMtbColr();
|
||||||
|
|
||||||
|
if (mtbAart != null && filteredMtbColrList != null) {
|
||||||
|
filteredMtbColrList = filteredMtbColrList.stream()
|
||||||
|
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbAart.getCodMart()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
List<MtbColr> finalFilteredMtbColrList = filteredMtbColrList;
|
||||||
|
handler.post(() -> {
|
||||||
|
if (finalFilteredMtbColrList != null && finalFilteredMtbColrList.size() > 1) {
|
||||||
|
DialogChooseArtFromListaMtbColrView.make(getActivity(), finalFilteredMtbColrList, mtbColrChose -> {
|
||||||
|
|
||||||
|
mtbColt.setMtbColr(new ObservableArrayList<>());
|
||||||
|
mtbColt.getMtbColr().add(mtbColrChose);
|
||||||
|
onPickingCompleted.run(status, mtbAart, ean128Model, mtbColt);
|
||||||
|
}).show();
|
||||||
|
|
||||||
|
} else if (finalFilteredMtbColrList != null && finalFilteredMtbColrList.size() == 1) {
|
||||||
|
mtbColt.setMtbColr(new ObservableArrayList<>());
|
||||||
|
mtbColt.getMtbColr().add(finalFilteredMtbColrList.get(0));
|
||||||
|
onPickingCompleted.run(status, mtbAart, ean128Model, mtbColt);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
onPickingCompleted.run(status, mtbAart, ean128Model, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.onLoadingEnded();
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
});
|
||||||
|
} catch (Exception ex) {
|
||||||
|
onError(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filteredMtbColrList != null && filteredMtbColrList.size() > 1) {
|
|
||||||
DialogChooseArtFromListaMtbColrView.make(getActivity(), filteredMtbColrList, mtbColrChose -> {
|
|
||||||
onPickingCompleted.run(status, mtbAart, ean128Model, mtbColrChose);
|
|
||||||
}).show();
|
|
||||||
|
|
||||||
} else if (filteredMtbColrList != null && filteredMtbColrList.size() == 1) {
|
|
||||||
onPickingCompleted.run(status, mtbAart, ean128Model, filteredMtbColrList.get(0));
|
|
||||||
|
|
||||||
} else {
|
|
||||||
onPickingCompleted.run(status, mtbAart, ean128Model, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
this.onLoadingEnded();
|
|
||||||
|
|
||||||
dismiss();
|
|
||||||
}, pickMagazzinoAutomaticoPosizione -> {
|
|
||||||
this.onMagazzinoAutomaticoPickingRequest.run(pickMagazzinoAutomaticoPosizione);
|
|
||||||
|
|
||||||
this.onLoadingEnded();
|
|
||||||
dismiss();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,17 @@
|
|||||||
package it.integry.integrywmsnative.view.dialogs.scan_art;
|
package it.integry.integrywmsnative.view.dialogs.scan_art;
|
||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import org.javatuples.Quartet;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
import it.integry.integrywmsnative.core.exception.EmptyLUException;
|
|
||||||
import it.integry.integrywmsnative.core.exception.InvalidLUException;
|
import it.integry.integrywmsnative.core.exception.InvalidLUException;
|
||||||
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
|
||||||
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||||
import it.integry.integrywmsnative.core.exception.ScannedPositionNotExistException;
|
import it.integry.integrywmsnative.core.exception.ScannedPositionNotExistException;
|
||||||
import it.integry.integrywmsnative.core.exception.TooManyLUFoundInMonoLUPositionException;
|
import it.integry.integrywmsnative.core.exception.TooManyLUFoundInMonoLUPositionException;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgssss;
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
|
||||||
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;
|
||||||
@@ -62,23 +57,23 @@ public class DialogScanArtViewModel {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onPickingCompleted, RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest) {
|
public Quartet<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest) throws Exception {
|
||||||
if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||||
//Cerco gli articoli presenti nell'ul dell'etichetta anonima
|
//Cerco gli articoli presenti nell'ul dell'etichetta anonima
|
||||||
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), onPickingCompleted);
|
return this.executeEtichettaLU(barcodeScanDTO.getStringValue());
|
||||||
|
|
||||||
} else if (UtilityBarcode.isEtichettaPosizione(barcodeScanDTO)) {
|
} else if (UtilityBarcode.isEtichettaPosizione(barcodeScanDTO)) {
|
||||||
//Cerco l'UL presente all'interno della posizione
|
//Cerco l'UL presente all'interno della posizione
|
||||||
this.executeEtichettaPosizione(barcodeScanDTO.getStringValue(), onPickingCompleted, onMagazzinoAutomaticoPickingRequest);
|
return this.executeEtichettaPosizione(barcodeScanDTO.getStringValue(), onMagazzinoAutomaticoPickingRequest);
|
||||||
|
|
||||||
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||||
this.executeEtichettaEan128(barcodeScanDTO, onPickingCompleted);
|
return this.executeEtichettaEan128(barcodeScanDTO);
|
||||||
|
|
||||||
} else if (UtilityBarcode.isEanPeso(barcodeScanDTO) && !mForceOnlyUL) {
|
} else if (UtilityBarcode.isEanPeso(barcodeScanDTO) && !mForceOnlyUL) {
|
||||||
this.executeEtichettaEanPeso(barcodeScanDTO, onPickingCompleted);
|
return this.executeEtichettaEanPeso(barcodeScanDTO);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.loadArticolo(barcodeScanDTO.getStringValue(), null, onPickingCompleted);
|
return this.loadArticolo(barcodeScanDTO.getStringValue(), null);
|
||||||
|
|
||||||
}
|
}
|
||||||
// else {
|
// else {
|
||||||
@@ -87,123 +82,108 @@ public class DialogScanArtViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private Quartet<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO) throws Exception {
|
||||||
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
|
var ean128Model = this.mBarcodeRESTConsumer.decodeEan128Synchronized(barcodeScanDTO);
|
||||||
this.mBarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
|
||||||
|
|
||||||
String barcodeProd = null;
|
|
||||||
|
|
||||||
if (ean128Model.Sscc != null) barcodeProd = ean128Model.Sscc;
|
|
||||||
if (ean128Model.Gtin != null) barcodeProd = ean128Model.Gtin;
|
|
||||||
if (ean128Model.Content != null) barcodeProd = ean128Model.Content;
|
|
||||||
|
|
||||||
|
|
||||||
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
|
String barcodeProd = null;
|
||||||
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
|
|
||||||
this.executeEtichettaLU(ean128Model.Sscc, onComplete);
|
if (ean128Model.Sscc != null) barcodeProd = ean128Model.Sscc;
|
||||||
} else if (!mForceOnlyUL) {
|
if (ean128Model.Gtin != null) barcodeProd = ean128Model.Gtin;
|
||||||
|
if (ean128Model.Content != null) barcodeProd = ean128Model.Content;
|
||||||
|
|
||||||
|
|
||||||
|
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||||
|
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
|
||||||
|
return this.executeEtichettaLU(ean128Model.Sscc);
|
||||||
|
|
||||||
|
} else if (!mForceOnlyUL) {
|
||||||
|
return this.loadArticolo(barcodeProd, ean128Model);
|
||||||
|
|
||||||
this.loadArticolo(barcodeProd, ean128Model, onComplete);
|
|
||||||
} else {
|
|
||||||
this.sendError(new Exception("Barcode non valido"));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
|
throw new Exception("Barcode non valido");
|
||||||
this.sendError(new NoResultFromBarcodeException(barcodeProd));
|
|
||||||
}
|
}
|
||||||
}, this::sendError);
|
} else {
|
||||||
}
|
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
|
||||||
|
throw new NoResultFromBarcodeException(barcodeProd);
|
||||||
private void executeEtichettaEanPeso(BarcodeScanDTO barcodeScanDTO, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
|
|
||||||
|
|
||||||
try {
|
|
||||||
Ean13PesoModel ean13PesoModel = Ean13PesoModel.fromBarcode(barcodeScanDTO.getStringValue());
|
|
||||||
|
|
||||||
this.loadArticolo(ean13PesoModel.getPrecode(), ean13PesoModel.toEan128(), onComplete);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
this.sendError(ex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Quartet<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> executeEtichettaEanPeso(BarcodeScanDTO barcodeScanDTO) throws Exception {
|
||||||
|
Ean13PesoModel ean13PesoModel = Ean13PesoModel.fromBarcode(barcodeScanDTO.getStringValue());
|
||||||
|
|
||||||
private void executeEtichettaLU(String SSCC, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
|
return this.loadArticolo(ean13PesoModel.getPrecode(), ean13PesoModel.toEan128());
|
||||||
mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
|
||||||
|
|
||||||
if (mtbColt != null && mtbColt.getMtbColr() != null && !mtbColt.getMtbColr().isEmpty()) {
|
|
||||||
if (mtbColt.getSegno() != -1) {
|
|
||||||
onComplete.run(DialogConsts.Results.YES, null, null, mtbColt.getMtbColr());
|
|
||||||
} else this.sendError(new InvalidLUException());
|
|
||||||
} else {
|
|
||||||
this.sendError(new EmptyLUException());
|
|
||||||
}
|
|
||||||
|
|
||||||
}, this::sendError);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private Quartet<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> executeEtichettaLU(String SSCC) throws Exception {
|
||||||
|
var mtbColt = mColliMagazzinoRESTConsumer.getBySsccSynchronized(SSCC, true, false);
|
||||||
|
|
||||||
private void executeEtichettaPosizione(String stringValue, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete, RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest) {
|
if (mtbColt == null || mtbColt.getMtbColr() == null || mtbColt.getMtbColr().isEmpty())
|
||||||
MtbDepoPosizione foundPosizione = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
|
throw new NoLUFoundException();
|
||||||
|
|
||||||
|
if (mtbColt.getSegno() == -1) throw new InvalidLUException();
|
||||||
|
|
||||||
|
return new Quartet<>(DialogConsts.Results.YES, null, null, mtbColt);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private Quartet<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> executeEtichettaPosizione(String stringValue, RunnableArgs<MtbDepoPosizione> onMagazzinoAutomaticoPickingRequest) throws Exception {
|
||||||
|
MtbDepoPosizione foundPosizione = SettingsManager.iDB().getAvailablePosizioni().stream()
|
||||||
.filter(x -> x.getPosizione().equalsIgnoreCase(stringValue))
|
.filter(x -> x.getPosizione().equalsIgnoreCase(stringValue))
|
||||||
.single();
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
|
||||||
if (foundPosizione == null) {
|
if (foundPosizione == null)
|
||||||
//Nessuna posizione trovata con questo barcode
|
//Nessuna posizione trovata con questo barcode
|
||||||
this.sendError(new ScannedPositionNotExistException());
|
throw new ScannedPositionNotExistException();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (foundPosizione.isMagazzinoAutomatico()) {
|
if (foundPosizione.isMagazzinoAutomatico()) {
|
||||||
//Eseguo picking da magazzino automatico
|
//Eseguo picking da magazzino automatico
|
||||||
onMagazzinoAutomaticoPickingRequest.run(foundPosizione);
|
onMagazzinoAutomaticoPickingRequest.run(foundPosizione);
|
||||||
} else {
|
} else {
|
||||||
this.executePosizione(foundPosizione, null, onComplete);
|
return this.executePosizione(foundPosizione, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void executePosizione(MtbDepoPosizione posizione, MtbAart articolo, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
|
private Quartet<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> executePosizione(MtbDepoPosizione posizione, MtbAart articolo) throws Exception {
|
||||||
this.mPosizioniRESTConsumer.getBancaliInPosizione(posizione, mtbColtList -> {
|
var mtbColtList = this.mPosizioniRESTConsumer.getBancaliInPosizioneSynchronized(posizione);
|
||||||
|
|
||||||
if (mtbColtList == null || mtbColtList.isEmpty()) {
|
if (mtbColtList == null || mtbColtList.isEmpty())
|
||||||
this.sendError(new NoLUFoundException());
|
throw new NoLUFoundException();
|
||||||
} else if (mtbColtList.size() == 1) {
|
|
||||||
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
|
||||||
onComplete.run(DialogConsts.Results.YES, articolo, null, mtbColt.getMtbColr());
|
|
||||||
}, this::sendError);
|
|
||||||
} else {
|
|
||||||
this.sendError(new TooManyLUFoundInMonoLUPositionException());
|
|
||||||
}
|
|
||||||
|
|
||||||
}, this::sendError);
|
if (mtbColtList.size() != 1) {
|
||||||
|
throw new TooManyLUFoundInMonoLUPositionException();
|
||||||
|
}
|
||||||
|
|
||||||
|
var mtbColt = this.mColliMagazzinoRESTConsumer.getByTestataSynchronized(mtbColtList.get(0), true, false);
|
||||||
|
return new Quartet<>(DialogConsts.Results.YES, articolo, null, mtbColt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void loadArticolo(@NotNull String barcodeProd, Ean128Model ean128Model, RunnableArgssss<DialogConsts.Results, MtbAart, Ean128Model, List<MtbColr>> onComplete) {
|
private Quartet<DialogConsts.Results, MtbAart, Ean128Model, MtbColt> loadArticolo(@NotNull String barcodeProd, Ean128Model ean128Model) throws Exception {
|
||||||
this.mArticoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
|
var mtbAartList = this.mArticoloRESTConsumer.searchByBarcodeSynchronized(barcodeProd);
|
||||||
if (mtbAartList != null && !mtbAartList.isEmpty()) {
|
|
||||||
|
|
||||||
MtbAart firstArt = mtbAartList.get(0);
|
if (mtbAartList == null || mtbAartList.isEmpty())
|
||||||
MtbDepoPosizione firstArtPosition = UtilityPosizione.getFromCache(firstArt.getPosizione());
|
throw new NoResultFromBarcodeException(barcodeProd);
|
||||||
|
|
||||||
if (firstArtPosition != null && firstArtPosition.isFlagMonoCollo() && mForceOnlyUL) {
|
MtbAart firstArt = mtbAartList.get(0);
|
||||||
this.executePosizione(firstArtPosition, firstArt, onComplete);
|
MtbDepoPosizione firstArtPosition = UtilityPosizione.getFromCache(firstArt.getPosizione());
|
||||||
} else if (!mForceOnlyUL) {
|
|
||||||
onComplete.run(DialogConsts.Results.YES, mtbAartList.get(0), ean128Model, null);
|
|
||||||
} else {
|
|
||||||
this.sendError(new NoResultFromBarcodeException(barcodeProd));
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
if (firstArtPosition != null && firstArtPosition.isFlagMonoCollo() && mForceOnlyUL)
|
||||||
this.sendError(new NoResultFromBarcodeException(barcodeProd));
|
return this.executePosizione(firstArtPosition, firstArt);
|
||||||
}
|
|
||||||
}, this::sendError);
|
if (!mForceOnlyUL)
|
||||||
|
return new Quartet<>(DialogConsts.Results.YES, mtbAartList.get(0), ean128Model, null);
|
||||||
|
|
||||||
|
throw new NoResultFromBarcodeException(barcodeProd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void sendError(Exception ex) {
|
|
||||||
if (this.mListener != null) mListener.onError(ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setListener(Listener listener) {
|
public void setListener(Listener listener) {
|
||||||
this.mListener = listener;
|
this.mListener = listener;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,23 @@ package it.integry.integrywmsnative.view.dialogs.tracciamento_imballi;
|
|||||||
|
|
||||||
import androidx.databinding.ObservableBoolean;
|
import androidx.databinding.ObservableBoolean;
|
||||||
import androidx.databinding.ObservableField;
|
import androidx.databinding.ObservableField;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
public class TracciamentoImballoDTO {
|
public class TracciamentoImballoDTO {
|
||||||
|
|
||||||
|
@SerializedName("codTcol")
|
||||||
private final ObservableField<String> codTcol = new ObservableField<>();
|
private final ObservableField<String> codTcol = new ObservableField<>();
|
||||||
|
|
||||||
|
@SerializedName("descrizione")
|
||||||
private final ObservableField<String> descrizione = new ObservableField<>();
|
private final ObservableField<String> descrizione = new ObservableField<>();
|
||||||
|
|
||||||
|
@SerializedName("codMart")
|
||||||
private final ObservableField<String> codMart = new ObservableField<>();
|
private final ObservableField<String> codMart = new ObservableField<>();
|
||||||
|
|
||||||
|
@SerializedName("qta")
|
||||||
private final ObservableField<Integer> qta = new ObservableField<>();
|
private final ObservableField<Integer> qta = new ObservableField<>();
|
||||||
|
|
||||||
|
@SerializedName("editable")
|
||||||
private final ObservableBoolean editable = new ObservableBoolean(true);
|
private final ObservableBoolean editable = new ObservableBoolean(true);
|
||||||
|
|
||||||
public ObservableField<String> getCodTcol() {
|
public ObservableField<String> getCodTcol() {
|
||||||
|
|||||||
@@ -6,6 +6,9 @@
|
|||||||
<variable
|
<variable
|
||||||
name="view"
|
name="view"
|
||||||
type="it.integry.integrywmsnative.gest.main.MainFragment" />
|
type="it.integry.integrywmsnative.gest.main.MainFragment" />
|
||||||
|
|
||||||
|
<import type="android.view.View" />
|
||||||
|
<import type="it.integry.integrywmsnative.core.settings.SettingsManager" />
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
@@ -137,6 +140,7 @@
|
|||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
|
android:visibility="@{SettingsManager.iDB().isFlagForceAllToColli() ? View.VISIBLE : View.GONE}"
|
||||||
android:onClick="@{() -> view.changeUserDepo()}"
|
android:onClick="@{() -> view.changeUserDepo()}"
|
||||||
android:src="@drawable/ic_rounded_change_circle_24"
|
android:src="@drawable/ic_rounded_change_circle_24"
|
||||||
android:tint="@android:color/white" />
|
android:tint="@android:color/white" />
|
||||||
|
|||||||
@@ -18,13 +18,23 @@
|
|||||||
tools:context=".gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment">
|
tools:context=".gest.prod_recupero_materiale.ProdRecuperoMaterialeFragment">
|
||||||
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:background="@android:color/white"
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
android:id="@+id/prod_recupero_materiale_main_list"
|
android:id="@+id/swiperefresh"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
android:layout_alignParentBottom="true"
|
||||||
tools:listitem="@layout/prod_recupero_materiale_list_item"/>
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/prod_recupero_materiale_main_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@android:color/white"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
|
tools:listitem="@layout/prod_recupero_materiale_list_item" />
|
||||||
|
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/empty_view"
|
android:id="@+id/empty_view"
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom|end"
|
android:layout_gravity="bottom|end"
|
||||||
android:layout_margin="16dp"
|
android:layout_margin="16dp"
|
||||||
app:singleClick="@{() -> view.saveAndClose()}"
|
app:singleClick="@{() -> view.Close()}"
|
||||||
app:srcCompat="@drawable/ic_round_check_24"
|
app:srcCompat="@drawable/ic_round_check_24"
|
||||||
app:visibilityWhenNotNull="@{viewModel.currentVerifica}" />
|
app:visibilityWhenNotNull="@{viewModel.currentVerifica}" />
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk 35
|
compileSdk 36
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdk 35
|
targetSdk 36
|
||||||
|
|
||||||
consumerProguardFiles 'consumer-rules.pro'
|
consumerProguardFiles 'consumer-rules.pro'
|
||||||
}
|
}
|
||||||
@@ -36,5 +36,5 @@ configurations {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
implementation 'androidx.appcompat:appcompat:1.7.1'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
kotlin_version = '2.1.0'
|
kotlin_version = '2.1.0'
|
||||||
agp_version = '8.10.0'
|
agp_version = '8.13.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk 35
|
compileSdk 36
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdk 35
|
targetSdk 36
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
@@ -38,6 +38,6 @@ dependencies {
|
|||||||
// implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
// implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||||
|
|
||||||
implementation project(":honeywellsdk")
|
implementation project(":honeywellsdk")
|
||||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
implementation 'androidx.appcompat:appcompat:1.7.1'
|
||||||
implementation project(path: ':barcode_base_android_library')
|
implementation project(path: ':barcode_base_android_library')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk 35
|
compileSdk 36
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdk 35
|
targetSdk 36
|
||||||
|
|
||||||
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
consumerProguardFiles 'consumer-rules.pro'
|
consumerProguardFiles 'consumer-rules.pro'
|
||||||
@@ -37,6 +37,6 @@ configurations {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
implementation 'androidx.appcompat:appcompat:1.7.1'
|
||||||
implementation project(':barcode_base_android_library')
|
implementation project(':barcode_base_android_library')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk 35
|
compileSdk 36
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdk 35
|
targetSdk 36
|
||||||
|
|
||||||
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
@@ -35,6 +35,6 @@ configurations {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
implementation 'androidx.appcompat:appcompat:1.7.1'
|
||||||
implementation project(':barcode_base_android_library')
|
implementation project(':barcode_base_android_library')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk 35
|
compileSdk 36
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdk 35
|
targetSdk 36
|
||||||
|
|
||||||
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
// testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ dependencies {
|
|||||||
|
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
implementation 'androidx.appcompat:appcompat:1.7.1'
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
implementation project(path: ':barcode_base_android_library')
|
implementation project(path: ':barcode_base_android_library')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user