Compare commits

...

95 Commits

Author SHA1 Message Date
65cfadcb6e Finish v1.46.18(506)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-05-28 12:29:40 +02:00
73ca8bb366 -> v1.46.18 (506) 2025-05-28 12:29:36 +02:00
3ffdb2c220 Fix AuthInterceptor 2025-05-28 12:28:13 +02:00
a5479595c7 Aggiornato build.gradle
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 12:24:24 +02:00
cff971bef8 Merge branch 'master' into develop
# Conflicts:
#	Jenkinsfile.groovy
2025-05-28 11:47:20 +02:00
a5d3388665 Aggiornato build.gradle
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-05-28 11:45:51 +02:00
22ad23c5b7 Aggiornato build.gradle
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 11:44:41 +02:00
b1d5e10db4 Aggiornato build.gradle 2025-05-28 11:32:35 +02:00
bde41d21be Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head Something is wrong with the build of this commit
2025-05-28 11:26:12 +02:00
9d8228419c Modificato Jenkinsfile
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-05-28 11:25:14 +02:00
ad7d9059c0 Modificato Jenkinsfile
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-05-28 11:19:57 +02:00
4831a7ce19 Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 11:19:10 +02:00
552b82feda Modificato Jenkinsfile
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-05-28 11:10:39 +02:00
6d62a7b10e Modificato Jenkinsfile
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
2025-05-28 10:57:42 +02:00
667f4aea74 Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 10:53:55 +02:00
f80225b7bf Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 10:47:00 +02:00
7a02e1d8ad Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 10:46:25 +02:00
9cc70f4ee6 Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 10:42:51 +02:00
7c4c5da1d6 Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 10:41:32 +02:00
b960b6319a Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 10:40:47 +02:00
08ddaa7a11 Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 10:39:56 +02:00
bcce40094c Modificato Jenkinsfile
Some checks failed
WMS - Android (New)/pipeline/head There was a failure building this commit
2025-05-28 10:33:59 +02:00
960388adf8 Modificato Jenkinsfile 2025-05-28 10:31:48 +02:00
e76722018f Fix AuthInterceptor in caso di AccessToken nullo 2025-05-28 10:30:19 +02:00
fc30017021 Finish v1.46.17(505) 2025-05-28 10:18:03 +02:00
e1dd4f2140 Finish v1.46.17(505) 2025-05-28 10:18:03 +02:00
67a0679de7 -> v1.46.17 (505) 2025-05-28 10:17:58 +02:00
dfc87f7aec Fix AuthInterceptor in caso di AccessToken nullo 2025-05-28 10:17:09 +02:00
886ef6ba08 Finish v1.46.16(504) 2025-05-27 18:44:03 +02:00
fe77f90a7a Finish v1.46.16(504) 2025-05-27 18:44:02 +02:00
7a1f0d6cf6 -> v1.46.16 (504) 2025-05-27 18:43:56 +02:00
004bc3b926 Migliorie sulla gestione dell'access token nell'interceptor e durante il refresh.
Migliorie al loading popup durante il chiudi ordine in spedizione.
2025-05-27 18:43:01 +02:00
be5ebb89d7 Finish v1.46.15(503) 2025-05-27 17:48:12 +02:00
5a0b45c6f9 Finish v1.46.15(503) 2025-05-27 17:48:12 +02:00
f81d61c4c5 -> v1.46.15 (503) 2025-05-27 17:47:59 +02:00
634bc502ce Fix null dovuto alla getBancaliGiaRegistratiSynchronized 2025-05-27 17:45:24 +02:00
d13dbf1ad3 Finish v1.46.14(502) 2025-05-26 09:44:01 +02:00
2f9ee642da Finish v1.46.14(502) 2025-05-26 09:44:00 +02:00
afecc11364 -> v1.46.14 (502) 2025-05-26 09:43:55 +02:00
b33d566abd Implementato servizio di retrieve uds già registrate 2025-05-20 15:25:48 +02:00
69d880b587 Finish v1.46.13(501) 2025-05-15 18:30:56 +02:00
aeadea42e1 Finish v1.46.13(501) 2025-05-15 18:30:56 +02:00
f5c3dcfdc9 -> v1.46.13 (501) 2025-05-15 18:30:52 +02:00
d30af1e2a6 In VerificaGiacenze abilitato OverflowOrderQuantity 2025-05-15 12:53:12 +02:00
71a18e9ffa Fix scansione barcode alternativi in VerificaGiacenze 2025-05-15 12:52:42 +02:00
40e1fb4f83 Finish v1.46.12(500) 2025-05-14 12:05:35 +02:00
f3f0fd8fd8 Finish v1.46.12(500) 2025-05-14 12:05:35 +02:00
ed53b9e3b4 -> v1.46.12 (500) 2025-05-14 12:05:30 +02:00
37ac05b8ab Aggiornato gradle e librerie 2025-05-14 12:04:49 +02:00
823d0d7a33 Finish v1.46.11(499) 2025-05-07 12:01:10 +02:00
5b07ff5efa Finish v1.46.11(499) 2025-05-07 12:01:09 +02:00
c5639a643a -> v1.46.11 (499) 2025-05-07 12:01:00 +02:00
012f75198b Fix null sitArts 2025-05-07 12:00:17 +02:00
d7e0e858d2 Finish v1.46.10(498) 2025-05-05 17:00:41 +02:00
339a5e5b68 Finish v1.46.10(498) 2025-05-05 17:00:40 +02:00
02a13911d8 -> v1.46.10 (498) 2025-05-05 17:00:34 +02:00
b6f51971f1 Fix su DialogChooseArtFromListaArts 2025-05-05 16:59:43 +02:00
57079c0062 Finish v1.46.09(497) 2025-04-29 11:50:02 +02:00
63c353a83c Finish v1.46.09(497) 2025-04-29 11:50:02 +02:00
c069d21cbf -> v1.46.09 (497) 2025-04-29 11:49:53 +02:00
afeb9ecc23 Fix thread picking libero 2025-04-29 11:48:36 +02:00
2ff8d80da3 In verifica giacenza permettere di caricare 0 nella quantità 2025-04-28 17:13:19 +02:00
891e2641fa Aggiunta possibilità di rendere non editabile qtaTot in accettazione bolla 2025-04-28 17:08:30 +02:00
ca79107809 Finish v1.46.08(496) 2025-04-28 13:08:20 +02:00
5c37b986ce Finish v1.46.08(496) 2025-04-28 13:08:19 +02:00
c426250cd5 -> v1.46.08 (496) 2025-04-28 13:08:04 +02:00
f090c11146 Fix scan barcode in verifica giacenze 2025-04-28 13:06:03 +02:00
5c90f22a49 Finish V1.46.07(495) 2025-04-16 12:54:27 +02:00
f1ddaa1fca Finish V1.46.07(495) 2025-04-16 12:54:27 +02:00
8490553a32 -> v1.46.07 (495) 2025-04-16 12:54:15 +02:00
66824fccb1 Fix thread scanBarcode in DialogInputQuantity 2025-04-16 12:53:13 +02:00
39dce4d23f Merge remote-tracking branch 'origin/develop' into develop 2025-04-16 10:36:30 +02:00
c1dbbde905 Cambiato barcode di creazione UL in DialogScanOrCreateLUViewModel 2025-04-16 10:36:17 +02:00
8d2d0ad195 Finish v1.46.06(494) 2025-04-15 18:41:01 +02:00
927b14c9fc Finish v1.46.06(494) 2025-04-15 18:41:01 +02:00
f342cd0e5f -> v1.46.06 (494) 2025-04-15 18:40:53 +02:00
c287852ce6 Fix modal BatchLotSelection 2025-04-15 18:39:38 +02:00
edc9470e9b Finish v1.46.05(493) 2025-04-10 10:21:37 +02:00
7adeee589e Finish v1.46.05(493) 2025-04-10 10:21:37 +02:00
52a393c260 -> 1.46.05 (493) 2025-04-10 10:21:29 +02:00
60a405536c Fix thread su creaUl in PickingResi e su DialogBasket 2025-04-10 10:20:19 +02:00
5f5117c0f6 Finish v1.46.04(492) 2025-04-09 15:32:17 +02:00
0740faa964 Finish v1.46.04(492) 2025-04-09 15:32:16 +02:00
2f40302791 -> v1.46.04 (492) 2025-04-09 15:32:03 +02:00
13b3d5e63b Refactor dialog choose art form list Arts 2025-04-09 15:29:59 +02:00
58521997c1 Fix su popup filtro resi Acquisto/Vendita 2025-04-09 14:53:10 +02:00
af64ca04f9 Iniziata migrazione del nuovo versamento materiali 2025-04-09 09:29:44 +02:00
1e9d048264 Finish v1.46.03(491) 2025-04-08 15:54:57 +02:00
6f202c0c7a Finish v1.46.03(491) 2025-04-08 15:54:56 +02:00
94a9690045 -> v1.46.03 (491) 2025-04-08 15:54:52 +02:00
2b4aa11021 Fix su Spedizione e picking libero 2025-04-08 15:49:39 +02:00
f2d5bb76c5 Fix su loop nel caso di ricerca barcode kit in accettazione da bolla 2025-04-08 15:49:19 +02:00
7bdb9b47f4 Fix su qtaCnfOrd in VerificaGiacenze 2025-04-01 17:27:36 +02:00
68bf6767b9 Implementato servizio di changePosizione 2025-04-01 16:52:24 +02:00
184d1f759c Finish v1.46.00(488) 2025-03-31 10:36:19 +02:00
77 changed files with 1590 additions and 812 deletions

View File

@@ -1,5 +1,40 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JavaCodeStyleSettings>
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="" withSubpackages="true" static="false" module="true" />
<package name="android" withSubpackages="true" static="true" />
<package name="androidx" withSubpackages="true" static="true" />
<package name="com" withSubpackages="true" static="true" />
<package name="junit" withSubpackages="true" static="true" />
<package name="net" withSubpackages="true" static="true" />
<package name="org" withSubpackages="true" static="true" />
<package name="java" withSubpackages="true" static="true" />
<package name="javax" withSubpackages="true" static="true" />
<package name="" withSubpackages="true" static="true" />
<emptyLine />
<package name="android" withSubpackages="true" static="false" />
<emptyLine />
<package name="androidx" withSubpackages="true" static="false" />
<emptyLine />
<package name="com" withSubpackages="true" static="false" />
<emptyLine />
<package name="junit" withSubpackages="true" static="false" />
<emptyLine />
<package name="net" withSubpackages="true" static="false" />
<emptyLine />
<package name="org" withSubpackages="true" static="false" />
<emptyLine />
<package name="java" withSubpackages="true" static="false" />
<emptyLine />
<package name="javax" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="false" />
<emptyLine />
</value>
</option>
</JavaCodeStyleSettings>
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>

View File

@@ -4,10 +4,10 @@
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2025-03-17T09:16:48.549771200Z">
<DropdownSelection timestamp="2025-05-14T09:45:15.341614500Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="PhysicalDevice" identifier="serial=21088B8EFD" />
<DeviceId pluginId="PhysicalDevice" identifier="serial=23324B682F" />
</handle>
</Target>
</DropdownSelection>

70
Jenkinsfile.groovy Normal file
View File

@@ -0,0 +1,70 @@
pipeline {
agent {
label 'master'
}
options {
buildDiscarder(logRotator(numToKeepStr: '30', artifactNumToKeepStr: '10'))
disableConcurrentBuilds()
}
environment {
// 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
PATH = "${env.JAVA_HOME}/bin:${env.PATH}"
}
stages {
stage('Preparing') {
when {
expression {
return env.GIT_BRANCH == "master-beta"
}
}
steps {
bat "./gradlew addBetaSuffix"
}
}
stage('Build') {
steps {
bat "./gradlew assembleRelease"
archiveArtifacts artifacts: 'app/build/outputs/apk/release/', onlyIfSuccessful: true
}
}
stage('Publish') {
steps {
azureUpload allowAnonymousAccess: true, fileShareName: 'storage-ci', filesPath: 'app/build/outputs/apk/release/*', removePrefixPath: 'app/build/outputs/apk/release/', storageCredentialId: '83a86793-c1d6-4776-b20f-1ff652a57fee', storageType: 'filestorage', uploadArtifactsOnlyIfSuccessful: true, verbose: true, virtualPath: 'wms'
}
}
}
post {
success {
script {
bat "curl -k https://devservices.studioml.it/ems-api/updateWMSApp"
bat "curl -k https://services.studioml.it/ems-api/updateWMSApp"
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'
}
}
}
unstable {
script {
if (env.GIT_BRANCH == "master" || env.GIT_BRANCH == "master-beta") {
office365ConnectorSend adaptiveCards: true, color: '#FFDE21', message: 'WMS è INSTABILE', status: 'UNSTABLE', 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'
}
}
}
failure {
script {
if (env.GIT_BRANCH == "master" || env.GIT_BRANCH == "master-beta") {
office365ConnectorSend adaptiveCards: true, color: '#FF2C2C', message: 'Errore di compilazione su WMS', status: 'FAILURE', 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'
}
}
}
}
}

View File

@@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
android {
def appVersionCode = 488
def appVersionName = '1.46.00'
def appVersionCode = 506
def appVersionName = '1.46.18'
signingConfigs {
release {
@@ -53,7 +53,8 @@ android {
ext.enableCrashlytics = false
}
release {
minifyEnabled false
minifyEnabled true // Abilita la minimizzazione del codice
shrinkResources true // Rimuove risorse non utilizzate
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
@@ -101,7 +102,7 @@ configurations {
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
implementation fileTree(include: ['*.jar'], dir: 'libs')
// androidTestImplementation('androidx.test.espresso:espresso-core:3.6.1', {
// exclude group: 'com.android.support', module: 'support-annotations'
@@ -112,25 +113,23 @@ dependencies {
//Firebase
// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:33.9.0')
implementation platform('com.google.firebase:firebase-bom:33.14.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-perf'
implementation 'com.google.android.gms:play-services-basement:18.5.0'
implementation 'com.google.android.gms:play-services-basement:18.7.0'
//JJWT
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'
implementation 'com.google.guava:guava:33.4.0-android'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.4.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation('androidx.preference:preference-ktx:1.2.1') {
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel'
@@ -138,19 +137,18 @@ dependencies {
}
implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0"
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:retrofit:2.11.0'
implementation 'com.squareup.retrofit2:converter-gson:2.11.0'
implementation 'com.annimon:stream:1.2.2'
implementation 'androidx.lifecycle:lifecycle-runtime:2.8.7'
implementation 'androidx.lifecycle:lifecycle-runtime:2.9.0'
implementation 'org.apache.commons:commons-text:1.9'
//MVVM
def dagger2_version = '2.55'
api "com.google.dagger:dagger:$dagger2_version"
implementation "com.google.dagger:dagger:$dagger2_version"
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
api "com.google.dagger:dagger-android:$dagger2_version"
api "com.google.dagger:dagger-android-support:$dagger2_version"
implementation "com.google.dagger:dagger-android:$dagger2_version"
implementation "com.google.dagger:dagger-android-support:$dagger2_version"
// if you use the support libraries
annotationProcessor "com.google.dagger:dagger-android-processor:$dagger2_version"
@@ -162,7 +160,7 @@ dependencies {
implementation 'com.github.pedromassango:doubleClick:3.0'
//SQLite ROOM
def room_version = "2.6.1"
def room_version = "2.7.1"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
@@ -191,10 +189,7 @@ dependencies {
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'org.greenrobot:eventbus:3.3.1'
//Barcode generator
// implementation group: 'com.google.zxing', name: 'core', version: '3.5.3'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
}
@@ -203,3 +198,23 @@ repositories {
google()
maven { url 'https://jitpack.io' }
}
tasks.register('addBetaSuffix') {
doLast {
def gradleFile = file("build.gradle")
def content = gradleFile.text
// Modifica appVersionName
content = content.replaceAll(/appVersionName\s*=\s*'(.*?)'/) { fullMatch, version ->
"appVersionName = '${version}-beta'"
}
// Modifica outputFileName
content = content.replaceAll(/output\.outputFileName\s*=\s*"(.*?)"/) { fullMatch, filename ->
"output.outputFileName = \"${filename.replace('.apk', '-beta.apk')}\""
}
// Sovrascrivi il file
gradleFile.write(content)
}
}

View File

@@ -132,6 +132,8 @@ import it.integry.integrywmsnative.view.dialogs.basket_lu.DialogBasketLUComponen
import it.integry.integrywmsnative.view.dialogs.basket_lu.DialogBasketLUModule;
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageComponent;
import it.integry.integrywmsnative.view.dialogs.bind_product_barcode_with_package.DialogBindProductBarcodeWithPackageModule;
import it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_arts.DialogChooseArtFromListaArtsComponent;
import it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_arts.DialogChooseArtFromListaArtsModule;
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromMtbAartListComponent;
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromMtbAartListModule;
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_mtbcolr_list.DialogChooseArtsFromMtbColrListComponent;
@@ -248,7 +250,8 @@ import it.integry.integrywmsnative.view.dialogs.update_available.DialogUpdateAva
DialogAskLivelloPosizioneModule.class,
VerificaGiacenzeModule.class,
DialogExtraInfoModule.class,
DialogAskDepositoModule.class
DialogAskDepositoModule.class,
DialogChooseArtFromListaArtsModule.class
})
public interface MainApplicationComponent {
@@ -417,6 +420,8 @@ public interface MainApplicationComponent {
DialogAskDepositoComponent.Factory dialogAskDepositoComponent();
DialogChooseArtFromListaArtsComponent.Factory dialogChooseArtFromListaArtsComponent();
void inject(MainApplication mainApplication);
void inject(AppContext mainApplication);

View File

@@ -313,8 +313,8 @@ public class MainApplicationModule {
@Provides
@Singleton
DocumentRESTConsumer provideDocumentiRESTConsumer(RESTBuilder restBuilder) {
return new DocumentRESTConsumer(restBuilder);
DocumentRESTConsumer provideDocumentiRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
return new DocumentRESTConsumer(restBuilder, executorService);
}
@Provides

View File

@@ -97,6 +97,8 @@ public class MtbAart extends EntityBase {
private List<MtbUntMis> mtbUntMis;
private List<MtbAartBarCode> mtbAartBarCode;
public enum UntMisRifPesoEnum {
C,
@@ -965,6 +967,13 @@ public class MtbAart extends EntityBase {
return getMtbUntMis() != null && !getMtbUntMis().isEmpty() ? getMtbUntMis().get(0) : null;
}
public List<MtbAartBarCode> getMtbAartBarCode() {
return mtbAartBarCode;
}
public void setMtbAartBarCode(List<MtbAartBarCode> mtbAartBarCode) {
this.mtbAartBarCode = mtbAartBarCode;
}
@Override
public boolean equals(Object o) {

View File

@@ -0,0 +1,55 @@
package it.integry.integrywmsnative.core.model;
import java.math.BigDecimal;
public class MtbAartBarCode extends EntityBase {
private String codBarre;
private String codMart;
private BigDecimal qtaCnf;
private String flagPrimario;
private String tipoCodBarre;
public MtbAartBarCode() {
this.type = "mtb_aart_bar_code";
}
public String getCodBarre() {
return codBarre;
}
public void setCodBarre(String codBarre) {
this.codBarre = codBarre;
}
public String getCodMart() {
return codMart;
}
public void setCodMart(String codMart) {
this.codMart = codMart;
}
public BigDecimal getQtaCnf() {
return qtaCnf;
}
public void setQtaCnf(BigDecimal qtaCnf) {
this.qtaCnf = qtaCnf;
}
public String getFlagPrimario() {
return flagPrimario;
}
public void setFlagPrimario(String flagPrimario) {
this.flagPrimario = flagPrimario;
}
public String getTipoCodBarre() {
return tipoCodBarre;
}
public void setTipoCodBarre(String tipoCodBarre) {
this.tipoCodBarre = tipoCodBarre;
}
}

View File

@@ -66,6 +66,8 @@ public class MtbColt extends EntityBase {
private BigDecimal altezzaCm;
private String codJcom;
private String barcodeUl;
private final transient MutableLiveData<ObservableMtbTcol> mtbTCol = new MutableLiveData<>();
private Boolean disablePrint;
@@ -544,6 +546,15 @@ public class MtbColt extends EntityBase {
return this;
}
public String getBarcodeUl() {
return barcodeUl;
}
public MtbColt setBarcodeUl(String barcodeUl) {
this.barcodeUl = barcodeUl;
return this;
}
public ObservableMtbTcol getMtbTCol() {
return mtbTCol.getValue();
}
@@ -631,9 +642,15 @@ public class MtbColt extends EntityBase {
@Override
public EntityBase clone() {
return clone(true);
}
public MtbColt clone(boolean withMtbColr) {
MtbColt mtbColt = (MtbColt) super.clone();
mtbColt.setMtbColr(new ObservableArrayList<>());
if(!withMtbColr) return mtbColt;
this.getMtbColr().stream()
.map(MtbColr::new) //Genera un clone
.forEach(mtbColr -> {

View File

@@ -3,7 +3,7 @@ package it.integry.integrywmsnative.core.model.dto;
import it.integry.integrywmsnative.core.model.MtbColt;
public class AlreadyRegisteredUDCDTO {
public class AlreadyRegisteredUlDTO {
private MtbColt mtbColt;
@@ -13,7 +13,7 @@ public class AlreadyRegisteredUDCDTO {
return mtbColt;
}
public AlreadyRegisteredUDCDTO setMtbColt(MtbColt mtbColt) {
public AlreadyRegisteredUlDTO setMtbColt(MtbColt mtbColt) {
this.mtbColt = mtbColt;
return this;
}
@@ -22,7 +22,7 @@ public class AlreadyRegisteredUDCDTO {
return canBeRecovered;
}
public AlreadyRegisteredUDCDTO setCanBeRecovered(boolean canBeRecovered) {
public AlreadyRegisteredUlDTO setCanBeRecovered(boolean canBeRecovered) {
this.canBeRecovered = canBeRecovered;
return this;
}

View File

@@ -28,7 +28,7 @@ public class AuthInterceptor implements Interceptor {
public Response intercept(@NonNull Chain chain) throws IOException {
var originalRequest = chain.request();
if (SettingsManager.i().getUserSession() != null) {
if (SettingsManager.i().getUserSession() != null && SettingsManager.i().getUserSession().getAccessToken() != null) {
var accessToken = SettingsManager.i().getUserSession().getAccessToken();
var accessTokenExpiryDate = SettingsManager.i().getUserSession().getAccessTokenExpiryDate();
@@ -55,21 +55,22 @@ public class AuthInterceptor implements Interceptor {
.protocol(Protocol.HTTP_1_1)
.code(401)
.message("Unauthorized")
.body(ResponseBody.create(new byte[0], null))
.body(ResponseBody.create(okhttp3.MediaType.get("application/json"), new byte[0]))
.build();
} catch (Exception e) {
return chain.proceed(originalRequest);
}
//Retrieve the new access token after refresh
accessToken = SettingsManager.i().getUserSession().getAccessToken();
}
// Add the access token to the request header
var authorizedRequest = originalRequest.newBuilder()
.header("Authorization", "Bearer " + SettingsManager.i().getUserSession().getAccessToken())
.build();
// Add the access token to the request header
var authorizedRequest = originalRequest.newBuilder()
.header("Authorization", "Bearer " + accessToken)
.build();
return chain.proceed(authorizedRequest);
} else
return chain.proceed(originalRequest);
return chain.proceed(authorizedRequest);
} else
return chain.proceed(originalRequest);
}

View File

@@ -3,7 +3,6 @@ package it.integry.integrywmsnative.core.rest;
import java.io.IOException;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityDate;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.Request;
@@ -31,18 +30,6 @@ public class HttpInterceptor implements Interceptor {
.addHeader("Accept", "*/*")
.addHeader("x-app-token", APP_TOKEN);
String accessToken = null;
//Nel caso in cui il token è scaduto e devo richiamare la refresh non bisogna passare il vecchio token
if(SettingsManager.i().getUserSession().getAccessTokenExpiryDate() != null &&
UtilityDate.getNowTime().isBefore(SettingsManager.i().getUserSession().getAccessTokenExpiryDate().minusSeconds(20))) {
accessToken = SettingsManager.i().getUserSession().getAccessToken();
}
if(accessToken != null)
builder.header("Authorization", "Bearer " + accessToken);
var newRequest = builder
.url(url)
.build();

View File

@@ -38,6 +38,7 @@ import it.integry.integrywmsnative.core.rest.model.RettificaULDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.SpostaULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.UpdatePosizioneULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.UpdateTipoULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CanULBeDeletedRequestDTO;
@@ -113,38 +114,19 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
return this.mEntityRESTConsumer.processEntityListSynchronized(mtbColtsToSave, true, MtbColt.class);
}
public void saveColli(List<MtbColt> mtbColtsToSave, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
for (MtbColt mtbColt : mtbColtsToSave) {
for (int i = 0; i < mtbColt.getMtbColr().size(); i++) {
mtbColt.getMtbColr().get(i)
.setMtbAart(null)
.setMtbPartitaMag(null);
public void createColloScaricoDaCarico(MtbColt sourceMtbColt, MtbDepoPosizione posizione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
executorService.execute(() -> {
try {
var mtbColt = createColloScaricoDaCaricoSynchronized(sourceMtbColt, posizione);
if (onComplete != null) onComplete.run(mtbColt);
} catch (Exception ex) {
if (onFailed != null) onFailed.run(ex);
}
}
this.mEntityRESTConsumer.processEntityList(mtbColtsToSave, true, MtbColt.class, onComplete, onFailed);
}
public void createColloLavorazione(int segno, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
MtbColt mtbColtToCreate = new MtbColt()
.setSegno(segno);
mtbColtToCreate.initDefaultFields(GestioneEnum.LAVORAZIONE);
mtbColtToCreate
.setOperation(CommonModelConsts.OPERATION.INSERT);
saveCollo(mtbColtToCreate, value -> {
if (onComplete != null) onComplete.run(value);
}, ex -> {
if (onFailed != null) onFailed.run(ex);
});
}
public void createColloScaricoDaCarico(MtbColt sourceMtbColt, MtbDepoPosizione posizione, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
public MtbColt createColloScaricoDaCaricoSynchronized(MtbColt sourceMtbColt, MtbDepoPosizione posizione) throws Exception {
MtbColt newMtbColt = new MtbColt()
.initDefaultFields(GestioneEnum.LAVORAZIONE)
@@ -193,7 +175,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
}
saveCollo(newMtbColt, onComplete, onFailed);
return saveColloSynchronized(newMtbColt);
}
@@ -545,6 +527,35 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
});
}
public void updatePosizioneULSynchronized(MtbColt mtbColt, String posizione) throws Exception {
MtbColt mtbColtClone = (MtbColt) mtbColt.clone();
mtbColtClone.setMtbColr(new ObservableArrayList<>());
UpdatePosizioneULRequestDTO updateTipoULRequest = new UpdatePosizioneULRequestDTO()
.setMtbColt(mtbColtClone)
.setPosizione(posizione);
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = restBuilder.getService(ColliMagazzinoRESTConsumerService.class);
Response<ServiceRESTResponse<Void>> response = colliMagazzinoRESTConsumerService
.updatePosizioneUL(updateTipoULRequest)
.execute();
analyzeAnswer(response, "updatePosizioneUL");
}
public void updatePosizioneUL(MtbColt mtbColt, String posizione, Runnable onComplete, RunnableArgs<Exception> onFailed) {
executorService.execute(() -> {
try {
updatePosizioneULSynchronized(mtbColt, posizione);
if (onComplete != null) onComplete.run();
} catch (Exception ex) {
if (onFailed != null) onFailed.run(ex);
}
});
}
public void updateDataFine(MtbColt mtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
MtbColt cloneMtbColt = (MtbColt) mtbColt.clone();

View File

@@ -9,6 +9,7 @@ import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULResponseDTO;
import it.integry.integrywmsnative.core.rest.model.SpostaULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.UpdatePosizioneULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.UpdateTipoULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CanULBeDeletedRequestDTO;
@@ -37,6 +38,9 @@ public interface ColliMagazzinoRESTConsumerService {
@POST("wms/updateTipoUL")
Call<ServiceRESTResponse<Void>> updateTipoUL(@Body UpdateTipoULRequestDTO requestDto);
@POST("wms/updatePosizioneUL")
Call<ServiceRESTResponse<Void>> updatePosizioneUL(@Body UpdatePosizioneULRequestDTO requestDto);
@POST("wms/spostaUL")
Call<ServiceRESTResponse<Void>> spostaUL(@Body SpostaULRequestDTO requestDto);

View File

@@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.rest.consumers;
import androidx.annotation.NonNull;
import java.util.List;
import java.util.concurrent.ExecutorService;
import javax.inject.Singleton;
@@ -20,9 +21,11 @@ import retrofit2.Response;
public class DocumentRESTConsumer extends _BaseRESTConsumer {
private final RESTBuilder restBuilder;
private final ExecutorService executorService;
public DocumentRESTConsumer(RESTBuilder restBuilder) {
public DocumentRESTConsumer(RESTBuilder restBuilder, ExecutorService executorService) {
this.restBuilder = restBuilder;
this.executorService = executorService;
}
public void createDocsFromColli(List<LoadColliDTO> listColli, RunnableArgs<List<DtbDoct>> onComplete, RunnableArgs<Exception> onFailed) {
@@ -40,17 +43,22 @@ public class DocumentRESTConsumer extends _BaseRESTConsumer {
});
}
public void createDocFromColli(LoadColliDTO loadColliDTO, RunnableArgs<DtbDoct> onComplete, RunnableArgs<Exception> onFailed) {
public DtbDoct makeSynchronousCreateDocFromColliRequest(LoadColliDTO loadColliDTO) throws Exception {
DocumentiRESTConsumerService documentiRESTConsumerService = restBuilder.getService(DocumentiRESTConsumerService.class);
documentiRESTConsumerService.createDocFromColli(loadColliDTO).enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<DtbDoct>> call, Response<ServiceRESTResponse<DtbDoct>> response) {
analyzeAnswer(response, "createDocFromColli", onComplete, onFailed);
}
var response = documentiRESTConsumerService
.createDocFromColli(loadColliDTO)
.execute();
@Override
public void onFailure(Call<ServiceRESTResponse<DtbDoct>> call, @NonNull final Exception e) {
onFailed.run(e);
return analyzeAnswer(response, "createDocFromColli");
}
public void makeCreateDocFromColliRequest(LoadColliDTO loadColliDTO, RunnableArgs<DtbDoct> onComplete, RunnableArgs<Exception> onFailed) {
executorService.execute(() -> {
try {
var result = makeSynchronousCreateDocFromColliRequest(loadColliDTO);
if (onComplete != null) onComplete.run(result);
} catch (Exception ex) {
if (onFailed != null) onFailed.run(ex);
}
});
}

View File

@@ -8,6 +8,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.model.materiali.RecuperaMaterialiRequestDTO;
import it.integry.integrywmsnative.core.rest.model.materiali.VersaMaterialiRequestDTO;
@Singleton
public class MaterialiRESTConsumer extends _BaseRESTConsumer {
@@ -43,4 +44,27 @@ public class MaterialiRESTConsumer extends _BaseRESTConsumer {
});
}
public void makeSynchronousVersaRequest(VersaMaterialiRequestDTO request) throws Exception {
var materialiRESTConsumerService = restBuilder.getService(MaterialiRESTConsumerService.class);
var response = materialiRESTConsumerService.versa(request)
.execute();
var data = analyzeAnswer(response, "versaMateriali");
// if (data == null) return null;
// return data.getUpdatedMtbColtScarico();
}
public void makeVersaRequest(VersaMaterialiRequestDTO request, final Runnable onComplete, final RunnableArgs<Exception> onFailed) {
executorService.execute(() -> {
try {
makeSynchronousVersaRequest(request);
if (onComplete != null) onComplete.run();
} catch (Exception ex) {
if (onFailed != null) onFailed.run(ex);
}
});
}
}

View File

@@ -3,12 +3,16 @@ package it.integry.integrywmsnative.core.rest.consumers;
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.RecuperaMaterialiResponseDTO;
import it.integry.integrywmsnative.core.rest.model.materiali.VersaMaterialiRequestDTO;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;
public interface MaterialiRESTConsumerService {
@POST("wms/materiali/versa")
Call<ServiceRESTResponse<RecuperaMaterialiResponseDTO>> versa(@Body VersaMaterialiRequestDTO request);
@POST("wms/materiali/recupera")
Call<ServiceRESTResponse<RecuperaMaterialiResponseDTO>> recupera(@Body RecuperaMaterialiRequestDTO request);

View File

@@ -4,11 +4,8 @@ import androidx.annotation.NonNull;
import com.annimon.stream.Optional;
import com.annimon.stream.Stream;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import java.util.concurrent.ExecutorService;
@@ -21,6 +18,7 @@ import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUlDTO;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
@@ -28,8 +26,7 @@ import it.integry.integrywmsnative.core.rest.model.GetPickingListDTO;
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
import it.integry.integrywmsnative.core.utility.UtilityDB;
import it.integry.integrywmsnative.core.utility.UtilityQuery;
import it.integry.integrywmsnative.core.rest.model.uds.RetrieveAlreadyRegisteredUdsRequestDTO;
import it.integry.integrywmsnative.core.utility.UtilityString;
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
import retrofit2.Call;
@@ -180,44 +177,27 @@ public class OrdiniRESTConsumer extends _BaseRESTConsumer {
});
}
public void getBancaliGiaRegistrati(List<OrdineInevasoDTO> orders, GestioneEnum gestione, int segno, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
String whereCondGestione = "";
public List<AlreadyRegisteredUlDTO> getBancaliGiaRegistratiSynchronized(List<? extends OrdineInevasoDTO> orders, int segno) throws Exception {
OrdiniRESTConsumerService service = restBuilder.getService(OrdiniRESTConsumerService.class);
if (gestione != null) {
whereCondGestione = "mtb_colt.gestione = " + UtilityDB.valueToString(gestione.getText()) + " ";
} else {
whereCondGestione = "(mtb_colt.gestione = 'V' OR mtb_colt.gestione = 'L') ";
}
var request = new RetrieveAlreadyRegisteredUdsRequestDTO()
.setOrdini(orders)
.setSegno(segno);
String baseSql = "SELECT DISTINCT mtb_colt.* " +
"FROM mtb_colt " +
" INNER JOIN mtb_colr ON " +
" mtb_colt.gestione = mtb_colr.gestione " +
" AND mtb_colt.ser_collo = mtb_colr.ser_collo " +
" AND mtb_colt.data_collo = mtb_colr.data_collo " +
" AND mtb_colt.num_collo = mtb_colr.num_collo " +
" WHERE " + whereCondGestione +
" AND mtb_colt.segno = " + UtilityDB.valueToString(segno) + " " +
" AND mtb_colt.data_doc IS NULL AND ";
var response = service.retrieveAlreadyRegisteredUDS(request)
.execute();
var data = analyzeAnswer(response, "getBancaliGiaRegistrati");
return data == null || data.getUdsList() == null ? new ArrayList<>() : data.getUdsList();
}
List<HashMap<String, Object>> whereCondMapList = new ArrayList<>();
for (OrdineInevasoDTO ordineInevaso : orders) {
HashMap<String, Object> whereCondMap = new HashMap<>();
whereCondMap.put("mtb_colr.data_ord", ordineInevaso.getDataOrdD());
whereCondMap.put("mtb_colr.num_ord", ordineInevaso.getNumOrd());
whereCondMap.put("mtb_colr.gestione", ordineInevaso.getGestione());
whereCondMapList.add(whereCondMap);
}
baseSql += "(" + UtilityQuery.concatFieldListInWhereCond(whereCondMapList) + ")";
Type typeOfObjectsList = new TypeToken<ArrayList<MtbColt>>() {
}.getType();
this.mSystemRESTConsumer.<List<MtbColt>>processSql(baseSql, typeOfObjectsList, value -> {
if (onComplete != null) onComplete.run(value);
}, ex -> {
if (onFailed != null) onFailed.run(ex);
public void getBancaliGiaRegistrati(List<OrdineInevasoDTO> orders, int segno, RunnableArgs<List<AlreadyRegisteredUlDTO>> onComplete, RunnableArgs<Exception> onFailed) {
executorService.execute(() -> {
try {
var result = getBancaliGiaRegistratiSynchronized(orders, segno);
if (onComplete != null) onComplete.run(result);
} catch (Exception ex) {
if (onFailed != null) onFailed.run(ex);
}
});
}

View File

@@ -5,6 +5,8 @@ import java.util.List;
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
import it.integry.integrywmsnative.core.rest.model.uds.RetrieveAlreadyRegisteredUdsRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.RetrieveAlreadyRegisteredUdsResponseDTO;
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
import it.integry.integrywmsnative.core.rest.model.GetPickingListDTO;
import retrofit2.Call;
@@ -23,4 +25,7 @@ public interface OrdiniRESTConsumerService {
@GET("SM2GetOrdiniVenditaInevasi")
Call<ServiceRESTResponse<List<OrdineUscitaInevasoDTO>>> getOrdiniInevasi(@Query("codMdep") String codMdep, @Query("gestione") String gestione);
@POST("wms/spedizione/retrieveAlreadyRegisteredUDS")
Call<ServiceRESTResponse<RetrieveAlreadyRegisteredUdsResponseDTO>> retrieveAlreadyRegisteredUDS(@Body RetrieveAlreadyRegisteredUdsRequestDTO request);
}

View File

@@ -125,13 +125,12 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
public void printClosedOrdersSynchronized(PrintOrderCloseDTO dto, String codMdep) throws Exception {
if (BuildConfig.DEBUG) {
return;
// return;
}
PrinterRESTConsumerService printerService = restBuilder.getService(PrinterRESTConsumerService.class, 240);
Call<ServiceRESTResponse<Object>> callable = printerService.printClosedOrders(codMdep, dto);
var response = callable.execute();
var response = printerService.printClosedOrders(codMdep, dto).execute();
analyzeAnswer(response, "printCollo");
}

View File

@@ -0,0 +1,27 @@
package it.integry.integrywmsnative.core.rest.model;
import it.integry.integrywmsnative.core.model.MtbColt;
public class UpdatePosizioneULRequestDTO {
private MtbColt mtbColt;
private String posizione;
public MtbColt getMtbColt() {
return mtbColt;
}
public UpdatePosizioneULRequestDTO setMtbColt(MtbColt mtbColt) {
this.mtbColt = mtbColt;
return this;
}
public String getPosizione() {
return posizione;
}
public UpdatePosizioneULRequestDTO setPosizione(String posizione) {
this.posizione = posizione;
return this;
}
}

View File

@@ -0,0 +1,110 @@
package it.integry.integrywmsnative.core.rest.model.materiali;
import java.math.BigDecimal;
import java.time.LocalDate;
public class VersaMaterialiRequestDTO {
private String codMart;
private String partitaMag;
private BigDecimal numCnf;
private BigDecimal qtaCnf;
private BigDecimal qtaTot;
private Integer numCollo;
private LocalDate dataCollo;
private String gestione;
private String serCollo;
private String barcodeUl;
public String getCodMart() {
return codMart;
}
public VersaMaterialiRequestDTO setCodMart(String codMart) {
this.codMart = codMart;
return this;
}
public String getPartitaMag() {
return partitaMag;
}
public VersaMaterialiRequestDTO setPartitaMag(String partitaMag) {
this.partitaMag = partitaMag;
return this;
}
public BigDecimal getNumCnf() {
return numCnf;
}
public VersaMaterialiRequestDTO setNumCnf(BigDecimal numCnf) {
this.numCnf = numCnf;
return this;
}
public BigDecimal getQtaCnf() {
return qtaCnf;
}
public VersaMaterialiRequestDTO setQtaCnf(BigDecimal qtaCnf) {
this.qtaCnf = qtaCnf;
return this;
}
public BigDecimal getQtaTot() {
return qtaTot;
}
public VersaMaterialiRequestDTO setQtaTot(BigDecimal qtaTot) {
this.qtaTot = qtaTot;
return this;
}
public Integer getNumCollo() {
return numCollo;
}
public VersaMaterialiRequestDTO setNumCollo(Integer numCollo) {
this.numCollo = numCollo;
return this;
}
public LocalDate getDataCollo() {
return dataCollo;
}
public VersaMaterialiRequestDTO setDataCollo(LocalDate dataCollo) {
this.dataCollo = dataCollo;
return this;
}
public String getGestione() {
return gestione;
}
public VersaMaterialiRequestDTO setGestione(String gestione) {
this.gestione = gestione;
return this;
}
public String getSerCollo() {
return serCollo;
}
public VersaMaterialiRequestDTO setSerCollo(String serCollo) {
this.serCollo = serCollo;
return this;
}
public String getBarcodeUl() {
return barcodeUl;
}
public VersaMaterialiRequestDTO setBarcodeUl(String barcodeUl) {
this.barcodeUl = barcodeUl;
return this;
}
}

View File

@@ -0,0 +1,4 @@
package it.integry.integrywmsnative.core.rest.model.materiali;
public class VersaMaterialiResponseDTO {
}

View File

@@ -0,0 +1,29 @@
package it.integry.integrywmsnative.core.rest.model.uds;
import java.util.List;
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
public class RetrieveAlreadyRegisteredUdsRequestDTO {
private List<? extends OrdineInevasoDTO> ordini;
private int segno;
public List<? extends OrdineInevasoDTO> getOrdini() {
return ordini;
}
public RetrieveAlreadyRegisteredUdsRequestDTO setOrdini(List<? extends OrdineInevasoDTO> ordini) {
this.ordini = ordini;
return this;
}
public int getSegno() {
return segno;
}
public RetrieveAlreadyRegisteredUdsRequestDTO setSegno(int segno) {
this.segno = segno;
return this;
}
}

View File

@@ -0,0 +1,19 @@
package it.integry.integrywmsnative.core.rest.model.uds;
import java.util.List;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUlDTO;
public class RetrieveAlreadyRegisteredUdsResponseDTO {
private List<AlreadyRegisteredUlDTO> udsList;
public List<AlreadyRegisteredUlDTO> getUdsList() {
return udsList;
}
public RetrieveAlreadyRegisteredUdsResponseDTO setUdsList(List<AlreadyRegisteredUlDTO> udsList) {
this.udsList = udsList;
return this;
}
}

View File

@@ -97,6 +97,7 @@ public class DBSettingsModel {
private List<String> allowedCodMgrpForArtCreation;
private boolean flagAccettazioneGroupListForn = false;
private boolean flagSpedizioneEnableFastPicking = false;
private boolean flagAccettazioneBollaEditableQtaTot = true;
public boolean isFlagSpedizioneEnableFakeGiacenza() {
return flagSpedizioneEnableFakeGiacenza;
@@ -815,4 +816,12 @@ public class DBSettingsModel {
public void setFlagSpedizioneEnableFastPicking(boolean flagSpedizioneEnableFastPicking) {
this.flagSpedizioneEnableFastPicking = flagSpedizioneEnableFastPicking;
}
public boolean isFlagAccettazioneBollaEditableQtaTot() {
return flagAccettazioneBollaEditableQtaTot;
}
public void setFlagAccettazioneBollaEditableQtaTot(boolean flagAccettazioneBollaEditableQtaTot) {
this.flagAccettazioneBollaEditableQtaTot = flagAccettazioneBollaEditableQtaTot;
}
}

View File

@@ -564,6 +564,12 @@ public class SettingsManager {
.setKeySection("ENABLE_FAST_PICKING")
.setSetter(dbSettingsModelIstance::setFlagSpedizioneEnableFastPicking)
.setDefaultValue(false));
stbGestSetupReaderList.add(new StbGestSetupReader<>(Boolean.class)
.setGestName("PICKING")
.setSection("ACCETTAZIONE_BOLLA")
.setKeySection("FLAG_QTA_TOT_EDITABLE")
.setSetter(dbSettingsModelIstance::setFlagAccettazioneBollaEditableQtaTot)
.setDefaultValue(true));
stbGestSetupReaderList.add(new StbGestSetupReader<>(String.class)
.setGestName("PICKING")

View File

@@ -2,7 +2,6 @@ package it.integry.integrywmsnative.core.utility;
import android.graphics.Bitmap;
import com.annimon.stream.Stream;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
@@ -12,6 +11,7 @@ import com.journeyapps.barcodescanner.BarcodeEncoder;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Stream;
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
import it.integry.barcode_base_android_library.model.BarcodeType;
@@ -61,7 +61,7 @@ public class UtilityBarcode {
boolean isPosizione = false;
if (SettingsManager.iDB().getAvailablePosizioni() != null) {
Stream<MtbDepoPosizione> tmpStream = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
Stream<MtbDepoPosizione> tmpStream = SettingsManager.iDB().getAvailablePosizioni().stream()
.filter(x -> x.getPosizione().equalsIgnoreCase(barcode) && (!enableCheckCodMdep || currentCodMdep.equalsIgnoreCase(x.getCodMdep())));
if (tmpStream.count() > 0) {

View File

@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.gest.accettazione_bolla_elenco.rest;
import androidx.annotation.NonNull;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Singleton;
@@ -54,7 +55,7 @@ public class BolleAccettazioneRESTConsumer extends _BaseRESTConsumer {
.enqueue(new ManagedErrorCallback<>() {
@Override
public void onResponse(Call<ServiceRESTResponse<RetrieveElencoArticoliAccettazioneBollaResponseDTO>> call, Response<ServiceRESTResponse<RetrieveElencoArticoliAccettazioneBollaResponseDTO>> response) {
analyzeAnswer(response, "retrievePickingListBolle", data -> onComplete.run(data.getSitArticoli()), onFailed);
analyzeAnswer(response, "retrievePickingListBolle", data -> onComplete.run(data.getSitArticoli() == null ? new ArrayList<>() : data.getSitArticoli()), onFailed);
}
@Override

View File

@@ -42,7 +42,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgss;
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.dto.AlreadyRegisteredUDCDTO;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUlDTO;
import it.integry.integrywmsnative.core.model.observable.ObservableMtbTcol;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.report.ReportManager;
@@ -452,12 +452,12 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
dialog.show();
}
public void startListaBancaliRegistratiActivity(List<AlreadyRegisteredUDCDTO> mtbColts) {
public void startListaBancaliRegistratiActivity(List<AlreadyRegisteredUlDTO> mtbColts) {
Intent myIntent = ListaBancaliActivity.createIntent(this,
Stream.of(mtbColts)
.map(AlreadyRegisteredUDCDTO::getMtbColt)
.map(AlreadyRegisteredUlDTO::getMtbColt)
.toList(),
input -> Stream.of(mtbColts)
@@ -609,7 +609,7 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
.setInitialQtaTot(initialQtaTot)
.setTotalQtaOrd(totalQtaOrd)
.setTotalNumCnfOrd(totalNumCnfOrd)
.setQtaCnfOrd(qtaCnfOrd)
.setTotalQtaCnfOrd(qtaCnfOrd)
.setTotalQtaToBeTaken(totalQtaToBeTaken)
.setTotalNumCnfToBeTaken(totalNumCnfToBeTaken)
.setQtaCnfToBeTaken(qtaCnfToBeTaken)
@@ -620,6 +620,7 @@ public class AccettazioneBollaPickingActivity extends BaseActivity implements Ac
.setDataScad(dataScad)
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
.setCanLUBeClosed(true)
.setQtaTotEditable(SettingsManager.iDB().isFlagAccettazioneBollaEditableQtaTot())
.setCanOverflowOrderQuantity(canOverflowQuantity)
.setDisableTracciabilitaCheck(SettingsManager.iDB().isFlagAccettazioneBollaDisableMandatoryTracciabilita());

View File

@@ -30,7 +30,7 @@ import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingL
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.dto.AlreadyRegisteredUDCDTO;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUlDTO;
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
import it.integry.integrywmsnative.core.model.observable.ObservableMtbTcol;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
@@ -160,7 +160,7 @@ public class AccettazioneBollaPickingViewModel {
}
public void retrieveExistentLU(RunnableArgs<List<AlreadyRegisteredUDCDTO>> onComplete) {
public void retrieveExistentLU(RunnableArgs<List<AlreadyRegisteredUlDTO>> onComplete) {
this.sendOnLoadingStarted();
this.mAccettazioneBollaPickingRESTConsumer.retrieveAlreadyRegisteredUDC(this.mBolle, mtbColtList -> {
@@ -305,8 +305,8 @@ public class AccettazioneBollaPickingViewModel {
private void loadArticolo(String barcodeProd, PickDataDTO pickData, Runnable onComplete) {
this.mArticoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
if (mtbAartList != null && mtbAartList.size() > 0) {
this.searchArtFromAnag(mtbAartList.get(0), pickData, onComplete);
if (mtbAartList != null && !mtbAartList.isEmpty()) {
this.searchArtFromAnag(mtbAartList.get(0), pickData, null, onComplete);
} else {
this.manageUnknownBarcode(barcodeProd, onComplete);
}
@@ -315,28 +315,41 @@ public class AccettazioneBollaPickingViewModel {
}
private void searchArtFromAnag(MtbAart mtbAart, PickDataDTO pickData, Runnable onComplete) {
private void searchArtFromAnag(MtbAart mtbAart, PickDataDTO pickData, ArrayList<MtbAart> previousSearchedArts, Runnable onComplete) {
if (previousSearchedArts == null) previousSearchedArts = new ArrayList<>();
if (previousSearchedArts.contains(mtbAart)) {
manageNoArtFound(mtbAart, pickData);
return;
}
previousSearchedArts.add(mtbAart);
final List<PickingObjectDTO> pickingList = mPickingList.getValue();
List<PickingObjectDTO> matchPickingObject = Stream.of(pickingList)
.filter(x -> UtilityString.equalsIgnoreCase(mtbAart.getCodMart(), x.getSitBollaAccettazione().getCodMart()))
.toList();
List<PickingObjectDTO> matchPickingObject = pickingList == null ? new ArrayList<>() :
pickingList.stream()
.filter(x -> UtilityString.equalsIgnoreCase(mtbAart.getCodMart(), x.getSitBollaAccettazione().getCodMart()))
.collect(Collectors.toList());
for (PickingObjectDTO pickingObjectDTO : matchPickingObject) {
pickingObjectDTO.setTempPickData(pickData);
}
this.loadMatchedRows(matchPickingObject, mtbAart, pickData);
this.loadMatchedRows(matchPickingObject, mtbAart, pickData, previousSearchedArts);
onComplete.run();
}
private void loadMatchedRows(List<PickingObjectDTO> matchedRows, MtbAart mtbAart, PickDataDTO pickDataDTO) {
private void loadMatchedRows(List<PickingObjectDTO> matchedRows, MtbAart mtbAart, PickDataDTO pickDataDTO, ArrayList<MtbAart> previousSearchedArts) {
if (matchedRows == null || matchedRows.isEmpty()) {
this.sendOnLoadingStarted();
this.mArticoloRESTConsumer.findIfIsKit(mtbAart, mtbAartFind -> {
if (mtbAartFind == null){
this.sendOnLoadingEnded();
if (mtbAartFind == null) {
manageNoArtFound(mtbAart, pickDataDTO);
} else {
searchArtFromAnag(mtbAartFind, pickDataDTO, () -> {});
searchArtFromAnag(mtbAartFind, pickDataDTO, previousSearchedArts, () -> {
});
}
}, this::sendError);
} else if (matchedRows.size() == 1) {
@@ -442,7 +455,7 @@ public class AccettazioneBollaPickingViewModel {
dispatchBollaRow(pickingObjectDTO);
}
public void dispatchBollaRow(final PickingObjectDTO pickingObjectDTO){
public void dispatchBollaRow(final PickingObjectDTO pickingObjectDTO) {
dispatchBollaRow(pickingObjectDTO, false);
}
@@ -554,7 +567,7 @@ public class AccettazioneBollaPickingViewModel {
UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) {
initialNumCnf = pickingObjectDTO.getMtbAart().getColliPedana();
initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
} else if(UtilityBigDecimal.greaterThan(initialNumCnf, BigDecimal.ONE) && pickingObjectDTO.getMtbAart().isFlagQtaCnfFissaBoolean()) {
} else if (UtilityBigDecimal.greaterThan(initialNumCnf, BigDecimal.ONE) && pickingObjectDTO.getMtbAart().isFlagQtaCnfFissaBoolean()) {
initialNumCnf = BigDecimal.ONE;
initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
}
@@ -577,7 +590,7 @@ public class AccettazioneBollaPickingViewModel {
}
}
if (!longClick){
if (!longClick) {
this.sendOnItemDispatched(
pickingObjectDTO,
pickingObjectDTO.getMtbAart(),
@@ -694,7 +707,7 @@ public class AccettazioneBollaPickingViewModel {
mtbColrToEdit.getDataScadPartita(),
true,
pickedQuantityDTO -> {
if(pickedQuantityDTO == null)
if (pickedQuantityDTO == null)
return;
this.saveEditedRow(mtbColrToEdit,
@@ -809,7 +822,7 @@ public class AccettazioneBollaPickingViewModel {
int listCount = pickingList != null ? pickingList.size() : 0;
int anomalie = listCount > 0 ? listCount - mtbColr.size() : 0;
if (anomalie == 0){
if (anomalie == 0) {
closeUdc(closeUDCRequestDTO);
} else {
onConfirmAnomalie(anomalie, canBeClose -> {
@@ -824,7 +837,7 @@ public class AccettazioneBollaPickingViewModel {
}, this::sendError);
}
private void closeUdc(CloseUDCRequestDTO closeUDCRequestDTO){
private void closeUdc(CloseUDCRequestDTO closeUDCRequestDTO) {
mColliCaricoRESTConsumer.closeUDC(closeUDCRequestDTO, closeUDCResponse -> {
Runnable onVersamentoCompleted = () -> {
@@ -1060,7 +1073,7 @@ public class AccettazioneBollaPickingViewModel {
return this;
}
private void onConfirmAnomalie(int anomalie, RunnableArgs<Boolean> onConfirm){
private void onConfirmAnomalie(int anomalie, RunnableArgs<Boolean> onConfirm) {
if (this.mListener != null) mListener.onConfirmAnomalie(anomalie, onConfirm);
}

View File

@@ -2,17 +2,17 @@ package it.integry.integrywmsnative.gest.accettazione_bolla_picking.dto;
import java.util.List;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUDCDTO;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUlDTO;
public class RetrieveAlreadyRegisteredULAccettazioneBollaResponseDTO {
private List<AlreadyRegisteredUDCDTO> udcList;
private List<AlreadyRegisteredUlDTO> udcList;
public List<AlreadyRegisteredUDCDTO> getUdcList() {
public List<AlreadyRegisteredUlDTO> getUdcList() {
return udcList;
}
public RetrieveAlreadyRegisteredULAccettazioneBollaResponseDTO setUdcList(List<AlreadyRegisteredUDCDTO> udcList) {
public RetrieveAlreadyRegisteredULAccettazioneBollaResponseDTO setUdcList(List<AlreadyRegisteredUlDTO> udcList) {
this.udcList = udcList;
return this;
}

View File

@@ -9,7 +9,7 @@ import javax.inject.Inject;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUDCDTO;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUlDTO;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
import it.integry.integrywmsnative.core.rest.handler.ManagedErrorCallback;
@@ -32,7 +32,7 @@ public class AccettazioneBollaPickingRESTConsumer extends _BaseRESTConsumer {
}
public void retrieveAlreadyRegisteredUDC(List<TestataBollaAccettazioneDTO> bolle, RunnableArgs<List<AlreadyRegisteredUDCDTO>> onComplete, RunnableArgs<Exception> onFailed) {
public void retrieveAlreadyRegisteredUDC(List<TestataBollaAccettazioneDTO> bolle, RunnableArgs<List<AlreadyRegisteredUlDTO>> onComplete, RunnableArgs<Exception> onFailed) {
AccettazioneBollaPickingRESTConsumerService service = restBuilder.getService(AccettazioneBollaPickingRESTConsumerService.class);
var request = new RetrieveAlreadyRegisteredULAccettazioneBollaRequestDTO()

View File

@@ -45,7 +45,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgss;
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.dto.AlreadyRegisteredUDCDTO;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUlDTO;
import it.integry.integrywmsnative.core.model.observable.ObservableMtbTcol;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.report.ReportManager;
@@ -690,11 +690,11 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
dialog.show();
}
public void startListaBancaliRegistratiActivity(List<AlreadyRegisteredUDCDTO> mtbColts) {
public void startListaBancaliRegistratiActivity(List<AlreadyRegisteredUlDTO> mtbColts) {
Intent myIntent = ListaBancaliActivity.createIntent(this,
Stream.of(mtbColts).map(AlreadyRegisteredUDCDTO::getMtbColt).toList(),
Stream.of(mtbColts).map(AlreadyRegisteredUlDTO::getMtbColt).toList(),
input -> Stream.of(mtbColts).filter(x -> x.getMtbColt() == input).findFirstOrElse(null).isCanBeRecovered(),
@@ -782,7 +782,7 @@ public class AccettazioneOrdiniPickingActivity extends BaseActivity implements A
@Override
public void onItemDispatched(PickingObjectDTO pickingObjectDTO, MtbAart mtbAart, BigDecimal initialNumCnf, BigDecimal initialQtaCnf, BigDecimal initialQtaTot, BigDecimal totalQtaOrd, BigDecimal totalNumCnfOrd, BigDecimal qtaCnfOrd, BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, BigDecimal totalQtaAvailable, BigDecimal totalNumCnfAvailable, BigDecimal qtaCnfAvailable, String partitaMag, LocalDate dataScad, boolean canPartitaMagBeChanged, boolean canOverflowQuantity, String customArtDescription, RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO().setMtbAart(mtbAart).setInitialNumCnf(initialNumCnf).setInitialQtaCnf(initialQtaCnf).setInitialQtaTot(initialQtaTot).setTotalQtaOrd(totalQtaOrd).setTotalNumCnfOrd(totalNumCnfOrd).setQtaCnfOrd(qtaCnfOrd).setTotalQtaToBeTaken(totalQtaToBeTaken).setTotalNumCnfToBeTaken(totalNumCnfToBeTaken).setQtaCnfToBeTaken(qtaCnfToBeTaken).setTotalQtaAvailable(totalQtaAvailable).setTotalNumCnfAvailable(totalNumCnfAvailable).setQtaCnfAvailable(qtaCnfAvailable).setPartitaMag(partitaMag).setDataScad(dataScad).setCanPartitaMagBeChanged(canPartitaMagBeChanged).setCanLUBeClosed(true).setCanOverflowOrderQuantity(canOverflowQuantity).setCustomArtDescription(customArtDescription);
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO().setMtbAart(mtbAart).setInitialNumCnf(initialNumCnf).setInitialQtaCnf(initialQtaCnf).setInitialQtaTot(initialQtaTot).setTotalQtaOrd(totalQtaOrd).setTotalNumCnfOrd(totalNumCnfOrd).setTotalQtaCnfOrd(qtaCnfOrd).setTotalQtaToBeTaken(totalQtaToBeTaken).setTotalNumCnfToBeTaken(totalNumCnfToBeTaken).setQtaCnfToBeTaken(qtaCnfToBeTaken).setTotalQtaAvailable(totalQtaAvailable).setTotalNumCnfAvailable(totalNumCnfAvailable).setQtaCnfAvailable(qtaCnfAvailable).setPartitaMag(partitaMag).setDataScad(dataScad).setCanPartitaMagBeChanged(canPartitaMagBeChanged).setCanLUBeClosed(true).setCanOverflowOrderQuantity(canOverflowQuantity).setCustomArtDescription(customArtDescription);
if (!mDialogInputQuantityV2View.isVisible())
mDialogInputQuantityV2View

View File

@@ -32,7 +32,7 @@ import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingL
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.dto.AlreadyRegisteredUDCDTO;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUlDTO;
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
import it.integry.integrywmsnative.core.model.observable.ObservableMtbTcol;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
@@ -198,7 +198,7 @@ public class AccettazioneOrdiniPickingViewModel {
return mPickingList;
}
public void retrieveExistentLU(RunnableArgs<List<AlreadyRegisteredUDCDTO>> onComplete) {
public void retrieveExistentLU(RunnableArgs<List<AlreadyRegisteredUlDTO>> onComplete) {
this.sendOnLoadingStarted();
this.mAccettazioneOrdiniPickingRESTConsumer.getBancaliGiaRegistrati(this.mOrders, mtbColtList -> {

View File

@@ -2,17 +2,17 @@ package it.integry.integrywmsnative.gest.accettazione_ordini_picking.dto;
import java.util.List;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUDCDTO;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUlDTO;
public class RetrieveAlreadyRegisteredULAccettazioneOrdineResponseDTO {
private List<AlreadyRegisteredUDCDTO> udcList;
private List<AlreadyRegisteredUlDTO> udcList;
public List<AlreadyRegisteredUDCDTO> getUdcList() {
public List<AlreadyRegisteredUlDTO> getUdcList() {
return udcList;
}
public RetrieveAlreadyRegisteredULAccettazioneOrdineResponseDTO setUdcList(List<AlreadyRegisteredUDCDTO> udcList) {
public RetrieveAlreadyRegisteredULAccettazioneOrdineResponseDTO setUdcList(List<AlreadyRegisteredUlDTO> udcList) {
this.udcList = udcList;
return this;
}

View File

@@ -9,7 +9,7 @@ import javax.inject.Inject;
import javax.inject.Singleton;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUDCDTO;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUlDTO;
import it.integry.integrywmsnative.core.rest.RESTBuilder;
import it.integry.integrywmsnative.core.rest.consumers.SystemRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers._BaseRESTConsumer;
@@ -33,7 +33,7 @@ public class AccettazioneOrdiniPickingRESTConsumer extends _BaseRESTConsumer {
this.systemRestConsumer = systemRESTConsumer;
}
public void getBancaliGiaRegistrati(List<OrdineAccettazioneInevasoDTO> ordiniToShow, RunnableArgs<List<AlreadyRegisteredUDCDTO>> onComplete, RunnableArgs<Exception> onFailed) {
public void getBancaliGiaRegistrati(List<OrdineAccettazioneInevasoDTO> ordiniToShow, RunnableArgs<List<AlreadyRegisteredUlDTO>> onComplete, RunnableArgs<Exception> onFailed) {
AccettazioneOrdiniPickingRESTConsumerService service = restBuilder.getService(AccettazioneOrdiniPickingRESTConsumerService.class);
var request = new RetrieveAlreadyRegisteredULAccettazioneOrdineRequestDTO()

View File

@@ -50,7 +50,7 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
public final ObservableField<MtbColt> mtbColt = new ObservableField<>();
public final ObservableField<String> descrizioneDepo = new ObservableField<>();
public ObservableField<Boolean> fabVisible = new ObservableField<>(true);
public ObservableField<Boolean> recoverFabMenuVisible = new ObservableField<>(false);
public Boolean recoverFabMenuVisible = false;
private PopupMenu fabPopupMenu;
private String mReportName;
@@ -80,7 +80,7 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
boolean canRecoverUL = DataCache.retrieveItem(getIntent().getStringExtra(Key.CanRecoverUL));
recoverFabMenuVisible = DataCache.retrieveItem(getIntent().getStringExtra(Key.CanRecoverUL));
mtbColt.set(DataCache.retrieveItem(getIntent().getStringExtra(Key.MtbColtKey)));
mReportName = DataCache.retrieveItem(getIntent().getStringExtra(Key.ReportName));
@@ -102,8 +102,6 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
mViewModel.setListener(this);
mViewModel.init(mtbColt.get(), mReportName);
recoverFabMenuVisible.set(canRecoverUL);
this.initRecyclerView();
this.initColloInfo();
this.initFab();
@@ -144,6 +142,10 @@ public class ContenutoBancaleActivity extends BaseActivity implements ContenutoB
fabPopupMenu.getMenu().removeItem(R.id.delete_ul);
}
if(!recoverFabMenuVisible) {
fabPopupMenu.getMenu().removeItem(R.id.recover_ul);
}
fabPopupMenu.setOnMenuItemClickListener(item -> {
int itemId = item.getItemId();

View File

@@ -43,10 +43,10 @@ import it.integry.integrywmsnative.core.interfaces.ISelectAllFragment;
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
import it.integry.integrywmsnative.core.model.JtbComt;
import it.integry.integrywmsnative.core.model.MtbColr;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.model.MtbDepo;
import it.integry.integrywmsnative.core.model.MtbGrup;
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUlDTO;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.CommessaRESTConsumer;
@@ -806,7 +806,7 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
@Override
public void onResume() {
super.onResume();
Stream.of(this.mOrdiniInevasiMutableData)
this.mOrdiniInevasiMutableData.stream()
.forEach(x -> x.getSelectedObservable().set(false));
}
@@ -842,7 +842,7 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
}
@Override
public void onOrdersDispatched(List<OrdineUscitaInevasoDTO> orders, List<SitArtOrdDTO> sitArts, List<MtbColt> alreadyRegisteredMtbColts) {
public void onOrdersDispatched(List<OrdineUscitaInevasoDTO> orders, List<SitArtOrdDTO> sitArts, List<AlreadyRegisteredUlDTO> alreadyRegisteredMtbColts) {
List<String> codMarts = Stream.of(sitArts)
.distinctBy(SitArtOrdDTO::getCodMart)
.map(SitArtOrdDTO::getCodMart)
@@ -862,7 +862,6 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
() -> SpedizioneActivity.startActivity(getActivity(),
sitArts,
orders,
alreadyRegisteredMtbColts,
mCurrentGestioneCol,
mCurrentSegnoCol,
MtbColr.Causale.DEFAULT,

View File

@@ -23,9 +23,9 @@ import it.integry.integrywmsnative.core.exception.NoOrderFoundException;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
import it.integry.integrywmsnative.core.model.DtbOrdt;
import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.model.MtbGrup;
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUlDTO;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
@@ -146,8 +146,7 @@ public class OrdiniUscitaElencoViewModel {
List<SitArtOrdDTO> finalSitArts = sitArts;
this.mOrdiniRESTConsumer.getBancaliGiaRegistrati(
Stream.of(selectedOrdersBase).map(x -> (OrdineInevasoDTO) x).toList(),
mCurrentGestioneCol,
selectedOrdersBase.stream().map(x -> (OrdineInevasoDTO) x).collect(Collectors.toList()),
mCurrentSegnoCol,
mtbColtList -> {
this.sendOnOrdersDispatched(selectedOrdersBase, finalSitArts, mtbColtList);
@@ -303,7 +302,7 @@ public class OrdiniUscitaElencoViewModel {
if (this.mListener != null) mListener.onOrderFiltered(filteredOrders);
}
private void sendOnOrdersDispatched(List<OrdineUscitaInevasoDTO> orders, List<SitArtOrdDTO> sitArts, List<MtbColt> alreadyRegisteredMtbColts) {
private void sendOnOrdersDispatched(List<OrdineUscitaInevasoDTO> orders, List<SitArtOrdDTO> sitArts, List<AlreadyRegisteredUlDTO> alreadyRegisteredMtbColts) {
if (this.mListener != null)
mListener.onOrdersDispatched(orders, sitArts, alreadyRegisteredMtbColts);
}
@@ -316,7 +315,7 @@ public class OrdiniUscitaElencoViewModel {
void onOrderFiltered(List<OrdiniUscitaElencoDTO> filteredOrders);
void onOrdersDispatched(List<OrdineUscitaInevasoDTO> orders, List<SitArtOrdDTO> sitArts, List<MtbColt> alreadyRegisteredMtbColts);
void onOrdersDispatched(List<OrdineUscitaInevasoDTO> orders, List<SitArtOrdDTO> sitArts, List<AlreadyRegisteredUlDTO> alreadyRegisteredMtbColts);
}
}

View File

@@ -30,7 +30,6 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILUBaseOperationsListener;
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
import it.integry.integrywmsnative.core.model.CommonModelConsts;
import it.integry.integrywmsnative.core.model.JtbComt;
import it.integry.integrywmsnative.core.model.MtbAart;
import it.integry.integrywmsnative.core.model.MtbColr;
@@ -40,6 +39,7 @@ import it.integry.integrywmsnative.core.model.MvwSitArtUdcDetInventario;
import it.integry.integrywmsnative.core.model.VtbDest;
import it.integry.integrywmsnative.core.model.dto.InternalCodAnagsDTO;
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
import it.integry.integrywmsnative.core.model.observable.ObservableMtbTcol;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
@@ -56,7 +56,10 @@ import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.Magazzin
import it.integry.integrywmsnative.core.rest.model.magazzino_automatico.MagazzinoAutomaticoPickItemsRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CloseUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.CreateUDSRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.EditUDSRowRequestDTO;
import it.integry.integrywmsnative.core.rest.model.uds.InsertUDSRowRequestDTO;
import it.integry.integrywmsnative.core.settings.SettingsManager;
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
@@ -335,6 +338,8 @@ public class PickingLiberoViewModel {
if (this.mFlagAskCliente) {
var data = this.sendLUClienteRequired();
if (data == null) return;
vtbDest = data.first;
codJcom = data.second;
}
@@ -619,42 +624,25 @@ public class PickingLiberoViewModel {
public void saveNewRow(PickingObjectDTO pickingObjectDTO, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, LocalDate dataScad, boolean shouldCloseLU) throws Exception {
final MtbColr mtbColr = new MtbColr()
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
.setPartitaMag(partitaMag)
.setDataScadPartita(dataScad)
.setQtaCol(qtaTot)
.setQtaCnf(qtaCnf)
.setNumCnf(numCnf)
.setDescrizione(pickingObjectDTO.getMtbAart().getDescrizioneEstesa())
.setDatetimeRow(UtilityDate.getDateInstance())
.setCodJcom(this.mDefaultCommessa.getCodJcom());
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
cloneMtbColt.setMtbColr(new ObservableArrayList<>());
cloneMtbColt.getMtbColr().add((MtbColr) mtbColr.clone());
if (UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO) && UtilityBigDecimal.equalsTo(qtaTot, BigDecimal.ZERO)) {
this.sendOnLoadingEnded();
return;
}
var value = mColliMagazzinoRESTConsumer.saveColloSynchronized(cloneMtbColt);
var insertUdsRowRequest = new InsertUDSRowRequestDTO()
.setCodMart(pickingObjectDTO.getMtbAart().getCodMart())
.setPartitaMag(partitaMag)
.setDataScad(dataScad)
.setQtaTot(qtaTot)
.setQtaCnf(qtaCnf)
.setNumCnf(numCnf)
.setCodJcom(this.mDefaultCommessa.getCodJcom())
.setTargetMtbColt(mCurrentMtbColt.clone(false));
mtbColr
.setDataCollo(value.getDataColloS())
.setNumCollo(value.getNumCollo())
.setGestione(value.getGestione())
.setSerCollo(value.getSerCollo())
.setRiga(value.getMtbColr().get(value.getMtbColr().size() - 1).getRiga())
.setUntMis(pickingObjectDTO.getMtbAart().getUntMis())
.setMtbAart(pickingObjectDTO.getMtbAart());
MtbColr savedMtbColr = mColliScaricoRESTConsumer.insertUDSRowSynchronized(insertUdsRowRequest);
savedMtbColr.setMtbAart(pickingObjectDTO.getMtbAart());
mCurrentMtbColt.getMtbColr().add(mtbColr);
mCurrentMtbColt.getMtbColr().add(savedMtbColr);
this.sendOnRowSaved();
@@ -662,6 +650,40 @@ public class PickingLiberoViewModel {
}
private void executeDepositChangeIfNeeded(MtbColt refMtbColt) throws Exception {
//Considero solo la prima UDC scansionata
boolean shouldChangeCodMdep = refMtbColt != null && !refMtbColt.getCodMdep().equalsIgnoreCase(mCurrentMtbColt.getCodMdep()) &&
mCurrentMtbColt.getMtbColr().isEmpty();
String newCodMdep = shouldChangeCodMdep ? refMtbColt.getCodMdep() : null;
if (shouldChangeCodMdep) {
mColliMagazzinoRESTConsumer.spostaUlSynchronized(mCurrentMtbColt, newCodMdep, null, false);
mCurrentMtbColt.setCodMdep(newCodMdep);
}
}
private void executeTipoUlChangeIfNeeded(MtbColt refMtbColt) throws Exception {
boolean shouldChangeCodTcol = refMtbColt != null && refMtbColt.getCodTcol() != null &&
!refMtbColt.getCodTcol().equalsIgnoreCase(mCurrentMtbColt.getCodTcol()) &&
mCurrentMtbColt.getMtbColr().isEmpty();
String newTipoUL = shouldChangeCodTcol ? refMtbColt.getCodTcol() : null;
ObservableMtbTcol newMtbTcol = SettingsManager.iDB().getInternalImballi().stream()
.filter(x -> x.getCodTcol().equalsIgnoreCase(newTipoUL))
.findFirst()
.orElse(null);
if (!UtilityString.isNullOrEmpty(newTipoUL) && newMtbTcol == null) {
throw new Exception("Impossibile riconoscere il tipo UL " + newTipoUL);
}
if (shouldChangeCodTcol && newMtbTcol != null) {
mColliMagazzinoRESTConsumer.updateTipoULSynchronized(mCurrentMtbColt, newMtbTcol.getCodTcol());
mCurrentMtbColt.setCodTcol(newMtbTcol.getCodTcol());
}
}
private MtbColt loadRifULFromMtbColr(MtbColr mtbColr) throws Exception {
//Se ho dei riferimenti ad una UL devo leggere la QTA ancora disponibile sulla Ul
if (mtbColr != null &&
@@ -765,36 +787,25 @@ public class PickingLiberoViewModel {
private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, LocalDate dataScad, boolean shouldCloseLU) throws Exception {
this.sendOnLoadingStarted();
MtbColr mtbColrClone = (MtbColr) mtbColrToUpdate.clone();
mtbColrClone.setMtbAart(null)
.setMtbPartitaMag(null);
MtbColt mtbColt = new MtbColt()
.setNumCollo(mtbColrToUpdate.getNumCollo())
.setDataCollo(mtbColrToUpdate.getDataColloS())
.setSerCollo(mtbColrToUpdate.getSerCollo())
.setGestione(mtbColrToUpdate.getGestione())
.setMtbColr(new ObservableArrayList<>());
mtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
var editUDSRowRequest = new EditUDSRowRequestDTO()
.setSourceMtbColr(mtbColrClone)
.setNewNumCnf(numCnf)
.setNewQtaCnf(qtaCnf)
.setNewQtaTot(qtaTot);
final MtbColr mtbColr = (MtbColr) mtbColrToUpdate.clone();
mtbColr.setOperation(CommonModelConsts.OPERATION.UPDATE);
mtbColr
.setNumCnf(numCnf)
.setQtaCnf(qtaCnf)
.setQtaCol(qtaTot)
.setPartitaMag(partitaMag)
.setDataScadPartita(dataScad)
.setDatetimeRow(UtilityDate.getDateInstance());
mColliScaricoRESTConsumer.editUDSRowSynchronized(editUDSRowRequest);
mtbColt.getMtbColr().add(mtbColr);
var value = this.mColliMagazzinoRESTConsumer.saveColloSynchronized(mtbColt);
mtbColr.setNumCnf(numCnf)
mtbColrToUpdate.setNumCnf(numCnf)
.setQtaCnf(qtaCnf)
.setQtaCol(qtaTot);
handler.post(() -> {
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToUpdate);
this.mCurrentMtbColt.getMtbColr().add(mtbColr);
this.mCurrentMtbColt.getMtbColr().add(mtbColrToUpdate);
});
this.sendOnRowSaved();
@@ -807,21 +818,10 @@ public class PickingLiberoViewModel {
if (shouldDelete) {
this.sendOnLoadingStarted();
MtbColt mtbColt = new MtbColt()
.setNumCollo(mtbColrToDelete.getNumCollo())
.setDataCollo(mtbColrToDelete.getDataColloS())
.setSerCollo(mtbColrToDelete.getSerCollo())
.setGestione(mtbColrToDelete.getGestione())
.setMtbColr(new ObservableArrayList<>());
var deleteUdsRowRequest = new DeleteUDSRowRequestDTO()
.setMtbColrToDelete(mtbColrToDelete);
mtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
MtbColr mtbColr = (MtbColr) mtbColrToDelete.clone();
mtbColr.setOperation(CommonModelConsts.OPERATION.DELETE);
mtbColt.getMtbColr().add(mtbColr);
var value = this.mColliMagazzinoRESTConsumer.saveColloSynchronized(mtbColt);
mColliScaricoRESTConsumer.deleteUDSRowSynchronized(deleteUdsRowRequest);
handler.post(() -> {
this.mCurrentMtbColt.getMtbColr().remove(mtbColrToDelete);
@@ -861,7 +861,7 @@ public class PickingLiberoViewModel {
if (this.mDefaultGestione == GestioneEnum.LAVORAZIONE && SettingsManager.iDB().isProduzioneGeneraDocScar()) {
if(SettingsManager.iDB().getInternalCodAnags() == null || SettingsManager.iDB().getInternalCodAnags().isEmpty())
if (SettingsManager.iDB().getInternalCodAnags() == null || SettingsManager.iDB().getInternalCodAnags().isEmpty())
throw new Exception("Nessuna anagrafica aziendale configurata. Assicurarsi di aver abilitato il flag FLAG_USE_COD_ANAG_AZIENDALE.");
closeUDSRequest

View File

@@ -4,6 +4,8 @@ import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.Handler;
import android.text.InputType;
import android.text.SpannableString;
import androidx.databinding.DataBindingUtil;
@@ -51,6 +53,7 @@ import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView;
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleInputHelper;
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
import it.integry.integrywmsnative.view.dialogs.info_aggiuntive_lu.DialogInfoAggiuntiveLUView;
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
@@ -68,6 +71,9 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
@Inject
DialogInputQuantityV2View mDialogInputQuantityV2View;
@Inject
Handler handler;
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
private ObservableArrayList<PickingResiListModel> mPickingResiMutableData = new ObservableArrayList<>();
@@ -250,10 +256,7 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
public void createNewLU() {
this.mBindings.mainFab.close(true);
this.onLoadingStarted();
this.mViewmodel.createNewLU(null, null, () -> {
this.onLoadingEnded();
});
this.mViewmodel.createNewLU(null, null, this::onLoadingEnded);
}
public void removeListFilter() {
@@ -333,7 +336,7 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
mDialogInputQuantityV2View
.setDialogInputQuantityV2DTO(dialogInputQuantityV2DTO)
.setOnComplete(resultDTO -> {
if(resultDTO == null || resultDTO.isAborted()) {
if (resultDTO == null || resultDTO.isAborted()) {
this.mViewmodel.resetMatchedRows();
return;
}
@@ -369,7 +372,7 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
@Override
public void onRowSaved() {
Snackbar.make(mBindings.getRoot(), R.string.data_saved, Snackbar.LENGTH_SHORT)
.setBackgroundTint(getResources().getColor(R. color. green_500))
.setBackgroundTint(getResources().getColor(R.color.green_500))
.show();
}
@@ -385,21 +388,25 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
@Override
public void onLUOpened(MtbColt mtbColt) {
noLUPresent.set(false);
handler.post(() -> {
noLUPresent.set(false);
Snackbar.make(mBindings.getRoot(), R.string.data_saved, Snackbar.LENGTH_SHORT)
.setBackgroundTint(getResources().getColor(R. color. green_500))
.show();
Snackbar.make(mBindings.getRoot(), R.string.data_saved, Snackbar.LENGTH_SHORT)
.setBackgroundTint(getResources().getColor(R.color.green_500))
.show();
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(mtbColt);
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(mtbColt);
});
}
@Override
public void onLUClosed() {
noLUPresent.set(true);
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
handler.post(() -> {
noLUPresent.set(true);
this.mBottomSheetFragmentLUContentViewModel.setMtbColt(null);
if (this.mShouldCloseActivity) super.onBackPressed();
if (this.mShouldCloseActivity) super.onBackPressed();
});
}
@Override

View File

@@ -446,7 +446,6 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
SpedizioneActivity.startActivity(getActivity(),
sitArtOrdDTOS,
new ArrayList<>(),
new ArrayList<>(),
GestioneEnum.LAVORAZIONE,
+1,
MtbColr.Causale.VERSAMENTO,

View File

@@ -23,6 +23,7 @@ import java.util.List;
import javax.inject.Inject;
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
import it.integry.integrywmsnative.MainApplication;
import it.integry.integrywmsnative.R;
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
@@ -194,12 +195,26 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
private void initBarcodeReader() {
mBarcodeScannerInstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
.setOnScanSuccessful(mViewModel::processBarcodeDTO)
.setOnScanSuccessful(onScanSuccessful)
.setOnScanFailed(this::onError));
BarcodeManager.enable(mBarcodeScannerInstanceID);
}
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
this.onLoadingStarted();
executorService.execute(() -> {
try {
this.mViewModel.processBarcodeDTO(data);
} catch (Exception e) {
onError(e);
}
});
this.onLoadingEnded();
};
// private void openLU() {
// DialogScanOrCreateLUView.newInstance(false, false, true, false, true, (mtbColt, created) -> {
// if (mtbColt == null) {
@@ -223,13 +238,14 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
// }).show(requireActivity().getSupportFragmentManager(), "tag");
// }
private void choosePosition(RunnableArgs<MtbDepoPosizione> onComplete) {
private void choosePosition(RunnableArgss<Boolean, MtbDepoPosizione> onComplete) {
DialogAskPositionOfLUView.newInstance(false, (status, mtbDepoPosizione) -> {
if (status == DialogConsts.Results.ABORT) {
onComplete.run(false, null);
popMe();
} else {
onComplete.run(mtbDepoPosizione);
onComplete.run(true, mtbDepoPosizione);
}
})
@@ -359,7 +375,7 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
}
@Override
public void onRequestChoosePosition(RunnableArgs<MtbDepoPosizione> onComplete) {
public void onRequestChoosePosition(RunnableArgss<Boolean, MtbDepoPosizione> onComplete) {
choosePosition(onComplete);
}

View File

@@ -6,6 +6,7 @@ import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MaterialiRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
@@ -18,8 +19,9 @@ public class ProdVersamentoMaterialeModule {
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
MesRESTConsumer mesRESTConsumer,
BarcodeRESTConsumer barcodeRESTConsumer,
ArticoloRESTConsumer articoloRESTConsumer) {
return new ProdVersamentoMaterialeViewModel(posizioniRESTConsumer, colliMagazzinoRESTConsumer, colliLavorazioneRESTConsumer, mesRESTConsumer, barcodeRESTConsumer, articoloRESTConsumer);
ArticoloRESTConsumer articoloRESTConsumer,
MaterialiRESTConsumer materialiRESTConsumer) {
return new ProdVersamentoMaterialeViewModel(posizioniRESTConsumer, colliMagazzinoRESTConsumer, colliLavorazioneRESTConsumer, mesRESTConsumer, barcodeRESTConsumer, articoloRESTConsumer, materialiRESTConsumer);
}
}

View File

@@ -1,8 +1,8 @@
package it.integry.integrywmsnative.gest.prod_versamento_materiale;
import androidx.lifecycle.MutableLiveData;
import android.util.Pair;
import com.annimon.stream.Stream;
import androidx.lifecycle.MutableLiveData;
import org.jetbrains.annotations.NotNull;
@@ -10,6 +10,8 @@ import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;
import javax.inject.Inject;
@@ -18,7 +20,6 @@ import it.integry.integrywmsnative.core.exception.InvalidCodMdepException;
import it.integry.integrywmsnative.core.exception.NoLUFoundException;
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
import it.integry.integrywmsnative.core.exception.TooManyLUFoundInMonoLUPositionException;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
import it.integry.integrywmsnative.core.model.MtbAart;
@@ -30,6 +31,7 @@ import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.ColliLavorazioneRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MaterialiRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
import it.integry.integrywmsnative.core.rest.consumers.PosizioniRESTConsumer;
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
@@ -50,6 +52,7 @@ public class ProdVersamentoMaterialeViewModel {
private final MesRESTConsumer mMesRESTConsumer;
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
private final ArticoloRESTConsumer mArticoloRESTConsumer;
private final MaterialiRESTConsumer mMaterialiRESTConsumer;
private boolean mFlagVersamentoDirettoProduzione;
@@ -66,13 +69,15 @@ public class ProdVersamentoMaterialeViewModel {
ColliLavorazioneRESTConsumer colliLavorazioneRESTConsumer,
MesRESTConsumer mesRESTConsumer,
BarcodeRESTConsumer barcodeRESTConsumer,
ArticoloRESTConsumer articoloRESTConsumer) {
ArticoloRESTConsumer articoloRESTConsumer,
MaterialiRESTConsumer mMaterialiRESTConsumer) {
this.mPosizioniRESTConsumer = posizioniRESTConsumer;
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
this.mColliLavorazioneRESTConsumer = colliLavorazioneRESTConsumer;
this.mMesRESTConsumer = mesRESTConsumer;
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
this.mArticoloRESTConsumer = articoloRESTConsumer;
this.mMaterialiRESTConsumer = mMaterialiRESTConsumer;
}
@@ -81,7 +86,7 @@ public class ProdVersamentoMaterialeViewModel {
}
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO) {
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO) throws Exception {
if (UtilityBarcode.isEtichettaPosizione(barcodeScanDTO)) {
this.executeEtichettaPosizione(barcodeScanDTO);
} else if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
@@ -94,93 +99,91 @@ public class ProdVersamentoMaterialeViewModel {
}
private void executeEtichettaPosizione(BarcodeScanDTO barcodeScanDTO) {
MtbDepoPosizione foundPosizione = Stream.of(SettingsManager.iDB().getAvailablePosizioni())
private void executeEtichettaPosizione(BarcodeScanDTO barcodeScanDTO) throws Exception {
MtbDepoPosizione foundPosizione = SettingsManager.iDB().getAvailablePosizioni().stream()
.filter(x -> x.getPosizione().equalsIgnoreCase(barcodeScanDTO.getStringValue()))
.single();
.findFirst()
.orElse(null);
this.executePosizione(foundPosizione);
}
private void executePosizione(MtbDepoPosizione posizione) {
this.mPosizioniRESTConsumer.getBancaliInPosizione(posizione, mtbColtList -> {
if (mtbColtList == null || mtbColtList.isEmpty()) {
this.sendError(new NoLUFoundException());
} else if (mtbColtList.size() == 1) {
this.mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
if (codMdepIsValid) {
this.onLUOpened(mtbColt);
} else this.sendError(new InvalidCodMdepException());
}, this::sendError);
} else {
this.sendError(new TooManyLUFoundInMonoLUPositionException());
}
}, this::sendError);
}
private void executePosizione(MtbDepoPosizione posizione) throws Exception {
var mtbColtList = this.mPosizioniRESTConsumer.getBancaliInPosizioneSynchronized(posizione);
private void executeEtichettaLU(String sscc) {
this.mColliMagazzinoRESTConsumer.getBySSCC(sscc, true, false, mtbColt -> {
if (mtbColtList == null || mtbColtList.isEmpty()) {
this.sendError(new NoLUFoundException());
} else if (mtbColtList.size() == 1) {
var mtbColt = this.mColliMagazzinoRESTConsumer.getByTestataSynchronized(mtbColtList.get(0), true, false);
boolean codMdepIsValid = Stream.of(SettingsManager.iDB().getAvailableCodMdep())
boolean codMdepIsValid = SettingsManager.iDB().getAvailableCodMdep().stream()
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
if (codMdepIsValid) {
this.onLUOpened(mtbColt);
} else this.sendError(new InvalidCodMdepException());
} else
throw new InvalidCodMdepException();
}, this::sendError);
} else
throw new TooManyLUFoundInMonoLUPositionException();
}
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO) {
mBarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
private void executeEtichettaLU(String sscc) throws Exception {
var mtbColt = this.mColliMagazzinoRESTConsumer.getBySsccSynchronized(sscc, true, false);
String barcodeProd = null;
boolean codMdepIsValid = SettingsManager.iDB().getAvailableCodMdep().stream()
.anyMatch(x -> x.getCodMdep().equalsIgnoreCase(mtbColt.getCodMdep()));
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
if (!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
if (!UtilityString.isNullOrEmpty(ean128Model.Content))
barcodeProd = ean128Model.Content;
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
this.executeEtichettaLU(ean128Model.Sscc);
} else if (!UtilityString.isNullOrEmpty(barcodeProd)) {
this.loadArticolo(barcodeProd, ean128Model);
} else {
this.sendError(new NoLUFoundException());
}
} else {
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
this.sendError(new NoLUFoundException());
}
}, this::sendError);
if (codMdepIsValid) {
this.onLUOpened(mtbColt);
} else
throw new InvalidCodMdepException();
}
private void loadArticolo(String barcodeProd, Ean128Model ean128Model) {
mArticoloRESTConsumer.searchByBarcode(barcodeProd, mtbAartList -> {
if (mtbAartList != null && !mtbAartList.isEmpty()) {
MtbAart articolo = mtbAartList.get(0);
this.dispatchArt(articolo, ean128Model);
} else {
this.sendError(new NoResultFromBarcodeException(barcodeProd));
}
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO) throws Exception {
var ean128Model = mBarcodeRESTConsumer.decodeEan128Synchronized(barcodeScanDTO);
String barcodeProd = null;
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
if (!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
if (!UtilityString.isNullOrEmpty(ean128Model.Content))
barcodeProd = ean128Model.Content;
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
this.executeEtichettaLU(ean128Model.Sscc);
} else if (!UtilityString.isNullOrEmpty(barcodeProd)) {
this.loadArticolo(barcodeProd, ean128Model);
} else
throw new NoLUFoundException();
} else
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
throw new NoLUFoundException();
}
private void loadArticolo(String barcodeProd, Ean128Model ean128Model) throws Exception {
var mtbAartList = mArticoloRESTConsumer.searchByBarcodeSynchronized(barcodeProd);
if (mtbAartList != null && !mtbAartList.isEmpty()) {
MtbAart articolo = mtbAartList.get(0);
this.dispatchArt(articolo, ean128Model);
} else {
throw new NoResultFromBarcodeException(barcodeProd);
}
}, this::sendError);
}
@@ -261,8 +264,6 @@ public class ProdVersamentoMaterialeViewModel {
}
this.sendOnItemDispatched(
pickingObjectDTO,
mtbAart,
@@ -281,39 +282,58 @@ public class ProdVersamentoMaterialeViewModel {
true,
(pickedQuantityDTO, shouldCloseLU) -> {
this.sendRequestChoosePosition(mtbDepoPosizione -> {
var changePosizioneResult = this.sendRequestChoosePosition();
if (changePosizioneResult == null || !changePosizioneResult.first) {
return;
}
mColliLavorazioneRESTConsumer.createColloScaricoDaArticolo(mtbAart,
pickedQuantityDTO.getPartitaMag(),
changePosizioneResult.second,
pickedQuantityDTO.getQtaTot(),
pickedQuantityDTO.getQtaCnf(),
pickedQuantityDTO.getNumCnf(),
null, null,
this::sendOnDataSaved,
this::sendError);
mColliLavorazioneRESTConsumer.createColloScaricoDaArticolo(mtbAart,
pickedQuantityDTO.getPartitaMag(),
mtbDepoPosizione,
pickedQuantityDTO.getQtaTot(),
pickedQuantityDTO.getQtaCnf(),
pickedQuantityDTO.getNumCnf(),
null, null,
this::sendOnDataSaved,
this::sendError);
});
});
}
private void onLUOpened(MtbColt mtbColt) {
this.mtbColtMutableLiveData.setValue(mtbColt);
this.sendRequestChoosePosition(this::setPosizione);
private void onLUOpened(MtbColt mtbColt) throws Exception {
this.mtbColtMutableLiveData.postValue(mtbColt);
var posizioneResult = this.sendRequestChoosePosition();
if (posizioneResult == null || !posizioneResult.first) {
return;
}
this.setPosizione(posizioneResult.second);
}
public void setPosizione(MtbDepoPosizione mtbDepoPosizione) {
public void setPosizione(MtbDepoPosizione mtbDepoPosizione) throws Exception {
this.mtbDepoPosizioneMutableLiveData.postValue(mtbDepoPosizione);
MtbColt mtbColt = mtbColtMutableLiveData.getValue();
this.sendOnLoadingStarted();
if (mtbDepoPosizione != null && mtbDepoPosizione.isFlagLineaProduzione() && mtbColt != null) {
// mMaterialiRESTConsumer.makeVersaRequest(new VersaMaterialiRequestDTO()
// .setBarcodeUl(mtbColt.getBarcodeUl()), () -> {
//
// String a = "";
//
// }, this::sendError);
if (!mFlagVersamentoDirettoProduzione) {
createColloScarico(mtbDepoPosizione);
} else {
if (mtbColt.getMtbColr() == null || mtbColt.getMtbColr().size() <= 0) {
if (mtbColt.getMtbColr() == null || mtbColt.getMtbColr().isEmpty()) {
this.sendWarning("Il collo selezionato non presenta articoli versabili sulla linea.", this::sendRequestLUOpen);
return;
} else if (mtbColt.getMtbColr().size() > 1) {
@@ -344,15 +364,13 @@ public class ProdVersamentoMaterialeViewModel {
}
}
private void createColloScarico(MtbDepoPosizione mtbDepoPosizione) {
private void createColloScarico(MtbDepoPosizione mtbDepoPosizione) throws Exception {
this.sendOnLoadingStarted();
this.mColliMagazzinoRESTConsumer.createColloScaricoDaCarico(mtbColtMutableLiveData.getValue(), mtbDepoPosizione,
generatedMtbColt -> {
this.sendOnLoadingEnded();
this.sendOnDataSaved();
}, this::sendError);
var generatedMtbColt = this.mColliMagazzinoRESTConsumer.createColloScaricoDaCaricoSynchronized(mtbColtMutableLiveData.getValue(), mtbDepoPosizione);
this.sendOnLoadingEnded();
this.sendOnDataSaved();
}
@@ -426,8 +444,22 @@ public class ProdVersamentoMaterialeViewModel {
if (this.mListener != null) mListener.requestLUOpen();
}
private void sendRequestChoosePosition(RunnableArgs<MtbDepoPosizione> onComplete) {
if (this.mListener != null) mListener.onRequestChoosePosition(onComplete);
private Pair<Boolean, MtbDepoPosizione> sendRequestChoosePosition() {
final CountDownLatch latch = new CountDownLatch(1);
AtomicReference<Pair<Boolean, MtbDepoPosizione>> result = new AtomicReference<>();
if (this.mListener != null) mListener.onRequestChoosePosition((status, data) -> {
result.set(new Pair<>(status, data));
latch.countDown();
});
try {
latch.await(); // Attende che il dialog venga chiuso
return result.get();
} catch (InterruptedException e) {
this.sendError(e);
}
return null;
}
private void sendOnLoadingStarted() {
@@ -492,7 +524,7 @@ public class ProdVersamentoMaterialeViewModel {
void requestLUOpen();
void onRequestChoosePosition(RunnableArgs<MtbDepoPosizione> onComplete);
void onRequestChoosePosition(RunnableArgss<Boolean, MtbDepoPosizione> onComplete);
void onItemDispatched(PickingObjectDTO pickingObjectDTO,
MtbAart mtbAart,

View File

@@ -201,6 +201,8 @@ public class VerificaGiacenzeFragment extends BaseFragment implements ITitledFra
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
.setOnScanSuccessful(onScanSuccessful)
.setOnScanFailed(ex -> UtilityExceptions.defaultException(requireContext(), ex, false)));
BarcodeManager.enable(barcodeScannerIstanceID);
}
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
@@ -209,12 +211,12 @@ public class VerificaGiacenzeFragment extends BaseFragment implements ITitledFra
executorService.execute(() -> {
try {
this.mViewModel.processBarcodeDTO(data);
this.onLoadingEnded();
} catch (Exception e) {
this.onError(e);
}
});
this.onLoadingEnded();
};
@@ -275,9 +277,12 @@ public class VerificaGiacenzeFragment extends BaseFragment implements ITitledFra
.setTotalNumCnfInWarehouse(inWarehouseNumCnf)
.setTotalQtaInWarehouse(inWarehouseQtaTot)
.setTotalQtaOrd(incomingQtaTot)
.setTotalQtaCnfOrd(initialQtaCnf)
.setTotalNumCnfOrd(incomingNumCnf)
.setPartitaMag(partitaMag)
.setDataScad(dataScad)
.setCanInputZeroQuantity(true)
.setCanOverflowOrderQuantity(true)
.setCanLUBeClosed(false);
if (!dialogInputQuantityV2View.isVisible())

View File

@@ -11,6 +11,7 @@ import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.ExecutorService;
import java.util.stream.Collectors;
@@ -24,6 +25,7 @@ import it.integry.integrywmsnative.core.data_store.db.respository_new.VerificaGi
import it.integry.integrywmsnative.core.exception.NoArtsFoundException;
import it.integry.integrywmsnative.core.mapper.VerificaGiacenzeMapper;
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.GiacenzaPvRESTConsumer;
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
@@ -116,7 +118,7 @@ public class VerificaGiacenzeViewModel {
public void randomizeElements(int elementsCount) {
for(int i = 0; i < elementsCount; i++) {
for (int i = 0; i < elementsCount; i++) {
var randomIndex = (int) (Math.random() * currentLoadedAnagrafiche.size());
var randomAnagrafica = currentLoadedAnagrafiche.get(randomIndex);
@@ -168,7 +170,7 @@ public class VerificaGiacenzeViewModel {
public void save() throws Exception {
if(currentVerificaRows.getValue().isEmpty()) {
if (currentVerificaRows.getValue().isEmpty()) {
delete();
return;
}
@@ -280,10 +282,21 @@ public class VerificaGiacenzeViewModel {
}
public MtbAart searchAnagraficaByBarcode(String barcode) {
return currentLoadedAnagrafiche.parallelStream()
.filter(mtbAart -> barcode.equals(mtbAart.getBarCode()))
MtbAart mtbAart = currentLoadedAnagrafiche.parallelStream()
.filter(x -> barcode.equals(x.getBarCode()))
.findFirst()
.orElse(null);
if (mtbAart == null) {
mtbAart = currentLoadedAnagrafiche.parallelStream()
.filter(x -> x.getMtbAartBarCode() != null &&
x.getMtbAartBarCode().stream()
.anyMatch(y -> barcode.equals(y.getCodBarre())))
.findFirst()
.orElse(null);
}
return mtbAart;
}
public void insertRow(VerificaGiacenzeRowEntity rowEntity) {

View File

@@ -329,8 +329,8 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
@Override
public void onArtListLoaded(ArrayList<MtbAart> artList, RunnableArgs<MtbAart> onArtChoosed) {
new DialogChooseArtFromListaArtsView(true, artList, onArtChoosed)
.show(requireActivity().getSupportFragmentManager(), "tag");
DialogChooseArtFromListaArtsView.newInstance(true, artList, onArtChoosed)
.show(requireActivity().getSupportFragmentManager(), "dialog-choose-art");
}
@Override

View File

@@ -475,9 +475,10 @@ public class RettificaGiacenzeViewModel {
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.UPDATE);
cloneMtbColt.setMtbColr(null);
cloneMtbColt.setPosizione(mtbDepoPosizione != null ? mtbDepoPosizione.getPosizione() : CommonModelConsts.ENTITY_NULL_STRING);
this.mColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, mtbColt -> onComplete.run(), this::sendError);
this.mColliMagazzinoRESTConsumer.updatePosizioneUL(cloneMtbColt, mtbDepoPosizione != null ? mtbDepoPosizione.getPosizione() : CommonModelConsts.ENTITY_NULL_STRING,
onComplete,
this::sendError);
}
private void postSaveBehaviour(Runnable onComplete) {

View File

@@ -28,6 +28,7 @@ import java.util.List;
import java.util.Objects;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import javax.inject.Inject;
@@ -50,8 +51,10 @@ 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.MtbPartitaMag;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUlDTO;
import it.integry.integrywmsnative.core.model.observable.ObservableMtbTcol;
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
import it.integry.integrywmsnative.core.report.ReportManager;
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
import it.integry.integrywmsnative.core.settings.SettingsManager;
@@ -120,7 +123,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
private ArrayList<SitArtOrdDTO> mSitArtOrd;
private ArrayList<OrdineUscitaInevasoDTO> mTestateOrdini;
private ArrayList<MtbColt> mColliRegistrati;
private ArrayList<AlreadyRegisteredUlDTO> mColliRegistrati;
private GestioneEnum mGestioneCol;
private int mSegnoCol;
private Integer mDefaultCausaleUL;
@@ -135,7 +138,6 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
public static void startActivity(Context context,
List<SitArtOrdDTO> ordini,
List<OrdineUscitaInevasoDTO> selectedOrders,
List<MtbColt> mtbColtList,
GestioneEnum gestioneCol,
int segnoCol,
Integer defaultCausaleUL,
@@ -149,9 +151,6 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
String keyTestateOrdini = DataCache.addItem(selectedOrders);
myIntent.putExtra("keyTestateOrdini", keyTestateOrdini);
String keyColliRegistrati = DataCache.addItem(mtbColtList);
myIntent.putExtra("keyColliRegistrati", keyColliRegistrati);
String keyGestioneCol = DataCache.addItem(gestioneCol);
myIntent.putExtra("keyGestioneCol", keyGestioneCol);
@@ -176,7 +175,6 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
mSitArtOrd = DataCache.retrieveItem(getIntent().getStringExtra("keyPickingList"));
mTestateOrdini = DataCache.retrieveItem(getIntent().getStringExtra("keyTestateOrdini"));
mColliRegistrati = DataCache.retrieveItem(getIntent().getStringExtra("keyColliRegistrati"));
mGestioneCol = DataCache.retrieveItem(getIntent().getStringExtra("keyGestioneCol"));
mSegnoCol = DataCache.retrieveItem(getIntent().getStringExtra("keySegnoCol"));
mDefaultCausaleUL = DataCache.retrieveItem(getIntent().getStringExtra("keyDefaultCausaleCol"));
@@ -229,7 +227,6 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
canOverflowOrderQuantity,
mSitArtOrd,
mTestateOrdini,
mColliRegistrati,
mGestioneCol, mSegnoCol, mDefaultCausaleUL,
mEnableQuantityReset,
useQtaOrd,
@@ -822,25 +819,45 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
}
public void showCreatedUL() {
handler.post(() -> {
this.fabPopupMenu.dismiss();
this.fabPopupMenu.dismiss();
ArrayList<MtbColt> createdMtbColts = this.mViewmodel.getCreatedMtbColts();
executorService.execute(() -> {
try {
ArrayList<AlreadyRegisteredUlDTO> createdMtbColts = this.mViewmodel.getCreatedMtbColts();
Intent myIntent = ListaBancaliActivity.createIntent(this, createdMtbColts, true, false);
this.startActivityForResult(myIntent, PICK_UL_REQUEST);
handler.post(() -> {
Intent myIntent = ListaBancaliActivity.createIntent(this,
createdMtbColts.stream()
.map(AlreadyRegisteredUlDTO::getMtbColt)
.collect(Collectors.toList()),
input -> createdMtbColts.stream()
.filter(x -> x.getMtbColt().equals(input))
.findFirst()
.map(AlreadyRegisteredUlDTO::isCanBeRecovered)
.orElse(false),
false,
ReportManager.getReportNameLUFromGestione(GestioneEnum.ACQUISTO));
this.startActivityForResult(myIntent, PICK_UL_REQUEST);
});
} catch (Exception e) {
onError(e);
}
});
}
public void closeOrder() {
this.fabPopupMenu.dismiss();
this.onLoadingStarted();
executorService.execute(() -> {
try {
this.mViewmodel.closeOrder();
this.onLoadingEnded();
} catch (Exception e) {
onError(e);
}
@@ -999,7 +1016,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
.setInitialQtaTot(initialQtaTot)
.setTotalQtaOrd(totalQtaOrd)
.setTotalNumCnfOrd(totalNumCnfOrd)
.setQtaCnfOrd(qtaCnfOrd)
.setTotalQtaCnfOrd(qtaCnfOrd)
.setTotalQtaToBeTaken(totalQtaToBeTaken)
.setTotalNumCnfToBeTaken(totalNumCnfToBeTaken)
.setQtaCnfToBeTaken(qtaCnfToBeTaken)
@@ -1173,8 +1190,8 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
@Override
public void onChooseArtRequest(List<MtbAart> artsList, RunnableArgs<MtbAart> onComplete) {
new DialogChooseArtFromListaArtsView(true, artsList, onComplete)
.show(getSupportFragmentManager(), "tag");
DialogChooseArtFromListaArtsView.newInstance(true, artsList, onComplete)
.show(getSupportFragmentManager(), "dialog-choose-art");
}
@Override

View File

@@ -50,6 +50,7 @@ import it.integry.integrywmsnative.core.model.MtbColt;
import it.integry.integrywmsnative.core.model.MtbDepoPosizione;
import it.integry.integrywmsnative.core.model.MtbPartitaMag;
import it.integry.integrywmsnative.core.model.VtbVett;
import it.integry.integrywmsnative.core.model.dto.AlreadyRegisteredUlDTO;
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
import it.integry.integrywmsnative.core.model.dto.StatoArticoloDTO;
import it.integry.integrywmsnative.core.model.observable.ObservableMtbTcol;
@@ -107,7 +108,6 @@ public class SpedizioneViewModel {
private List<OrdineUscitaInevasoDTO> mTestateOrdini;
private MutableLiveData<List<PickingObjectDTO>> mPickingList = new MutableLiveData<>();
private List<MtbColt> mColliRegistrati = new ArrayList<>();
private List<MtbPartitaMag> mPartitaMagList = new ArrayList<>();
private Listener mListener;
@@ -187,12 +187,11 @@ public class SpedizioneViewModel {
}
public void init(String codMdep, boolean enableGiacenza, boolean enableCheckPartitaMag, boolean shouldAskPesoLU, boolean canOverflowOrderQuantity, List<SitArtOrdDTO> pickingList, List<OrdineUscitaInevasoDTO> testateOrdini, List<MtbColt> colliRegistrati, GestioneEnum gestioneCol, int segnoCol, Integer defaultCausaleUL, boolean enableQuantityReset, boolean useQtaOrd, boolean useColliPedana) {
public void init(String codMdep, boolean enableGiacenza, boolean enableCheckPartitaMag, boolean shouldAskPesoLU, boolean canOverflowOrderQuantity, List<SitArtOrdDTO> pickingList, List<OrdineUscitaInevasoDTO> testateOrdini, GestioneEnum gestioneCol, int segnoCol, Integer defaultCausaleUL, boolean enableQuantityReset, boolean useQtaOrd, boolean useColliPedana) {
this.sendOnLoadingStarted();
this.mDefaultCodMdep = codMdep;
this.mTestateOrdini = testateOrdini;
this.mColliRegistrati = colliRegistrati;
this.mEnableGiacenza = enableGiacenza;
this.mEnableCheckPartitaMag = enableCheckPartitaMag;
this.mCanOverflowOrderQuantity = canOverflowOrderQuantity;
@@ -342,14 +341,6 @@ public class SpedizioneViewModel {
return mIsOrdTrasf;
}
private void onOrderClosedPrintingDone() {
if (this.mIsOrdTrasf && !UtilityString.isNullOrEmpty(SettingsManager.iDB().getCodDtipOrdTrasfV())) {
this.sendCreateDocsRequest();
} else {
this.sendOnOrderClosed();
}
}
private void sendOnLoadingStarted() {
if (this.mListener != null) mListener.onLoadingStarted();
@@ -367,8 +358,23 @@ public class SpedizioneViewModel {
if (this.mListener != null) mListener.onCreateDocsRequest();
}
private void sendChooseArtRequest(List<MtbAart> mtbAarts, RunnableArgs<MtbAart> onComplete) {
if (this.mListener != null) mListener.onChooseArtRequest(mtbAarts, onComplete);
private MtbAart sendChooseArtRequest(List<MtbAart> mtbAarts) {
final CountDownLatch latch = new CountDownLatch(1);
AtomicReference<MtbAart> result = new AtomicReference<>();
mListener.onChooseArtRequest(mtbAarts, data -> {
result.set(data);
latch.countDown();
});
try {
latch.await(); // Attende che il dialog venga chiuso
return result.get();
} catch (InterruptedException e) {
this.sendError(e);
}
return null;
}
private List<MtbAart> sendChooseArtsRequest(List<MtbAart> mtbAarts) {
@@ -500,7 +506,6 @@ public class SpedizioneViewModel {
}
private Pair<Boolean, MtbDepoPosizione> sendLUPositionChangeRequest() {
final CountDownLatch latch = new CountDownLatch(1);
AtomicReference<Pair<Boolean, MtbDepoPosizione>> result = new AtomicReference<>();
@@ -518,9 +523,22 @@ public class SpedizioneViewModel {
return null;
}
private void sendBatchLotSelectionRequest(List<MtbPartitaMag> availableBatchLots, RunnableArgs<MtbPartitaMag> onComplete) {
if (this.mListener != null)
mListener.onBatchLotSelectionRequest(availableBatchLots, onComplete);
private MtbPartitaMag sendBatchLotSelectionRequest(List<MtbPartitaMag> availableBatchLots) {
final CountDownLatch latch = new CountDownLatch(1);
AtomicReference<MtbPartitaMag> result = new AtomicReference<>();
mListener.onBatchLotSelectionRequest(availableBatchLots, item -> {
result.set(item);
latch.countDown();
});
try {
latch.await(); // Attende che il dialog venga chiuso
return result.get();
} catch (InterruptedException e) {
this.sendError(e);
}
return null;
}
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO) throws Exception {
@@ -755,13 +773,9 @@ public class SpedizioneViewModel {
if (mtbAartList.size() == 1) {
this.searchArtFromAnag(mtbAartList.get(0), pickData);
} else {
this.sendChooseArtRequest(mtbAartList, art -> {
try {
this.searchArtFromAnag(art, pickData);
} catch (Exception e) {
this.sendError(e);
}
});
var art = this.sendChooseArtRequest(mtbAartList);
if (art == null) return;
this.searchArtFromAnag(art, pickData);
}
} else {
throw new NoResultFromBarcodeException(barcodeProd);
@@ -875,13 +889,14 @@ public class SpedizioneViewModel {
ObservableArrayList<MtbColr> cloneMtbColrs = cloneMtbColt.getMtbColr();
cloneMtbColt.getMtbColr().stream()
var toBeRemoved = cloneMtbColt.getMtbColr().stream()
.filter(x -> !(UtilityString.equalsIgnoreCase(x.getCodMart(), matchedObject.getSitArtOrdDTO().getCodMart()) &&
UtilityString.equalsIgnoreCase(x.getCodTagl(), matchedObject.getSitArtOrdDTO().getCodTagl()) &&
UtilityString.equalsIgnoreCase(x.getCodCol(), matchedObject.getSitArtOrdDTO().getCodCol()) &&
(!mEnableCheckPartitaMag || UtilityString.equalsIgnoreCase(x.getPartitaMag(), matchedObject.getSitArtOrdDTO().getPartitaMag()) ||
UtilityString.isNullOrEmpty(matchedObject.getSitArtOrdDTO().getPartitaMag()))))
.forEach(cloneMtbColrs::remove);
.collect(Collectors.toList());
cloneMtbColrs.removeAll(toBeRemoved);
cloneMtbColt.setMtbColr(cloneMtbColrs);
@@ -1004,24 +1019,23 @@ public class SpedizioneViewModel {
.collect(Collectors.toList()));
}
this.sendBatchLotSelectionRequest(tmp, selected -> {
this.sendOnLoadingEnded();
var selected = this.sendBatchLotSelectionRequest(tmp);
this.sendOnLoadingEnded();
if (selected != null) {
MtbColr scannedMtbColr = pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr().stream()
.filter(x -> x.getCodMart().equalsIgnoreCase(pickingObjectDTO.getMtbAart().getCodMart()) &&
((x.getPartitaMag() != null && selected.getPartitaMag() != null && x.getPartitaMag().equalsIgnoreCase(selected.getPartitaMag()))
|| (x.getPartitaMag() == null && selected.getPartitaMag() == null)))
.findFirst()
.orElse(null);
if (selected != null) {
MtbColr scannedMtbColr = pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr().stream()
.filter(x -> x.getCodMart().equalsIgnoreCase(pickingObjectDTO.getMtbAart().getCodMart()) &&
((x.getPartitaMag() != null && selected.getPartitaMag() != null && x.getPartitaMag().equalsIgnoreCase(selected.getPartitaMag()))
|| (x.getPartitaMag() == null && selected.getPartitaMag() == null)))
.findFirst()
.orElse(null);
try {
dispatchOrdineRowOnPostBatchLotSelection(pickingObjectDTO, refMtbColt, refMtbColr, scannedMtbColr, canPartitaMagBeChanged, executeImmediately);
} catch (Exception e) {
this.sendError(e);
}
try {
dispatchOrdineRowOnPostBatchLotSelection(pickingObjectDTO, refMtbColt, refMtbColr, scannedMtbColr, canPartitaMagBeChanged, executeImmediately);
} catch (Exception e) {
this.sendError(e);
}
});
}
} else {
dispatchOrdineRowOnPostBatchLotSelection(pickingObjectDTO, refMtbColt, refMtbColr, scannedMtbColrs.get(0), canPartitaMagBeChanged, executeImmediately);
@@ -1722,13 +1736,8 @@ public class SpedizioneViewModel {
var positionedMtbColts = this.askPositionChange(filledMtbColts);
this.askPrint((shouldPrint && SettingsManager.iDB().isFlagPrintEtichetteOnLUClose()), positionedMtbColts);
positionedMtbColts.stream()
.filter(x -> !this.mColliRegistrati.contains(x))
.forEach(x -> this.mColliRegistrati.add(x));
postCloseOperations(positionedMtbColts);
this.mIsNewLU = false;
@@ -2106,15 +2115,21 @@ public class SpedizioneViewModel {
}
public void closeOrder() {
this.sendOnLoadingStarted();
if (SettingsManager.iDB().isFlagPrintEtichetteOnOrderClose() || SettingsManager.iDB().isFlagPrintPackingListOnOrderClose()) {
var printRequestResult = this.sendOnCloseOrderPrintRequest();
this.onCloseOrderPrintRequest(printRequestResult);
this.onCloseOrderPrintRequested(printRequestResult);
}
this.onOrderClosedPrintingDone();
if (this.mIsOrdTrasf && !UtilityString.isNullOrEmpty(SettingsManager.iDB().getCodDtipOrdTrasfV())) {
this.sendCreateDocsRequest();
}
this.sendOnOrderClosed();
}
private void onCloseOrderPrintRequest(PrintOrderCloseDTO dto) {
private void onCloseOrderPrintRequested(PrintOrderCloseDTO dto) {
if (!dto.isFlagPrintPackingList() && !dto.isFlagPrintSSCC()) {
return;
}
@@ -2130,13 +2145,22 @@ public class SpedizioneViewModel {
dto.setPrintList(closedOrders);
CountDownLatch latch = new CountDownLatch(1);
try {
printClosedOrders(dto);
latch.countDown();
} catch (Exception e) {
this.sendLUPrintError(e, () -> {
latch.countDown();
});
}
try {
latch.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
private void printClosedOrders(PrintOrderCloseDTO dto) throws Exception {
@@ -2169,8 +2193,8 @@ public class SpedizioneViewModel {
return mPartitaMagList;
}
public ArrayList<MtbColt> getCreatedMtbColts() {
return (ArrayList<MtbColt>) this.mColliRegistrati;
public ArrayList<AlreadyRegisteredUlDTO> getCreatedMtbColts() throws Exception {
return (ArrayList<AlreadyRegisteredUlDTO>) this.mOrdiniRestConsumerService.getBancaliGiaRegistratiSynchronized(mTestateOrdini, mDefaultSegnoCol);
}
public VtbVett getDefaultVettore() {
@@ -2178,30 +2202,51 @@ public class SpedizioneViewModel {
}
void createDocs() {
var loadCollidto = new LoadColliDTO();
executorService.execute(() -> {
this.sendOnLoadingStarted();
List<MtbColt> registeredUds = null;
var codAnag = mTestateOrdini.stream()
.map(OrdineUscitaInevasoDTO::getCodAnagOrd)
.filter(Objects::nonNull)
.distinct()
.findFirst()
.get();
try {
var alreadyCreatedUds = getCreatedMtbColts();
registeredUds = alreadyCreatedUds.stream()
.map(AlreadyRegisteredUlDTO::getMtbColt)
.collect(Collectors.toList());
} catch (Exception e) {
sendError(e);
return;
}
var codVdes = mTestateOrdini.stream().map(OrdineUscitaInevasoDTO::getCodVdes)
.filter(Objects::nonNull)
.distinct()
.findFirst()
.get();
var loadCollidto = new LoadColliDTO();
loadCollidto.setColli(getCreatedMtbColts());
loadCollidto.setCodDtip(SettingsManager.iDB().getCodDtipOrdTrasfV());
loadCollidto.setCodMdep(mDefaultCodMdep);
loadCollidto.setCodAnag(codAnag);
loadCollidto.setCodVdes(codVdes);
loadCollidto.setSaveDoc(true);
loadCollidto.setGestione("L");
var codAnag = mTestateOrdini.stream()
.map(OrdineUscitaInevasoDTO::getCodAnagOrd)
.filter(Objects::nonNull)
.distinct()
.findFirst()
.get();
this.mDocumentRESTConsumer.createDocFromColli(loadCollidto, doc -> this.sendOnOrderClosed(), this::sendError);
var codVdes = mTestateOrdini.stream()
.map(OrdineUscitaInevasoDTO::getCodVdes)
.filter(Objects::nonNull)
.distinct()
.findFirst()
.get();
loadCollidto.setColli(registeredUds);
loadCollidto.setCodDtip(SettingsManager.iDB().getCodDtipOrdTrasfV());
loadCollidto.setCodMdep(mDefaultCodMdep);
loadCollidto.setCodAnag(codAnag);
loadCollidto.setCodVdes(codVdes);
loadCollidto.setSaveDoc(true);
loadCollidto.setGestione("L");
try {
this.mDocumentRESTConsumer.makeSynchronousCreateDocFromColliRequest(loadCollidto);
} catch (Exception e) {
sendError(e);
}
this.sendOnLoadingEnded();
});
}
private Integer sendInputDuplicate() {

View File

@@ -112,10 +112,14 @@ public class UltimeConsegneClienteFragment extends BaseFragment implements Ultim
public void openFilterDialog() {
this.mViewModel.loadCodAnagClienti(gtbAnags -> {
DialogUltimeConsegneFiltroAvanzato.make(getActivity(), gtbAnags, mAppliedFilterViewModel, (filter) -> {
mAppliedFilterViewModel = filter;
refreshItems();
}).show();
handler.post(() -> {
DialogUltimeConsegneFiltroAvanzato.make(getActivity(), gtbAnags, mAppliedFilterViewModel, (filter) -> {
mAppliedFilterViewModel = filter;
refreshItems();
}).show();
});
});
}
@@ -132,7 +136,7 @@ public class UltimeConsegneClienteFragment extends BaseFragment implements Ultim
// mBindings.fastscroll.setRecyclerView(mBindings.recyclerView);
if(mToolbar != null)
if (mToolbar != null)
mToolbar.setRecyclerView(mBindings.recyclerView);
}

View File

@@ -9,7 +9,6 @@ import android.view.WindowManager;
import android.widget.ArrayAdapter;
import androidx.appcompat.app.AlertDialog;
import androidx.databinding.DataBindingUtil;
import com.annimon.stream.Stream;
import com.annimon.stream.function.Predicate;
@@ -65,7 +64,7 @@ public class DialogUltimeConsegneFiltroAvanzato {
DialogUltimeConsegneFiltroAvanzatoViewModel viewModel = baseViewModel != null ? baseViewModel : new DialogUltimeConsegneFiltroAvanzatoViewModel();
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
DialogUltimeConsegneFiltroAvanzatoBinding binding = DataBindingUtil.inflate(inflater, R.layout.dialog_ultime_consegne_filtro_avanzato, null, false);
DialogUltimeConsegneFiltroAvanzatoBinding binding = DialogUltimeConsegneFiltroAvanzatoBinding.inflate(inflater, null, false);
final AlertDialog.Builder dialog = new AlertDialog.Builder(context)
.setView(binding.getRoot());

View File

@@ -117,10 +117,12 @@ public class UltimiArriviFornitoreFragment extends BaseFragment implements ITitl
public void openFilterDialog() {
this.mViewModel.loadCodAnagFornitori(gtbAnags -> {
DialogUltimiArriviFornitoreFiltroAvanzato.make(getActivity(), gtbAnags, mAppliedFilterViewModel, (filter) -> {
mAppliedFilterViewModel = filter;
filterItems(null);
}).show();
handler.post(() -> {
DialogUltimiArriviFornitoreFiltroAvanzato.make(getActivity(), gtbAnags, mAppliedFilterViewModel, (filter) -> {
mAppliedFilterViewModel = filter;
filterItems(null);
}).show();
});
});
}
@@ -259,7 +261,7 @@ public class UltimiArriviFornitoreFragment extends BaseFragment implements ITitl
.newInstance(scannedMtbColt.getMtbColr(), items -> {
List<MtbAart> mtbAarts = new ArrayList<>();
if(items != null && !items.isEmpty()) {
if (items != null && !items.isEmpty()) {
mtbAarts = Stream.of(items)
.map(MtbColr::getMtbAart)
.toList();

View File

@@ -9,7 +9,6 @@ import android.view.WindowManager;
import android.widget.ArrayAdapter;
import androidx.appcompat.app.AlertDialog;
import androidx.databinding.DataBindingUtil;
import com.annimon.stream.Stream;
import com.annimon.stream.function.Predicate;
@@ -63,7 +62,7 @@ public class DialogUltimiArriviFornitoreFiltroAvanzato {
DialogUltimiArriviFiltroAvanzatoViewModel viewModel = baseViewModel != null ? baseViewModel : new DialogUltimiArriviFiltroAvanzatoViewModel();
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
DialogUltimiArriviFornitoreFiltroAvanzatoBinding binding = DataBindingUtil.inflate(inflater, R.layout.dialog_ultimi_arrivi_fornitore_filtro_avanzato, null, false);
DialogUltimiArriviFornitoreFiltroAvanzatoBinding binding = DialogUltimiArriviFornitoreFiltroAvanzatoBinding.inflate(inflater,null, false);
final AlertDialog.Builder dialog = new AlertDialog.Builder(context)
.setView(binding.getRoot());

View File

@@ -4,6 +4,7 @@ import android.content.DialogInterface;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -63,6 +64,9 @@ public class DialogAskClienteView extends BaseDialogFragment {
@Inject
DialogProgressView dialogProgressView;
@Inject
Handler handler;
public static DialogAskClienteView newInstance(@NotNull RunnableArgss<VtbDest, String> onComplete, @NotNull Runnable onAbort) {
return new DialogAskClienteView(onComplete, onAbort);
}
@@ -119,6 +123,8 @@ public class DialogAskClienteView extends BaseDialogFragment {
DialogAskCliente_Page1ViewModel viewModel1 = (DialogAskCliente_Page1ViewModel) mAdapter.getViewModel(R.layout.dialog_ask_cliente__page1);
DialogAskCliente_Page2ViewModel viewModel2 = (DialogAskCliente_Page2ViewModel) mAdapter.getViewModel(R.layout.dialog_ask_cliente__page2);
viewModel1.setHandler(handler);
viewModel1.setOnConfirmClickListener(() -> {
String codAnag = viewModel1.getCurrentCliente();

View File

@@ -1,6 +1,7 @@
package it.integry.integrywmsnative.view.dialogs.ask_cliente.viewmodel;
import android.content.Context;
import android.os.Handler;
import android.widget.AutoCompleteTextView;
import androidx.databinding.ObservableArrayList;
@@ -37,9 +38,15 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
private Runnable onConfirmClickListener;
private Runnable onAbortClickListener;
private Handler handler;
public DialogAskCliente_Page1ViewModel() {
}
public void setHandler(Handler handler){
this.handler = handler;
}
@Override
public void setContext(Context context) {
this.mContext = context;
@@ -147,33 +154,33 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
private void initializeAdapter(ArrayList<DialogAskClienteClienteDTO> items) {
handler.post(() -> {
var orderedList = Stream.of(items)
.sortBy(x -> x.getRagSoc() != null ? x.getRagSoc() : "")
.toList();
var orderedList = Stream.of(items)
.sortBy(x -> x.getRagSoc() != null ? x.getRagSoc() : "")
.toList();
DialogAskCliente_Page1_Cliente_ArrayAdapter adapter = new DialogAskCliente_Page1_Cliente_ArrayAdapter(mContext, orderedList);
DialogAskCliente_Page1_Cliente_ArrayAdapter adapter = new DialogAskCliente_Page1_Cliente_ArrayAdapter(mContext, orderedList);
AutoCompleteTextView editTextDropdownCliente = mBinding.dropdownCliente;
editTextDropdownCliente.setThreshold(0);
editTextDropdownCliente.setAdapter(adapter);
editTextDropdownCliente.setOnItemClickListener((parent, view, position, id) -> {
refreshCodJcoms(items.get(position));
});
AutoCompleteTextView editTextDropdownCliente = mBinding.dropdownCliente;
editTextDropdownCliente.setThreshold(0);
editTextDropdownCliente.setAdapter(adapter);
editTextDropdownCliente.setOnItemClickListener((parent, view, position, id) -> {
refreshCodJcoms(items.get(position));
});
DialogAskCliente_Page1_Commessa_ArrayAdapter commessaAdapter = new DialogAskCliente_Page1_Commessa_ArrayAdapter(mContext);
AutoCompleteTextView editTextDropdownCommessa = mBinding.dropdownCommessa;
editTextDropdownCommessa.setThreshold(0);
editTextDropdownCommessa.setAdapter(commessaAdapter);
DialogAskCliente_Page1_Commessa_ArrayAdapter commessaAdapter = new DialogAskCliente_Page1_Commessa_ArrayAdapter(mContext);
AutoCompleteTextView editTextDropdownCommessa = mBinding.dropdownCommessa;
editTextDropdownCommessa.setThreshold(0);
editTextDropdownCommessa.setAdapter(commessaAdapter);
codJcoms.addOnListChangedCallback(new OnListGeneralChangedCallback() {
@Override
public void onChanged(ObservableList sender) {
commessaAdapter.clear();
commessaAdapter.addAll(codJcoms);
}
codJcoms.addOnListChangedCallback(new OnListGeneralChangedCallback() {
@Override
public void onChanged(ObservableList sender) {
commessaAdapter.clear();
commessaAdapter.addAll(codJcoms);
}
});
});
}

View File

@@ -4,6 +4,7 @@ import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
@@ -43,6 +44,10 @@ public class DialogAskPositionOfLUView extends BaseDialogFragment {
@Inject
DialogAskPositionOfLUViewModel mViewModel;
@Inject
Handler handler;
private DialogAskPositionOfLuBinding mBindings;
private DialogAskPositionOfLUAdapter viewpagerAdapter;
private Context mContext;
@@ -201,12 +206,17 @@ public class DialogAskPositionOfLUView extends BaseDialogFragment {
} else {
BarcodeManager.enable(mBarcodeScannerInstanceID);
Toast.makeText(requireContext(), "Barcode non riconosciuto", Toast.LENGTH_SHORT)
.show();
handler.post(() -> {
Toast.makeText(requireContext(), "Barcode non riconosciuto", Toast.LENGTH_SHORT)
.show();
});
}
} else {
Toast.makeText(requireContext(), "Barcode non riconosciuto", Toast.LENGTH_SHORT)
.show();
handler.post(() -> {
Toast.makeText(requireContext(), "Barcode non riconosciuto", Toast.LENGTH_SHORT)
.show();
});
BarcodeManager.enable(mBarcodeScannerInstanceID);
}
};

View File

@@ -1,5 +1,7 @@
package it.integry.integrywmsnative.view.dialogs.basket_lu;
import android.os.Handler;
import dagger.Module;
import dagger.Provides;
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
@@ -10,8 +12,8 @@ import it.integry.integrywmsnative.view.dialogs.basket_lu.pages.page2.DialogBask
public class DialogBasketLUModule {
@Provides
DialogBasketLU_Page1_ViewModel providesDialogBasketLUPage1ViewModel(ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer) {
return new DialogBasketLU_Page1_ViewModel(colliMagazzinoRESTConsumer);
DialogBasketLU_Page1_ViewModel providesDialogBasketLUPage1ViewModel(ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, Handler handler) {
return new DialogBasketLU_Page1_ViewModel(colliMagazzinoRESTConsumer, handler);
}
@Provides

View File

@@ -2,6 +2,7 @@ package it.integry.integrywmsnative.view.dialogs.basket_lu;
import android.app.Dialog;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import androidx.annotation.NonNull;
@@ -36,7 +37,8 @@ public class DialogBasketLUView extends BaseDialogFragment {
private final RunnableArgs<MtbColt> mOnComplete;
private DialogBasketLuBinding mBindings;
@Inject
Handler handler;
public DialogBasketLUView(RunnableArgs<MtbColt> onComplete) {
mOnComplete = onComplete;
@@ -52,7 +54,7 @@ public class DialogBasketLUView extends BaseDialogFragment {
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
mBindings = DialogBasketLuBinding.inflate(LayoutInflater.from(requireContext()), null, false);
var alertDialog = new MaterialAlertDialogBuilder(requireContext())
var alertDialog = new MaterialAlertDialogBuilder(requireContext())
.setView(mBindings.getRoot())
.setCancelable(false)
.create();

View File

@@ -1,6 +1,7 @@
package it.integry.integrywmsnative.view.dialogs.basket_lu.pages.page1;
import android.content.Context;
import android.os.Handler;
import android.view.View;
import androidx.core.content.ContextCompat;
@@ -30,9 +31,12 @@ public class DialogBasketLU_Page1_ViewModel extends DialogBasketLU_BaseViewModel
private final ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer;
private final Handler handler;
@Inject
public DialogBasketLU_Page1_ViewModel(ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer) {
public DialogBasketLU_Page1_ViewModel(ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer, Handler handler) {
this.colliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
this.handler = handler;
}
@Override
@@ -53,16 +57,19 @@ public class DialogBasketLU_Page1_ViewModel extends DialogBasketLU_BaseViewModel
@Override
public void onShow() {
this.mBinding.getRoot().requestLayout();
mBinding.constraintLayout.setMaxHeight((int) (mContext.getResources().getDisplayMetrics().heightPixels * 0.75));
colliMagazzinoRESTConsumer.retrieveBasketColli(mtbColts -> {
availableMtbColts = mtbColts;
if(mtbColts != null && !mtbColts.isEmpty()) initRecyclerView(availableMtbColts);
handler.post(() -> {
availableMtbColts = mtbColts;
if(mtbColts != null && !mtbColts.isEmpty()) initRecyclerView(availableMtbColts);
mBinding.emptyView.setVisibility(mtbColts != null && !mtbColts.isEmpty() ? View.GONE : View.VISIBLE);
mBinding.emptyView.setVisibility(mtbColts != null && !mtbColts.isEmpty() ? View.GONE : View.VISIBLE);
});
}, ex -> {
mBinding.emptyView.setVisibility(View.VISIBLE);
handler.post(() -> {
mBinding.emptyView.setVisibility(View.VISIBLE);
});
});
}

View File

@@ -1,77 +0,0 @@
package it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_arts;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import it.integry.integrywmsnative.R;
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
import it.integry.integrywmsnative.core.model.MtbAart;
import it.integry.integrywmsnative.databinding.DialogChooseArtFromListaArtItemModelBinding;
public class DialogChooseArtFromListaArtsAdapter extends RecyclerView.Adapter<DialogChooseArtFromListaArtsAdapter.ViewHolder> {
protected Context mContext;
private List<MtbAart> mDataset;
private final IRecyclerItemClicked<MtbAart> mOnItemClickListener;
public static class ViewHolder extends RecyclerView.ViewHolder {
protected DialogChooseArtFromListaArtItemModelBinding mViewDataBinding;
public ViewHolder(DialogChooseArtFromListaArtItemModelBinding v) {
super(v.getRoot());
mViewDataBinding = v;
}
public void bind(MtbAart mtbAart) {
mViewDataBinding.setItem(mtbAart);
mViewDataBinding.executePendingBindings();
}
}
public DialogChooseArtFromListaArtsAdapter(Context context, List<MtbAart> myDataset, IRecyclerItemClicked<MtbAart> onItemClickListener) {
mContext = context;
mDataset = myDataset;
mOnItemClickListener = onItemClickListener;
}
@Override
public DialogChooseArtFromListaArtsAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
// create a new view
DialogChooseArtFromListaArtItemModelBinding viewDataBinding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.dialog_choose_art_from_lista_art__item_model, parent, false);
return new ViewHolder(viewDataBinding);
}
@Override
public void onBindViewHolder(DialogChooseArtFromListaArtsAdapter.ViewHolder holder, int position) {
MtbAart item = mDataset.get(position);
holder.bind(item);
holder.mViewDataBinding.getRoot().setOnClickListener(x -> {
if(mOnItemClickListener != null) {
mOnItemClickListener.onItemClick(item, position);
}
});
}
@Override
public void onViewRecycled(DialogChooseArtFromListaArtsAdapter.ViewHolder holder) {
super.onViewRecycled(holder);
}
@Override
public int getItemCount() {
return mDataset.size();
}
}

View File

@@ -0,0 +1,14 @@
package it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_arts;
import dagger.Subcomponent;
@Subcomponent
public interface DialogChooseArtFromListaArtsComponent {
@Subcomponent.Factory
interface Factory {
DialogChooseArtFromListaArtsComponent create();
}
void inject(DialogChooseArtFromListaArtsView dialogChooseArtFromListaArtsView);
}

View File

@@ -0,0 +1,14 @@
package it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_arts;
import dagger.Module;
import dagger.Provides;
@Module(subcomponents = DialogChooseArtFromListaArtsComponent.class)
public class DialogChooseArtFromListaArtsModule {
@Provides
DialogChooseArtFromListaArtsViewModel providesDialogChooseArtFromListaArtsViewModel() {
return new DialogChooseArtFromListaArtsViewModel();
}
}

View File

@@ -1,6 +1,8 @@
package it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_arts;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;
@@ -10,76 +12,116 @@ import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.ravikoradiya.liveadapter.LiveAdapter;
import com.ravikoradiya.liveadapter.Type;
import java.util.List;
import java.util.Objects;
import javax.inject.Inject;
import it.integry.integrywmsnative.BR;
import it.integry.integrywmsnative.MainApplication;
import it.integry.integrywmsnative.R;
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
import it.integry.integrywmsnative.core.model.MtbAart;
import it.integry.integrywmsnative.databinding.DialogChooseArtFromListaArtBinding;
import it.integry.integrywmsnative.databinding.DialogChooseArtFromListaArtItemModelBinding;
import it.integry.integrywmsnative.databinding.DialogChooseArtFromListaArtsBinding;
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
import kotlin.Unit;
public class DialogChooseArtFromListaArtsView extends BaseDialogFragment {
@Inject
DialogChooseArtFromListaArtsViewModel mViewModel;
private DialogChooseArtFromListaArtsBinding mBindings;
private Context mContext;
private final RunnableArgs<MtbAart> onComplete;
private final boolean mEnableSelection;
private final List<MtbAart> mListaArts;
private final RunnableArgs<MtbAart> mOnItemChoosed;
//Pass here all external parameters
public static DialogChooseArtFromListaArtsView newInstance(boolean enableSelection, List<MtbAart> listaArts, RunnableArgs<MtbAart> onComplete) {
return new DialogChooseArtFromListaArtsView(enableSelection, listaArts, onComplete);
}
public DialogChooseArtFromListaArtsView(boolean enableSelection, List<MtbAart> listaArts, RunnableArgs<MtbAart> onItemChoosed) {
private DialogChooseArtFromListaArtsView(boolean enableSelection, List<MtbAart> listaArts, RunnableArgs<MtbAart> onComplete) {
super();
this.onComplete = onComplete;
this.mEnableSelection = enableSelection;
this.mListaArts = listaArts;
this.mOnItemChoosed = onItemChoosed;
MainApplication.appComponent
.dialogChooseArtFromListaArtsComponent()
.create()
.inject(this);
}
@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
var binding = DialogChooseArtFromListaArtBinding.inflate(LayoutInflater.from(requireContext()));
this.mContext = requireContext();
binding.titleText.setText(this.mEnableSelection ? R.string.dialog_choose_art_from_lista_art :
mBindings = DialogChooseArtFromListaArtsBinding.inflate(LayoutInflater.from(this.mContext), null, false);
mBindings.setLifecycleOwner(this);
mBindings.titleText.setText(this.mEnableSelection ? R.string.dialog_choose_art_from_lista_art :
R.string.articoli_disponibili);
initRecyclerView(binding, mListaArts);
initRecyclerView(mBindings, mListaArts);
setCancelable(false);
setCancelable(true);
var alertDialog = new MaterialAlertDialogBuilder(requireContext())
.setView(binding.getRoot())
var alertDialog = new MaterialAlertDialogBuilder(this.mContext)
.setView(mBindings.getRoot())
.setCancelable(isCancelable())
.create();
alertDialog.setCanceledOnTouchOutside(isCancelable());
alertDialog.setOnShowListener(this);
alertDialog.setOnDismissListener(this);
return alertDialog;
}
private void initRecyclerView(DialogChooseArtFromListaArtBinding binding, List<MtbAart> dataset) {
@Override
public void dismiss() {
dismiss(null);
}
@Override
public void onDismiss(@NonNull DialogInterface dialog) {
//dismiss();
}
public void dismiss(MtbAart item) {
if (getDialog() != null) getDialog().dismiss();
onComplete.run(item);
}
private void initRecyclerView(DialogChooseArtFromListaArtsBinding binding, List<MtbAart> dataset) {
binding.itemsList.setNestedScrollingEnabled(false);
binding.itemsList.setHasFixedSize(true);
binding.itemsList.setLayoutManager(new LinearLayoutManager(requireContext()));
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(requireContext(), SimpleDividerItemDecoration.VERTICAL);
itemDecorator.setDrawable(ContextCompat.getDrawable(requireContext(), R.drawable.divider));
itemDecorator.setDrawable(Objects.requireNonNull(ContextCompat.getDrawable(requireContext(), R.drawable.divider)));
binding.itemsList.addItemDecoration(itemDecorator);
IRecyclerItemClicked<MtbAart> onItemClickListener = (item, position) -> {
if (mOnItemChoosed != null) {
mOnItemChoosed.run(item);
}
var itemType = new Type<MtbAart, DialogChooseArtFromListaArtItemModelBinding>(R.layout.dialog_choose_art_from_lista_art__item_model, BR.item);
dismiss();
};
itemType.onClick(x -> {
dismiss(x.getBinding().getItem());
return null;
});
DialogChooseArtFromListaArtsAdapter mCurrentAdapter = new DialogChooseArtFromListaArtsAdapter(
requireContext(), dataset, this.mEnableSelection ? onItemClickListener : null);
binding.itemsList.setAdapter(mCurrentAdapter);
new LiveAdapter(dataset, BR.item)
.map(MtbAart.class, itemType)
.onNoData(noData -> {
// mBindings.emptyView.setVisibility(noData ? View.VISIBLE : View.GONE);
return Unit.INSTANCE;
})
.into(this.mBindings.itemsList);
}
}
}

View File

@@ -0,0 +1,5 @@
package it.integry.integrywmsnative.view.dialogs.choose_art_from_lista_arts;
public class DialogChooseArtFromListaArtsViewModel {
}

View File

@@ -20,7 +20,7 @@ public class DialogInputQuantityV2DTO {
private BigDecimal totalQtaOrd;
private BigDecimal totalNumCnfOrd;
private BigDecimal qtaCnfOrd;
private BigDecimal totalQtaCnfOrd;
private BigDecimal totalQtaInWarehouse;
private BigDecimal totalNumCnfInWarehouse;
@@ -41,6 +41,7 @@ public class DialogInputQuantityV2DTO {
private boolean isNotesAllowed = false;
private boolean isNotesMandatory = false;
private boolean isNumCnfEditable = true;
private boolean isQtaTotEditable = true;
private boolean isFocusOnStart = true;
private boolean canLUBeClosed;
private boolean saveOnImeDone = false;
@@ -116,12 +117,12 @@ public class DialogInputQuantityV2DTO {
return this;
}
public BigDecimal getQtaCnfOrd() {
return UtilityBigDecimal.round(qtaCnfOrd);
public BigDecimal getTotalQtaCnfOrd() {
return UtilityBigDecimal.round(totalQtaCnfOrd);
}
public DialogInputQuantityV2DTO setQtaCnfOrd(BigDecimal qtaCnfOrd) {
this.qtaCnfOrd = qtaCnfOrd;
public DialogInputQuantityV2DTO setTotalQtaCnfOrd(BigDecimal totalQtaCnfOrd) {
this.totalQtaCnfOrd = totalQtaCnfOrd;
return this;
}
@@ -323,6 +324,15 @@ public class DialogInputQuantityV2DTO {
return this;
}
public boolean isQtaTotEditable() {
return isQtaTotEditable;
}
public DialogInputQuantityV2DTO setQtaTotEditable(boolean qtaTotEditable) {
this.isQtaTotEditable = qtaTotEditable;
return this;
}
public RunnableArgsWithReturn<DialogInputQuantityV2ViewModel, String> getSuggestPartitaMag() {
return suggestPartitaMag;
}

View File

@@ -162,7 +162,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
.setTotalNumCnfCommitted(mDialogInputQuantityV2DTO.getTotalNumCnfCommitted())
.setTotalNumCnfOrd(mDialogInputQuantityV2DTO.getTotalNumCnfOrd())
.setTotalQtaOrd(mDialogInputQuantityV2DTO.getTotalQtaOrd())
.setQtaCnfOrd(mDialogInputQuantityV2DTO.getQtaCnfOrd())
.setQtaCnfOrd(mDialogInputQuantityV2DTO.getTotalQtaCnfOrd())
.setTotalNumCnfToBeTaken(mDialogInputQuantityV2DTO.getTotalNumCnfToBeTaken())
.setTotalQtaToBeTaken(mDialogInputQuantityV2DTO.getTotalQtaToBeTaken())
.setQtaCnfToBeTaken(mDialogInputQuantityV2DTO.getQtaCnfToBeTaken())
@@ -255,9 +255,9 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
}
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
this.onLoadingStarted();
handler.post(() -> {
this.onLoadingStarted();
executorService.execute(() -> {
try {
this.mViewModel.processBarcodeDTO(data);
this.onLoadingEnded();
@@ -397,7 +397,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
toggleTextInputLayoutError(textColorsNumCnf, this.mBindings.inputNumCnfLayout, value);
if (this.mViewModel.mtbAart.get().isFlagQtaCnfFissaBoolean()) {
this.enabledQtaTot.set(!value);
this.enabledQtaTot.set(this.mDialogInputQuantityV2DTO.isQtaTotEditable() && !value);
} else {
if (value) {
if (this.mViewModel.blockedQtaCnf.get()) {
@@ -407,7 +407,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
}
} else {
if (!this.enabledQtaTot.get()) {
this.enabledQtaTot.set(true);
this.enabledQtaTot.set(this.mDialogInputQuantityV2DTO.isQtaTotEditable());
} else if (!this.enabledQtaCnf.get()) {
this.enabledQtaCnf.set(true);
}
@@ -426,7 +426,7 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
}
} else {
if (!this.enabledQtaTot.get()) {
this.enabledQtaTot.set(true);
this.enabledQtaTot.set(this.mDialogInputQuantityV2DTO.isQtaTotEditable());
} else if (!this.enabledNumCnf.get()) {
this.enabledNumCnf.set(this.mDialogInputQuantityV2DTO.isNumCnfEditable());
}
@@ -510,10 +510,10 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
this.enabledLUCloseButton.set(this.mDialogInputQuantityV2DTO.isCanLUBeClosed());
this.currentTaraArticolo.set(this.mViewModel.getMtbAart().getTaraKg() != null ? this.mViewModel.getMtbAart().getTaraKg() : BigDecimal.ZERO);
if (this.mDialogInputQuantityV2DTO.getMtbAart().isFlagQtaCnfFissaBoolean() && this.mDialogInputQuantityV2DTO.getTotalQtaOrd() != null && !this.mDialogInputQuantityV2DTO.getTotalQtaOrd().equals(BigDecimal.ZERO) && !(this.mDialogInputQuantityV2DTO.getQtaCnfOrd().compareTo(BigDecimal.ZERO) == 0)) {
int numCnftoTake = this.mDialogInputQuantityV2DTO.getTotalQtaOrd().divide(this.mDialogInputQuantityV2DTO.getQtaCnfOrd(), 0, RoundingMode.DOWN).intValue();
if (this.mDialogInputQuantityV2DTO.getMtbAart().isFlagQtaCnfFissaBoolean() && this.mDialogInputQuantityV2DTO.getTotalQtaOrd() != null && !this.mDialogInputQuantityV2DTO.getTotalQtaOrd().equals(BigDecimal.ZERO) && !(this.mDialogInputQuantityV2DTO.getTotalQtaCnfOrd().compareTo(BigDecimal.ZERO) == 0)) {
int numCnftoTake = this.mDialogInputQuantityV2DTO.getTotalQtaOrd().divide(this.mDialogInputQuantityV2DTO.getTotalQtaCnfOrd(), 0, RoundingMode.DOWN).intValue();
this.currentTextNumCnfToTake.set(numCnftoTake);
int qtaText = this.mDialogInputQuantityV2DTO.getTotalQtaOrd().remainder(this.mDialogInputQuantityV2DTO.getQtaCnfOrd()).intValue();
int qtaText = this.mDialogInputQuantityV2DTO.getTotalQtaOrd().remainder(this.mDialogInputQuantityV2DTO.getTotalQtaCnfOrd()).intValue();
this.currentTextNumPezziToTake.set(qtaText);
} else {
this.currentTextNumCnfToTake.set(0);

View File

@@ -182,7 +182,7 @@ public class DialogScanOrCreateLUViewModel {
} else {
var createUdcRequest = new CreateUDCRequestDTO()
.setBarcodeUl(barcodeScanDTO.getStringValue())
.setBarcodeUl(ean128Model.Sscc)
.setCodMdep(SettingsManager.i().getUserSession().getDepo().getCodMdep());
this.mColliLavorazioneRESTConsumer.createUDC(createUdcRequest, createdMtbColt -> {

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
app:cardCornerRadius="16dp"
app:cardElevation="0dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingVertical="16dp">
<androidx.appcompat.widget.AppCompatImageView
style="@style/MaterialAlertDialog.Material3.Title.Icon.CenterStacked"
android:layout_width="36dp"
android:layout_height="36dp"
android:src="@drawable/ic_error_white_24dp"
app:tint="?colorPrimary" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/title_text"
style="@style/MaterialAlertDialog.Material3.Title.Text.CenterStacked"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_marginBottom="16dp"
android:text="@string/dialog_choose_art_from_lista_art" />
<androidx.appcompat.widget.SearchView
android:id="@+id/search_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:backgroundTint="@android:color/white"
android:hint="@string/search"
app:iconifiedByDefault="false"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/items_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="false"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/dialog_choose_art_from_lista_art__item_model"
tools:itemCount="5"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.cardview.widget.CardView>
</layout>

View File

@@ -3,7 +3,7 @@
buildscript {
ext {
kotlin_version = '2.1.0'
agp_version = '8.8.0'
agp_version = '8.10.0'
}
repositories {

View File

@@ -14,18 +14,11 @@
android.useAndroidX=true
android.enableJetifier=true
# android.enableSeparateAnnotationProcessing = true
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# Enable Gradle Daemon
org.gradle.daemon=true
org.gradle.daemon=false
# Enable Configure on demand
org.gradle.configureondemand=true
# Enable parallel builds
@@ -33,5 +26,5 @@ org.gradle.parallel=true
# Enable simple gradle caching
org.gradle.caching=true
# Increase memory allotted to JVM
org.gradle.jvmargs=-Xmx4096m -XX:+UseParallelGC
org.gradle.unsafe.configuration-cache=true
org.gradle.jvmargs=-Xmx2048m -XX:+UseParallelGC -XX:MaxMetaspaceSize=512m
org.gradle.unsafe.configuration-cache=ON

Binary file not shown.

View File

@@ -1,6 +1,7 @@
#Mon Feb 13 15:14:43 CET 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

320
gradlew vendored
View File

@@ -1,74 +1,130 @@
#!/usr/bin/env bash
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Attempt to set APP_HOME
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn ( ) {
warn () {
echo "$*"
}
} >&2
die ( ) {
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -77,84 +133,120 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

88
gradlew.bat vendored
View File

@@ -1,4 +1,22 @@
@if "%DEBUG%" == "" @echo off
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -8,26 +26,30 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@@ -35,54 +57,36 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal