diff --git a/.idea/misc.xml b/.idea/misc.xml
index ac1b3c97..40015792 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -23,9 +23,12 @@
+
+
+
@@ -84,8 +87,10 @@
+
+
@@ -100,11 +105,14 @@
+
+
+
diff --git a/app/build.gradle b/app/build.gradle
index 7346908c..49cf214d 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -14,10 +14,11 @@ android {
applicationId "es.verdnatura"
minSdkVersion 21
targetSdkVersion 29
- versionCode 74
- versionName "6.1.8.5" //VERSION CODE 74 . Modificado itemtrash, deprecated preferenceManager, quitados ;,puesto menu general al controlador
- //versionName "6.1.8.4.1" //VERSION CODE 73 . Modificar itemtrash
- //versionName "6.1.8.4" //VERSION CODE 72 . Se añade ExpedtionScan para el Sorter, y modificion llamadas itemtrash y collectionGetTicket.
+ versionCode 76
+ versionName "6.1.9" //Sin subir, Modificado y añadido mensajes de error, añadido opcion Dia de venta y su parking, teclado numerico para controlador
+ // versionName "6.1.8.5" VERSION CODE 75 // 23-10-2021//VERSION CODE 74-75 .Pantalla "Dia de venta y parking" Modificado itemtrash, deprecated preferenceManager, quitados ;,puesto menu general al controlador
+ //versionName "6.1.8.4.1" //VERSION CODE 73 . Modificar itemtrash
+ //versionName "6.1.8.4" //VERSION CODE 72 . Se añade ExpedtionScan para el Sorter, y modificion llamadas itemtrash y collectionGetTicket.
//versionName "6.1.8.3.1"//(VERSION CODE 71) Se añade ViewModel.collectionGet cuando se hace un collectionNew y un refresco de adapter
//versionName "6.1.8.3" //(VERSION CODE 69) Tres campos más en pantalla cel1,cel2,cel3, obtener artículos similares con filtro, mostrar foto del sacador.
//versionName "6.1.8.2" //(VERSIONCODE 68) Menu Operaciones buffer, pantalla mas grande en control vehiculo, deletefragments a todos los menus.
diff --git a/app/release/app-release.apk b/app/release/app-release.apk
deleted file mode 100644
index 719dc287..00000000
Binary files a/app/release/app-release.apk and /dev/null differ
diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json
index 9816e6c1..de0f8c09 100644
--- a/app/release/output-metadata.json
+++ b/app/release/output-metadata.json
@@ -11,7 +11,7 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
- "versionCode": 74,
+ "versionCode": 75,
"versionName": "6.1.8.5",
"outputFile": "app-release.apk"
}
diff --git a/app/release/vn-picking.apk b/app/release/vn-picking.apk
new file mode 100644
index 00000000..e6a61c26
Binary files /dev/null and b/app/release/vn-picking.apk differ
diff --git a/app/src/main/java/es/verdnatura/di/viewModelModule.kt b/app/src/main/java/es/verdnatura/di/viewModelModule.kt
index b222587e..7849db70 100644
--- a/app/src/main/java/es/verdnatura/di/viewModelModule.kt
+++ b/app/src/main/java/es/verdnatura/di/viewModelModule.kt
@@ -10,6 +10,7 @@ import es.verdnatura.presentation.view.feature.calidad.fragment.QaualityViewMode
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionViewModel
import es.verdnatura.presentation.view.feature.controlador.fragment.ControladorViewModel
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.ControlVehiculoViewModel
+import es.verdnatura.presentation.view.feature.diadeventa.fragment.DayOfSaleViewModel
import es.verdnatura.presentation.view.feature.faltas.fragment.FaltasViewModel
import es.verdnatura.presentation.view.feature.historico.fragment.HistoricoViewModel
import es.verdnatura.presentation.view.feature.historicovehiculo.fragment.HistoricoVehiculoViewModel
@@ -41,6 +42,10 @@ val viewModelModule = module {
viewModel {
PasilleroViewModel(androidContext())
}
+ //Pasilleros Dia de venta
+ viewModel {
+ DayOfSaleViewModel(androidContext())
+ }
// Pasilleros / Item Card
viewModel {
diff --git a/app/src/main/java/es/verdnatura/domain/GetDayOfSaleUSerCase.kt b/app/src/main/java/es/verdnatura/domain/GetDayOfSaleUSerCase.kt
new file mode 100644
index 00000000..9d5a0a29
--- /dev/null
+++ b/app/src/main/java/es/verdnatura/domain/GetDayOfSaleUSerCase.kt
@@ -0,0 +1,63 @@
+package es.verdnatura.domain
+
+import android.content.Context
+import com.google.gson.JsonObject
+import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate
+import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculo
+import retrofit2.Call
+
+class GetDayOfSaleUSerCase(context: Context) : RestClient(context) {
+
+ fun itemShelving_updateSpam(usuario: String, password: String,vShelvingFK:String): Call {
+
+ val params: ArrayList = ArrayList()
+ params.add(vShelvingFK)
+ return restClient!!.itemShelving_updateSpam("json", "1", usuario, password, "application/json",params=params)
+ }
+ /* fun itemShelving_getSaleDateOld(
+ usuario: String,
+ password: String,
+ expeditionFk: String
+ ): Call {
+ val params: ArrayList = ArrayList()
+ params.add(expeditionFk)
+ return restClient!!.itemShelving_getSaleDate(
+ "json",
+ "1",
+ usuario,
+ password,
+ "application/json",
+ params = params
+ )
+ }*/
+
+ fun itemShelving_getSaleDate(
+ usuario: String,
+ password: String,
+ vShelvingFk: String
+ ): Call> {
+ val params: ArrayList = ArrayList()
+ params.add(vShelvingFk)
+ return restClient!!.itemShelving_getSaleDate(
+ "json",
+ "1",
+ usuario,
+ password,
+ "application/json",
+ params
+ )
+ }
+ fun shelvingPark(
+ usuario: String,
+ password: String,
+ shelving: String,
+ parking: String
+ ): Call {
+ val params: ArrayList = ArrayList()
+ params.add(shelving)
+ params.add(parking)
+ return restClient!!.shelvingPark("json", "1", usuario, password, "application/json", params)
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/es/verdnatura/domain/GetLoginUserCase.kt b/app/src/main/java/es/verdnatura/domain/GetLoginUserCase.kt
index b70c71a5..65a598b6 100644
--- a/app/src/main/java/es/verdnatura/domain/GetLoginUserCase.kt
+++ b/app/src/main/java/es/verdnatura/domain/GetLoginUserCase.kt
@@ -89,11 +89,11 @@ class GetLoginUserCase(context: Context) : RestClient(context)
//SALIX MENSAJE :SERGIO: PARA NO ENVIAR MENSAJES A COMERCIALES PONGO QUE LAS MODIFICACIONES SE ENVIAN AL CANAL CREADO.
- fun sendChekingPresence(token:String,workerId:Int,message:String) : Call{
+ fun sendChekingPresence(token:String,workerId:Int,message:String) : Call{
return salixClient!!.sendChekingPresence(content_type = "application/json", authorization = token, params = SalixMessageVO(workerId = workerId,message = message))
}
// SERGIO: PARA DESARROLLO Y PRUEBAS SE DESCOMENTA ESTAS LÍNEAS Y SE COMENTAN LAS DE ARRIBA
-/* fun sendChekingPresence(token: String, workerId: Int, message: String): Call
+ /*fun sendChekingPresence(token: String, workerId: Int, message: String): Call
{
return salixClient!!.sendGroup(
content_type = "application/json",
diff --git a/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt b/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt
index 3a1f08b1..cf3eb99d 100644
--- a/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt
+++ b/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt
@@ -10,6 +10,7 @@ import es.verdnatura.presentation.view.feature.buscaritemall.model.ItemLocationA
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO
import es.verdnatura.presentation.view.feature.collection.ItemVO
+import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO
import es.verdnatura.presentation.view.feature.historico.model.ItemHistoricoVO
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculo
@@ -834,6 +835,44 @@ interface VerdnaturaService {
):
Call
+ //DIA DE VENTA
+
+ @POST("almacennew/itemShelving_getSaleDateOld")//REVISADA
+ fun itemShelving_getSaleDateOld(
+ @Header("aplicacion") aplicacion: String,
+ @Header("version") version: String,
+ @Header("user") user: String,
+ @Header("pass") pass: String,
+ @Header("Content-Type") content_type: String,
+ @Body params: List
+ ):
+ Call
+
+ @POST("almacennew/itemShelving_getSaleDate")//REVISADA
+ fun itemShelving_getSaleDate(
+ @Header("aplicacion") aplicacion: String,
+ @Header("version") version: String,
+ @Header("user") user: String,
+ @Header("pass") pass: String,
+ @Header("Content-Type") content_type: String,
+ @Body params: List
+ ):
+ Call>
+
+
+
+ @POST("almacennew/itemShelving_updateSpam")//REVISADA
+ fun itemShelving_updateSpam(
+ @Header("aplicacion") aplicacion: String,
+ @Header("version") version: String,
+ @Header("user") user: String,
+ @Header("pass") pass: String,
+ @Header("Content-Type") content_type: String,
+ @Body params: List
+ ):
+ Call
+
+
@POST("almacennew/expeditionTruckList")//REVISADA
fun expeditionTruckList(
@Header("aplicacion") aplicacion: String,
diff --git a/app/src/main/java/es/verdnatura/presentation/base/BaseViewModel.kt b/app/src/main/java/es/verdnatura/presentation/base/BaseViewModel.kt
index b39bd015..cb41aae1 100644
--- a/app/src/main/java/es/verdnatura/presentation/base/BaseViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/base/BaseViewModel.kt
@@ -2,5 +2,71 @@ package es.verdnatura.presentation.base
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.ViewModel
+import org.json.JSONObject
-abstract class BaseViewModel : ViewModel(), LifecycleObserver
\ No newline at end of file
+abstract class BaseViewModel : ViewModel(), LifecycleObserver
+
+
+
+fun nameofFunction(function: Any): String
+{
+ return function.javaClass.enclosingMethod!!.name
+}
+
+fun getMessageFromResponse(ResponseMessage: String): String
+{
+ return try
+ {
+ val answerError = JSONObject(ResponseMessage)
+ answerError.get("Message").toString()
+ } catch (e: Exception)
+ {
+ ResponseMessage
+ }
+}
+
+fun getMessageError(callFunction: String): String
+{
+
+ return when (callFunction)
+ {
+ "collection_getTickets" -> "No hay tickets para sacar. Llamada $callFunction."
+ "collection_new_wagon" -> "No hay tickets para sacar. Llamada $callFunction."
+ else ->
+ {
+ "Error en la llamada $callFunction."
+ }
+ }
+
+}
+
+fun getMessageFromAllResponse(callFunction: String, ResponseMessage: String): String
+{
+
+ var messageFromError: String
+ var returnMessage: String
+
+ try
+ {
+ val answerError = JSONObject(ResponseMessage)
+ messageFromError = answerError.get("Message").toString()
+ } catch (e: Exception)
+ {
+ messageFromError = ResponseMessage
+ }
+
+ // if (messageFromError.isEmpty()) {
+
+ //sergio:para personalizar los mensajes de respuesta según la llamada.
+ when (callFunction)
+ {
+ "collection_getTickets" -> returnMessage ="No hay tickets para sacar. Llamada $callFunction."
+ else ->
+ {
+ returnMessage = "Llamada $callFunction."
+ }
+ }
+ //}
+ return "$messageFromError.$returnMessage"
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
index fda19bcc..c7dacac6 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt
@@ -160,8 +160,8 @@ class ItemCardFragment(
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
this.itemFk = itemFk
splash_progress.visibility = View.VISIBLE
- viewModel.getItemCard(itemFk,warehouseFk,user,password)
- viewModel.getItemPackingType(user,password)
+ viewModel.getItemCard(itemFk,warehouseFk,user,password,"item_card")
+ viewModel.getItemPackingType(user,password,"get_ItemPackingType")
}
override fun observeViewModel() {
@@ -383,10 +383,10 @@ class ItemCardFragment(
// "itemStockUpdate" -> prepareItemStockUpdate(item,value)
"itemStockUpdateAdd" -> prepareItemStockUpdate2(item,value)
"itemStockUpdateRemove" -> prepareItemStockUpdate2(item,value)
- "itemPlacementSave" -> viewModel.itemPlacementSave(itemFk = itemFk, warehouseFk = warehouseFk, user = user, password = password, value = value)
- "updateGrouping" -> viewModel.updateGrouping(itemFk = itemFk, user = user, password = password, value = value,warehouseFk = warehouseFk)
- "updatePacking" -> viewModel.updatePacking(itemFk = itemFk, user = user, password = password, value = value,warehouseFk = warehouseFk)
- "itemSaveMin" -> viewModel.itemSaveMin(itemFk = itemFk, user = user, password = password, value = value)
+ "itemPlacementSave" -> viewModel.itemPlacementSave(itemFk = itemFk, warehouseFk = warehouseFk, user = user, password = password, value = value,"itemPlacementSave")
+ "updateGrouping" -> viewModel.updateGrouping(itemFk = itemFk, user = user, password = password, value = value,warehouseFk = warehouseFk,"buy_updateGrouping")
+ "updatePacking" -> viewModel.updatePacking(itemFk = itemFk, user = user, password = password, value = value,warehouseFk = warehouseFk,"buy_updateGrouping")
+ "itemSaveMin" -> viewModel.itemSaveMin(itemFk = itemFk, user = user, password = password, value = value,"itemSaveMin")
}
if(item.action != "itemStockUpdate")
@@ -456,13 +456,13 @@ class ItemCardFragment(
if (itemB.action == "itemStockUpdateRemove") {
customDialogTwo.setTitle(itemB.title!!).setDescription("Indica la causa de eliminar stock:").setOkButton("Falta"){
- viewModel.itemTrash(itemFk = itemFk,warehouseFk = warehouseFk,user = user,password = password,newValue = value,isTrash = "0")
+ viewModel.itemTrash(itemFk = itemFk,warehouseFk = warehouseFk,user = user,password = password,newValue = value,isTrash = "0","itemTrash")
//changeOfflineValue(itemB,value, listBarcodes)
showProgress()
customDialogTwo.dismiss()
}.setOkButtonTwo("Basura"){
- viewModel.itemTrash(itemFk = itemFk,warehouseFk = warehouseFk,user = user,password = password,newValue = value,isTrash = "1")
+ viewModel.itemTrash(itemFk = itemFk,warehouseFk = warehouseFk,user = user,password = password,newValue = value,isTrash = "1","itemTrash")
//changeOfflineValue(itemB,value, listBarcodes)
showProgress()
customDialogTwo.dismiss()
@@ -474,7 +474,7 @@ class ItemCardFragment(
}else{
//changeOfflineValue(itemB,value, listBarcodes)
showProgress()
- viewModel.itemTrash(itemFk = itemFk,warehouseFk = warehouseFk,user = user,password = password,newValue = (value.toInt() * -1).toString(),isTrash = "0")
+ viewModel.itemTrash(itemFk = itemFk,warehouseFk = warehouseFk,user = user,password = password,newValue = (value.toInt() * -1).toString(),isTrash = "0","itemTrash")
}
}catch (e:Exception){
itemcard_layout.visibility = View.GONE
@@ -534,7 +534,7 @@ class ItemCardFragment(
}else{
listBarcodes.add(BarcodeVO(code))
}
- viewModel.barcodesEdit(itemFk = itemFk, user = user, password = password, value = code, delete = delete)
+ viewModel.barcodesEdit(itemFk = itemFk, user = user, password = password, value = code, delete = delete,"itemBarcode_update")
barcodeAdapter!!.notifyDataSetChanged()
//changeOfflineValue(item,"", listBarcodes)
showProgress()
@@ -558,7 +558,7 @@ class ItemCardFragment(
private fun updateItemPackingType(itemPackingType:String) {
splash_progress.visibility = View.VISIBLE
- viewModel.updatePackingType(this.itemFk,user,password,itemPackingType)
+ viewModel.updatePackingType(this.itemFk,user,password,itemPackingType,"item_updatePackingType")
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt
index 9bb8a530..d0ad2245 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt
@@ -7,6 +7,8 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.GetItemCardUserCase
import es.verdnatura.presentation.base.BaseViewModel
+import es.verdnatura.presentation.base.getMessageError
+import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.articulo.model.*
import retrofit2.Call
@@ -39,28 +41,28 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
- fun getItemCard(itemFk:String,warehouseFk:String,user:String,password:String) {
+ fun getItemCard(itemFk:String,warehouseFk:String,user:String,password:String,callFunction:String) {
getItemCardUserCase.getItemCard(user,password,itemFk,warehouseFk).enqueue(object :Callback{
override fun onFailure(call: Call, t: Throwable) {
- _itemcard.value = ItemCardVO(isError = true,errorMessage = "Error al OBTENER "+itemFk+ " Respuesta:"+t.message!!)
+ _itemcard.value = ItemCardVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,t.message!!))
}
override fun onResponse(call: Call, response: Response) {
if (response.body() != null){
_itemcard.value = response.body()!!
}else{
- _itemcard.value = ItemCardVO(isError = true,errorMessage = "Error al llamar a vn.itemCard")
+ _itemcard.value = ItemCardVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message()))
}
}
})
}
- fun item_getSimilar(itemFk:String, warehouseFk: String, vShipped: String, vIsShowedByType:String, user:String, password:String) {
+ fun item_getSimilar(itemFk:String, warehouseFk: String, vShipped: String, vIsShowedByType:String, user:String, password:String,callFunction:String) {
getItemCardUserCase.item_getSimilar(user,password,itemFk,warehouseFk,vShipped,vIsShowedByType).enqueue(object :Callback>{
override fun onFailure(call: Call>, t: Throwable) {
val listError:ArrayList = ArrayList()
- listError.add(ItemProposal(isError = true,errorMessage = t.message!!))
+ listError.add(ItemProposal(isError = true,errorMessage =getMessageFromAllResponse(callFunction,t.message!!)))
_itemProposallist.value = ItemProposalList(listError)
}
@@ -71,7 +73,7 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
}else{
val listError:ArrayList = ArrayList()
- listError.add(ItemProposal(isError = true,errorMessage = "Error en la llamada de getItemPackingType"))
+ listError.add(ItemProposal(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message())))
_itemProposallist.value = ItemProposalList(listError)
}
@@ -81,12 +83,12 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
}
- fun getItemPackingType(user:String,password:String) {
+ fun getItemPackingType(user:String,password:String,callFunction:String) {
getItemCardUserCase.getItemPackingType(user,password).enqueue(object :
Callback>{
override fun onFailure(call: Call>, t: Throwable) {
val listError:ArrayList = ArrayList()
- listError.add(ItemPackingType(isError = true,errorMessage = t.message!!))
+ listError.add(ItemPackingType(isError = true,errorMessage =getMessageFromAllResponse(callFunction,t.message!!)))
_itemspackinglist.value = ItemPackingTypeList(listError)
}
@@ -96,7 +98,7 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
}else{
val listError:ArrayList = ArrayList()
- listError.add(ItemPackingType(isError = true,errorMessage = "Error en la llamada de getItemPackingType"))
+ listError.add(ItemPackingType(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message())))
_itemspackinglist.value = ItemPackingTypeList(listError)
}
}
@@ -106,15 +108,15 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
- fun itemStockUpdate(itemFk:String,warehouseFk:String,user:String,password:String,newValue:String,isTrash:String){
+ fun itemStockUpdate(itemFk:String,warehouseFk:String,user:String,password:String,newValue:String,isTrash:String,callFunction:String){
getItemCardUserCase.itemStockUpdate(user,password,itemFk,warehouseFk,newValue,isTrash).enqueue(object : Callback{
override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error al guardar STOCK "+itemFk+ " Respuesta:"+t.message!!)
+ _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada $callFunction."+t.message!!)
}
override fun onResponse(call: Call, response: Response) {
if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada itemStockUpdate")
+ _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada $callFunction")
}else{
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
}
@@ -124,15 +126,15 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
})
}
- fun itemTrash(itemFk:String,warehouseFk:String,user:String,password:String,newValue:String,isTrash:String){
+ fun itemTrash(itemFk:String,warehouseFk:String,user:String,password:String,newValue:String,isTrash:String,callFunction:String){
getItemCardUserCase.itemTrash(user,password,itemFk,warehouseFk,newValue,isTrash).enqueue(object : Callback{
override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error al guardar STOCK "+itemFk+ " Respuesta:"+t.message!!)
+ _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,t.message!!))
}
override fun onResponse(call: Call, response: Response) {
if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada itemTrash")
+ _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message()))
}else{
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
}
@@ -142,15 +144,15 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
})
}
- fun itemPlacementSave(itemFk:String,warehouseFk:String,user:String,password:String,value:String){
+ fun itemPlacementSave(itemFk:String,warehouseFk:String,user:String,password:String,value:String,callFunction:String){
getItemCardUserCase.itemPlacementSave(user,password,itemFk,warehouseFk,value).enqueue(object : Callback{
override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage ="Error al guardar NICHO "+itemFk+ " Respuesta:"+t.message!!)
+ _response.value = ResponseItemVO(isError = true,errorMessage =getMessageFromAllResponse(callFunction,t.message!!))
}
override fun onResponse(call: Call, response: Response) {
if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada itemPlacementSave")
+ _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message()))
}else{
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
}
@@ -160,15 +162,15 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
})
}
- fun updateGrouping(itemFk:String,user:String,password:String,value:String,warehouseFk: String){
+ fun updateGrouping(itemFk:String,user:String,password:String,value:String,warehouseFk: String,callFunction:String){
getItemCardUserCase.updateGrouping(user,password,itemFk,value,warehouseFk).enqueue(object : Callback{
override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error al guardar GROUPING "+itemFk+ " Respuesta:"+t.message!!)
+ _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,t.message!!))
}
override fun onResponse(call: Call, response: Response) {
if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada updateGrouping")
+ _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message()))
}else{
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
}
@@ -178,15 +180,15 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
})
}
- fun updatePacking(itemFk:String,user:String,password:String,value:String,warehouseFk: String){
+ fun updatePacking(itemFk:String,user:String,password:String,value:String,warehouseFk: String,callFunction:String){
getItemCardUserCase.updatePacking(user,password,itemFk,value,warehouseFk).enqueue(object : Callback{
override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error al guardar PACKING "+itemFk+ " Respuesta:"+t.message!!)
+ _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,t.message!!))
}
override fun onResponse(call: Call, response: Response) {
if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada updatePacking")
+ _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message()))
}else{
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
}
@@ -197,15 +199,15 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
}
//sergio ver como solucionar el tema del "Finish"
- fun updatePackingType(itemFk:String,user:String,password:String,itemPackingType:String){
+ fun updatePackingType(itemFk:String,user:String,password:String,itemPackingType:String,callFunction:String){
getItemCardUserCase.updatePackingType(user,password,itemFk,itemPackingType).enqueue(object : Callback{
override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error al guardar PackingType "+itemFk+ " Respuesta:"+t.message!!)
+ _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,t.message!!))
}
override fun onResponse(call: Call, response: Response) {
if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada updatePackingType")
+ _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message()))
}else{
//if (response.body()=="Finish"){
// //Log.i("VERDNATURA:","Fisnih encontrado")}
@@ -217,15 +219,15 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
})
}
- fun itemSaveMin(itemFk:String,user:String,password:String,value:String){
+ fun itemSaveMin(itemFk:String,user:String,password:String,value:String,callFunction:String){
getItemCardUserCase.itemSaveMin(user,password,itemFk,value).enqueue(object : Callback{
override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error al guardar MIN "+itemFk+ " Respuesta:"+t.message!!)
+ _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,t.message!!))
}
override fun onResponse(call: Call, response: Response) {
if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada updatePacking")
+ _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message()))
}else{
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
}
@@ -235,15 +237,15 @@ class ItemCardViewModel(context: Context) : BaseViewModel() {
})
}
- fun barcodesEdit(itemFk:String,user:String,password:String,value:String,delete:String){
+ fun barcodesEdit(itemFk:String,user:String,password:String,value:String,delete:String,callFunction:String){
getItemCardUserCase.barcodes_edit(user,password,itemFk,value,delete).enqueue(object : Callback{
override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error al guardar BARCODES "+itemFk+ " Respuesta:"+t.message!!)
+ _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,t.message!!))
}
override fun onResponse(call: Call, response: Response) {
if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada itemBarcode_update")
+ _response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message()))
}else{
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemProposalFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemProposalFragment.kt
index 3b34fd56..0fb232df 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemProposalFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemProposalFragment.kt
@@ -83,7 +83,7 @@ class ItemProposalFragment(
vShipped = currentDay(),
vIsShowedByType = "TRUE",
user = user,
- password = password
+ password = password,"item_getSimilar"
)
super.onCreate(savedInstanceState)
}
@@ -137,7 +137,7 @@ class ItemProposalFragment(
vShipped = currentDay(),
user = user,
password = password
- )
+ ,callFunction = "item_getSimilar")
}
if (item == iconFilter) {
@@ -172,8 +172,8 @@ class ItemProposalFragment(
vIsShowedByType = filter,
vShipped = currentDay(),
user = user,
- password = password
- )
+ password = password ,
+ callFunction = "item_getSimilar")
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt
index e7b62c8c..f5d27f45 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt
@@ -90,16 +90,16 @@ class BufferFragment(
splash_progress.visibility = View.VISIBLE
if (entryPoint.equals("Vaciado buffer")){
- viewModel.buffer_setTypeByName(user,password,scan_input.text.toString(),"UNLOADING")
+ viewModel.buffer_setTypeByName(user,password,scan_input.text.toString(),"UNLOADING","buffer_setTypeByName")
}
if (entryPoint.equals("Llenado buffer")){
- viewModel.buffer_setTypeByName(user,password,scan_input.text.toString(),"LOADING")
+ viewModel.buffer_setTypeByName(user,password,scan_input.text.toString(),"LOADING","buffer_setTypeByName")
}
if (entryPoint.equals("Acumulación buffer")){
- viewModel.buffer_setTypeByName(user,password,scan_input.text.toString(),"ACCUMULATION")
+ viewModel.buffer_setTypeByName(user,password,scan_input.text.toString(),"ACCUMULATION","buffer_setTypeByName")
}
if (entryPoint.equals("Desactivado buffer")){
- viewModel.buffer_setTypeByName(user,password,scan_input.text.toString(),"DISABLED")
+ viewModel.buffer_setTypeByName(user,password,scan_input.text.toString(),"DISABLED","buffer_setTypeByName")
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragmentViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragmentViewModel.kt
index 65fc2eff..5a934ddd 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragmentViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragmentViewModel.kt
@@ -6,6 +6,8 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.GetPaletizadoresUserCase
import es.verdnatura.presentation.base.BaseViewModel
+import es.verdnatura.presentation.base.getMessageError
+import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.common.ResponseItemVO
import retrofit2.Call
import retrofit2.Callback
@@ -26,7 +28,7 @@ class BufferFragmentViewModel(context: Context) : BaseViewModel() {
get() = _bufferresponse
- fun buffer_setTypeByName(user: String, password: String, vBufferFk: String, vType: String) {
+ fun buffer_setTypeByName(user: String, password: String, vBufferFk: String, vType: String,callFunction:String){
GetPaletizadoresUserCase.buffer_setTypeByName(user, password, vBufferFk, vType)
.enqueue(object : Callback {
override fun onFailure(call: Call, t: Throwable) {
@@ -34,15 +36,14 @@ class BufferFragmentViewModel(context: Context) : BaseViewModel() {
_itembuffertype.value = ResponseItemVO(
isError = true,
- errorMessage = "Error al realizar operación con buffer.Respuesta:" + t.message!!
- )
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!))
+
}
override fun onResponse(call: Call, response: Response) {
- // Log.i("VERDNATURA:", "la respuesta es ${response.body()!!}")
if (response.body() != null && response.body() == true) {
- // _bufferresponse.value = response.body()!!
+
_itembuffertype.value = ResponseItemVO(
isError = false,
errorMessage = ""
@@ -52,8 +53,8 @@ class BufferFragmentViewModel(context: Context) : BaseViewModel() {
//_bufferresponse.value = false
_itembuffertype.value = ResponseItemVO(
isError = true,
- errorMessage = "Error al realizar operación con buffer."
- )
+ errorMessage = getMessageFromAllResponse(callFunction,response.message()))
+
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt
index 411e72fc..9fb2bebe 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemFragment.kt
@@ -78,7 +78,7 @@ class BuscarItemFragment(
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
this.itemFk = itemFk
splash_progress.visibility = View.VISIBLE
- viewModel.getLocations(user,password,itemFk)
+ viewModel.getLocations(user,password,itemFk,"getItemUbication")
}
override fun observeViewModel() {
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemViewModel.kt
index 5446e2ae..17f811d9 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemViewModel.kt
@@ -6,6 +6,8 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import es.verdnatura.domain.GetBuscarItemUserCase
import es.verdnatura.presentation.base.BaseViewModel
+import es.verdnatura.presentation.base.getMessageError
+import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
import es.verdnatura.presentation.view.feature.buscaritem.model.LocationListVO
@@ -25,11 +27,11 @@ class BuscarItemViewModel(context: Context) : BaseViewModel() {
val loadLocationList = Transformations.map(_locationList) { Event(it) }
- fun getLocations(user:String,password:String,itemFk:String){
+ fun getLocations(user:String,password:String,itemFk:String,callFunction:String){
getBuscarItemUserCase.searchItemsUbicador(user,password,itemFk).enqueue(object : Callback> {
override fun onFailure(call: Call>, t: Throwable) {
val listError:ArrayList = ArrayList()
- listError.add(ItemLocationVO(isError = true,errorMessage = t.message!!))
+ listError.add(ItemLocationVO(isError = true,errorMessage =getMessageFromAllResponse(callFunction,t.message!!)))
_locationList.value = LocationListVO(listError)
}
@@ -41,7 +43,7 @@ class BuscarItemViewModel(context: Context) : BaseViewModel() {
_locationList.value = response.body()?.let { LocationListVO(it) }
}else{
val listError:ArrayList = ArrayList()
- listError.add(ItemLocationVO(isError = true,errorMessage = "Error en la llamada de searchItemsUbicador"))
+ listError.add(ItemLocationVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message())))
_locationList.value = LocationListVO(listError)
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritemall/fragment/BuscarItemAllFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritemall/fragment/BuscarItemAllFragment.kt
index ab88a736..06816ab8 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritemall/fragment/BuscarItemAllFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritemall/fragment/BuscarItemAllFragment.kt
@@ -113,7 +113,7 @@ class BuscarItemAllFragment(
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
this.itemFk = itemFk
splash_progress.visibility = View.VISIBLE
- viewModel.getLocationsAll(user,password,itemFk)
+ viewModel.getLocationsAll(user,password,itemFk,"getItemUbication")
}
override fun observeViewModel() {
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritemall/fragment/BuscarItemAllViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritemall/fragment/BuscarItemAllViewModel.kt
index 961fb1d6..b8984335 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritemall/fragment/BuscarItemAllViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritemall/fragment/BuscarItemAllViewModel.kt
@@ -6,6 +6,8 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import es.verdnatura.domain.GetBuscarItemAllUserCase
import es.verdnatura.presentation.base.BaseViewModel
+import es.verdnatura.presentation.base.getMessageError
+import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.view.feature.buscaritemall.model.ItemLocationAll
import es.verdnatura.presentation.view.feature.buscaritemall.model.LocationListAll
@@ -26,11 +28,11 @@ class BuscarItemAllViewModel(context: Context) : BaseViewModel() {
val loadLocationListAll = Transformations.map(_locationListAll) { Event(it) }
- fun getLocationsAll(user:String,password:String,itemFk:String){
+ fun getLocationsAll(user:String,password:String,itemFk:String,callFunction:String){
getBuscarItemAllUserCase.searchItemsUbicadorAll(user,password,itemFk).enqueue(object : Callback> {
override fun onFailure(call: Call>, t: Throwable) {
val listError:ArrayList = ArrayList()
- listError.add(ItemLocationAll(isError = true,errorMessage = t.message!!))
+ listError.add(ItemLocationAll(isError = true,errorMessage =getMessageFromAllResponse(callFunction,t.message!!)))
_locationListAll.value = LocationListAll(listError)
}
@@ -42,7 +44,7 @@ class BuscarItemAllViewModel(context: Context) : BaseViewModel() {
_locationListAll.value = response.body()?.let { LocationListAll(it) }
}else{
val listError:ArrayList = ArrayList()
- listError.add(ItemLocationAll(isError = true,errorMessage = "Error en la llamada de searchItemsUbicadorAll"))
+ listError.add(ItemLocationAll(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message())))
_locationListAll.value = LocationListAll(listError)
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersFragment.kt
index a36b26fe..0629eddb 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersFragment.kt
@@ -54,7 +54,7 @@ class BuyersFragment : BaseFragment(Buyer
password = prefs.getString(PASSWORD,"").toString()
sectorFk = prefs.getInt(SECTORFK,1).toString()
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
- viewModel.itemShelvingBuyerGet(user = user,password = password)
+ viewModel.itemShelvingBuyerGet(user = user,password = password,"itemShelving_BuyerGet")
super.onCreate(savedInstanceState)
}
@@ -76,7 +76,7 @@ class BuyersFragment : BaseFragment(Buyer
override fun onOptionsItemSelected(item: Drawable) {
if (item == iconReload){
splash_progress.visibility = View.VISIBLE
- viewModel.itemShelvingBuyerGet(user = user,password = password)
+ viewModel.itemShelvingBuyerGet(user = user,password = password,"itemShelving_BuyerGet")
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersViewModel.kt
index 2892ff93..63abe38b 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersViewModel.kt
@@ -5,6 +5,8 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.GetQualityUserCase
import es.verdnatura.presentation.base.BaseViewModel
+import es.verdnatura.presentation.base.getMessageError
+import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.view.feature.calidad.model.BuyerListVO
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
import es.verdnatura.presentation.view.feature.inventario.model.InventaryListVO
@@ -21,12 +23,12 @@ class BuyersViewModel(context: Context) : BaseViewModel() {
val buyersList: LiveData
get() = _buyersList
- fun itemShelvingBuyerGet(user:String,password:String){
+ fun itemShelvingBuyerGet(user:String,password:String,callFunction:String){
getQualityUserCase.itemShelvingBuyerGet(user,password).enqueue(object :
Callback> {
override fun onFailure(call: Call>, t: Throwable) {
val listError:ArrayList = ArrayList()
- listError.add(BuyerVO(isError = true,errorMessage = t.message!!))
+ listError.add(BuyerVO(isError = true,errorMessage =getMessageFromAllResponse(callFunction,t.message!!)))
_buyersList.value = BuyerListVO(listError)
}
@@ -38,7 +40,7 @@ class BuyersViewModel(context: Context) : BaseViewModel() {
_buyersList.value = response.body()?.let { BuyerListVO(it) }
}else{
val listError:ArrayList = ArrayList()
- listError.add(BuyerVO(isError = true,errorMessage = "Error en la llamada de itemShelving_buyerGet"))
+ listError.add(BuyerVO(isError = true,errorMessage =getMessageFromAllResponse(callFunction,response.message())))
_buyersList.value = BuyerListVO(listError)
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityFragment.kt
index 9c5eafb6..e11df2f3 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityFragment.kt
@@ -61,7 +61,7 @@ class QaualityFragment(
password = prefs.getString(PASSWORD,"").toString()
sectorFk = prefs.getInt(SECTORFK,1).toString()
warehouseFk = prefs.getInt(WAREHOUSEFK,1).toString()
- viewModel.itemShelvingBuyerTask(user = user,password = password,userFk = userFk)
+ viewModel.itemShelvingBuyerTask(user = user,password = password,userFk = userFk,"itemShelving_BuyerTask")
super.onCreate(savedInstanceState)
}
@@ -89,7 +89,7 @@ class QaualityFragment(
override fun onOptionsItemSelected(item: Drawable) {
if (item == iconReload){
splash_progress.visibility = View.VISIBLE
- viewModel.itemShelvingBuyerTask(user = user,password = password,userFk = userFk)
+ viewModel.itemShelvingBuyerTask(user = user,password = password,userFk = userFk,"itemShelving_BuyerTask")
}
}
})
@@ -131,7 +131,7 @@ class QaualityFragment(
})
response.observe(viewLifecycleOwner, Observer {
- viewModel.itemShelvingBuyerTask(user = user,password = password,userFk = userFk)
+ viewModel.itemShelvingBuyerTask(user = user,password = password,userFk = userFk,"itemShelving_BuyerTask")
})
}
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityViewModel.kt
index a29dcc76..ac7399b4 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityViewModel.kt
@@ -5,6 +5,8 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.GetQualityUserCase
import es.verdnatura.presentation.base.BaseViewModel
+import es.verdnatura.presentation.base.getMessageError
+import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.common.ResponseItemVO
import es.verdnatura.presentation.view.feature.calidad.model.BuyerListVO
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
@@ -28,12 +30,12 @@ class QaualityViewModel(context: Context) : BaseViewModel() {
get() = _response
- fun itemShelvingBuyerTask(user:String,password:String,userFk:String){
+ fun itemShelvingBuyerTask(user:String,password:String,userFk:String,callFunction:String){
getQualityUserCase.itemShelvingBuyerTask(user,password,userFk).enqueue(object :
Callback> {
override fun onFailure(call: Call>, t: Throwable) {
val listError:ArrayList = ArrayList()
- listError.add(ItemBuyerVO(isError = true,errorMessage = t.message!!))
+ listError.add(ItemBuyerVO(isError = true,errorMessage =getMessageFromAllResponse(callFunction,t.message!!)))
_buyersList.value = ItemBuyerListVO(listError)
}
@@ -45,7 +47,7 @@ class QaualityViewModel(context: Context) : BaseViewModel() {
_buyersList.value = response.body()?.let { ItemBuyerListVO(it) }
}else{
val listError:ArrayList = ArrayList()
- listError.add(ItemBuyerVO(isError = true,errorMessage = "Error en la llamada de itemShelvingBuyerTask"))
+ listError.add(ItemBuyerVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message())))
_buyersList.value = ItemBuyerListVO(listError)
}
}
@@ -56,12 +58,13 @@ class QaualityViewModel(context: Context) : BaseViewModel() {
fun itemShelvingStarsUpdate(usuario:String,password:String, vId: String,vStars: String) {
getQualityUserCase.itemShelvingStarsUpdate(usuario,password,vId,vStars).enqueue(object : Callback{
override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
+ _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada itemShelving_StarsUpdate."+t.message!!)
}
override fun onResponse(call: Call, response: Response) {
+
if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada itemShelvingStarsUpdate")
+ _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada itemShelving_StarsUpdate")
}else{
_response.value = ResponseItemVO(isError = false,response = response.body()!!)
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt
index 4a055449..88085cf5 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt
@@ -7,6 +7,7 @@ import android.graphics.drawable.Drawable
import android.media.MediaPlayer
import android.os.Bundle
import android.speech.SpeechRecognizer
+import android.text.InputType
import android.util.Log
import android.view.View
import android.view.inputmethod.EditorInfo
@@ -120,12 +121,12 @@ class CollectionFragment(
if ((collection.collectionFk != null) && type.equals(CONTROLADOR)) {
//sergio: comprueba si viene de la pantalla de controlador
- viewModel.ticketOrCollection_checkFullyControlled(user, password, collection.collectionFk)
+ viewModel.ticketOrCollection_checkFullyControlled(user, password, collection.collectionFk,"ticketOrCollection_checkFullyControlled")
workerFkFromTicket=collection.tickets.get(0).sales.get(0).workerFk
}
if (collection.tickets.isEmpty()) {
- viewModel.collectionTicketGet(user, password, collection.collectionFk, sectorFk, type)
+ viewModel.collectionTicketGet(user, password, collection.collectionFk, sectorFk, type,"collection_getTickets")
}
@@ -237,6 +238,9 @@ class CollectionFragment(
}
//ESCANER =========
hideKeyboards()
+ if (type.equals(CONTROLADOR)){
+ scan_input.inputType= InputType.TYPE_CLASS_NUMBER
+ }
scan_input.requestFocus()
scan_input.setOnEditorActionListener { v, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0 || actionId == 5) {//ID=0 ACTION_NEXT ID=5 ACTION_UNESPECEFIED)
@@ -265,7 +269,7 @@ class CollectionFragment(
collection.collectionFk,
sectorFk,
type
- )
+ ,"collection_getTickets")
collection_swipe.isRefreshing = false
}
}
@@ -335,7 +339,7 @@ class CollectionFragment(
collection.collectionFk,
sectorFk,
type
- )
+ ,"collection_getTickets")
// //Log.i("VERDNATURA:","La collection es ${collection.collectionFk}")
}
@@ -401,7 +405,7 @@ class CollectionFragment(
}
.setKoButton("Revisar"){
splash_progress.visibility=View.VISIBLE
- viewModel.collectionTicketGet(user, password, it.response, sectorFk, type)
+ viewModel.collectionTicketGet(user, password, it.response, sectorFk, type,"collection_getTickets")
customDialog.dismiss()
}
customDialog.show()
@@ -411,6 +415,16 @@ class CollectionFragment(
}
})
+ responseSalixMessage.observe(viewLifecycleOwner, Observer{
+ if (it.isError){
+ customDialog.setTitle("Error").setDescription(it.errorMessage)
+ .setOkButton("Aceptar") {
+ customDialog.dismiss()
+ }.show()
+ }
+ })
+
+
}
}
@@ -618,7 +632,8 @@ class CollectionFragment(
usuario = user,
password = password,
ticketFk = tickets[0],
- parking = txtscan
+ parking = txtscan,
+ "shelvingPark"
)
}
Timber.i("La coleccion es "+tickets[0])
@@ -661,7 +676,8 @@ class CollectionFragment(
usuario = user,
password = password,
ticketFk = tickets[0],
- parking = txtscan
+ parking = txtscan,
+ "shelvingPark"
)
}
if (mpok != null) mpok!!.start()
@@ -672,10 +688,10 @@ class CollectionFragment(
storedBackPosition = 0
if (type != PRECHECKER) {
- viewModel.collectionTicketGet(user, password, txtscan, sectorFk, type)
+ viewModel.collectionTicketGet(user, password, txtscan, sectorFk, type,"collection_getTickets")
if (type.equals(CONTROLADOR)) {
- viewModel.ticketOrCollection_checkFullyControlled(user, password, txtscan)
+ viewModel.ticketOrCollection_checkFullyControlled(user, password, txtscan,"ticketOrCollection_checkFullyControlled")
}
} else {
splash_progress.visibility = View.GONE
@@ -732,7 +748,8 @@ class CollectionFragment(
usuario = user,
password = password,
ticketFk = it,
- parking = txtscan
+ parking = txtscan,
+ "shelvingPark"
)
}
if (mpok != null) mpok!!.start()
@@ -807,7 +824,8 @@ class CollectionFragment(
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else "1",
vOriginalQuantity = sales[position].pickedQuantity,
vStateFk = type,//type.toString(),
- vBuyFk = originalItemScan
+ vBuyFk = originalItemScan,
+ callFunction = "saleTrackingReplace"
)
//Log.i("VERDNATURA:","POSICION $position y el vStateFk $type")
//Log.i("VERDNATURA:","vIscheked es ${if(type == CONTROLADOR) sales[position].isControlled else "1"}")
@@ -829,7 +847,8 @@ class CollectionFragment(
viewModel.saleTrackingDel(
usuario = user,
password = password,
- saleFk = sales[position].saleFk
+ saleFk = sales[position].saleFk,
+ "saleTracking_del"
)
}
setTotalLines()
@@ -860,7 +879,8 @@ class CollectionFragment(
password = password,
itemFk = sales[position].itemFk,
quantity = quantityGet,
- shelvingFk = sales[position].placements[shelvingPosition].shelving
+ shelvingFk = sales[position].placements[shelvingPosition].shelving,
+ callFunction = "itemPlacementSupplyAiming"
)
}
@@ -916,7 +936,7 @@ class CollectionFragment(
viewModel.getIdFromCode(
usuario = user,
password = password,
- code = customDialogList.getValueTwo()
+ code = customDialogList.getValueTwo(),"barcodeToItem"
)
customDialogList.dismiss()
}
@@ -982,7 +1002,7 @@ class CollectionFragment(
viewModel.getIdFromCode(
usuario = user,
password = password,
- code = customDialogList.getValueTwo()
+ code = customDialogList.getValueTwo(),"barcodeToItem"
)
customDialogList.dismiss()
scanRequest()
@@ -1043,7 +1063,7 @@ class CollectionFragment(
if (quantityPicked
get() = _response
-
private val _responsecheckfully by lazy { MutableLiveData() }
val responsecheckfully: LiveData
get() = _responsecheckfully
-
private val _responseNew by lazy { MutableLiveData() }
val responseNew: LiveData
get() = _responseNew
@@ -58,323 +60,690 @@ class CollectionViewModel(context: Context) : BaseViewModel() {
val mistakeList: LiveData
get() = _mistakeList
-
+ private val _responseSalixMessage by lazy { MutableLiveData() }
+ val responseSalixMessage: LiveData
+ get() = _responseSalixMessage
private val _item by lazy { MutableLiveData() }
val item: LiveData
get() = _item
-
- fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String,type:String){
- getSacadorControladorUserCase.collectionTicketGet(usuario,password,collectionFk,sectorFk,"0",type).enqueue(object :
- Callback {
- override fun onFailure(call: Call, t: Throwable) {
- _collectionTicketList.value = CollectionVO(isError = true,errorMessage = t.message!!)
+ fun collectionTicketGet(
+ usuario: String,
+ password: String,
+ collectionFk: String,
+ sectorFk: String,
+ type: String,
+ callFunction:String){
+ getSacadorControladorUserCase.collectionTicketGet(
+ usuario,
+ password,
+ collectionFk,
+ sectorFk,
+ "0",
+ type
+ ).enqueue(object :
+ Callback
+ {
+ override fun onFailure(call: Call, t: Throwable)
+ {
+ _collectionTicketList.value = CollectionVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
+ )
}
+
override fun onResponse(
call: Call,
response: Response
- ) {
- if (response.body() != null){
+ )
+ {
+ if (response.body() != null)
+ {
_collectionTicketList.value = response.body()?.let { it.map() }
- }else{
- _collectionTicketList.value = CollectionVO(isError = true,errorMessage = "Error en la llamada de collection_get")
+ } else
+ {
+ _collectionTicketList.value = CollectionVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,response.message()))
}
}
})
}
- fun saleTrackingReplace(usuario:String,password:String,saleFk:String,vOriginalQuantity:String,vStateFk:String,vIsChecked:String,vBuyFk:String){
- getSacadorControladorUserCase.saleTrackingReplace(usuario,password,saleFk,vOriginalQuantity,vStateFk,vIsChecked,vBuyFk).enqueue(object : Callback{
- override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
+ fun saleTrackingReplace(
+ usuario: String,
+ password: String,
+ saleFk: String,
+ vOriginalQuantity: String,
+ vStateFk: String,
+ vIsChecked: String,
+ vBuyFk: String,callFunction:String)
+ {
+ getSacadorControladorUserCase.saleTrackingReplace(
+ usuario,
+ password,
+ saleFk,
+ vOriginalQuantity,
+ vStateFk,
+ vIsChecked,
+ vBuyFk
+ ).enqueue(object : Callback
+ {
+ override fun onFailure(call: Call, t: Throwable)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
+ )
}
- override fun onResponse(call: Call, response: Response) {
- if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada saleTracking_Replace")
- }else{
- _response.value = ResponseItemVO(isError = false,response = response.body()!!)
+ override fun onResponse(call: Call, response: Response)
+ {
+ if (response.body() == null)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,response.message()))
+ } else
+ {
+ _response.value = ResponseItemVO(isError = false, response = response.body()!!)
}
}
})
}
- fun itemPlacementSupplyAiming(usuario:String,password:String,shelvingFk:String,quantity:String,itemFk:String){
- getSacadorControladorUserCase.itemPlacementSupplyAiming(usuario,password,shelvingFk,quantity,itemFk).enqueue(object :
- Callback> {
- override fun onFailure(call: Call>, t: Throwable) {
- val listError:ArrayList = ArrayList()
- listError.add(PlacementSupplyVO(isError = true,errorMessage = t.message!!))
+ fun itemPlacementSupplyAiming(
+ usuario: String,
+ password: String,
+ shelvingFk: String,
+ quantity: String,
+ itemFk: String,callFunction:String)
+ {
+ getSacadorControladorUserCase.itemPlacementSupplyAiming(
+ usuario,
+ password,
+ shelvingFk,
+ quantity,
+ itemFk
+ ).enqueue(object :
+ Callback>
+ {
+ override fun onFailure(call: Call>, t: Throwable)
+ {
+ val listError: ArrayList = ArrayList()
+ listError.add(
+ PlacementSupplyVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
+ )
+ )
_placementSuppleyList.value = PlacementSupplyListVO(listError)
}
+
override fun onResponse(
call: Call>,
response: Response>
- ) {
- if (response.body() != null){
+ )
+ {
+ if (response.body() != null)
+ {
_placementSuppleyList.value = response.body()?.let { PlacementSupplyListVO(it) }
- }else{
- val listError:ArrayList = ArrayList()
- listError.add(PlacementSupplyVO(isError = true,errorMessage = "Error en la llamada de itemPlacementSupplyAiming"))
+ } else
+ {
+ val listError: ArrayList = ArrayList()
+ listError.add(
+ PlacementSupplyVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,response.message())
+ )
+ )
_placementSuppleyList.value = PlacementSupplyListVO(listError)
}
}
})
}
- fun itemShelvingSaleSupplyAdd(usuario:String,password:String,itemShelvingFk:String,saleFk:String,quantity:String){
- getSacadorControladorUserCase.itemShelvingSaleSupplyAdd(usuario,password,itemShelvingFk,saleFk,quantity).enqueue(object : Callback{
- override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
+ fun itemShelvingSaleSupplyAdd(
+ usuario: String,
+ password: String,
+ itemShelvingFk: String,
+ saleFk: String,
+ quantity: String,callFunction:String
+ )
+ {
+ getSacadorControladorUserCase.itemShelvingSaleSupplyAdd(
+ usuario,
+ password,
+ itemShelvingFk,
+ saleFk,
+ quantity
+ ).enqueue(object : Callback
+ {
+ override fun onFailure(call: Call, t: Throwable)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
+ )
}
- override fun onResponse(call: Call, response: Response) {
- if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada itemShelvingSaleSupplyAdd")
- }else{
- _response.value = ResponseItemVO(isError = false,response = response.body()!!)
+ override fun onResponse(call: Call, response: Response)
+ {
+ if (response.body() == null)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,response.message())
+ )
+ } else
+ {
+ _response.value = ResponseItemVO(isError = false, response = response.body()!!)
}
}
})
}
- fun collectionStickerPrint(usuario:String,password:String,collectionFk: String,sectorFk: String){
- getSacadorControladorUserCase.collectionStickerPrint(usuario,password,collectionFk,sectorFk).enqueue(object : Callback{
- override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
+ fun collectionStickerPrint(
+ usuario: String,
+ password: String,
+ collectionFk: String,
+ sectorFk: String,callFunction:String)
+
+ {
+ getSacadorControladorUserCase.collectionStickerPrint(
+ usuario,
+ password,
+ collectionFk,
+ sectorFk
+ ).enqueue(object : Callback
+ {
+ override fun onFailure(call: Call, t: Throwable)
+ {
+ _response.value = ResponseItemVO(isError = true, errorMessage = getMessageFromAllResponse(callFunction,t.message!!))
}
- override fun onResponse(call: Call, response: Response) {
- if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada collectionStickerPrint")
- }else{
- _response.value = ResponseItemVO(isError = false,response = response.body()!!)
+ override fun onResponse(call: Call, response: Response)
+ {
+ if (response.body() == null)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,response.message())
+ )
+ } else
+ {
+ _response.value = ResponseItemVO(isError = false, response = response.body()!!)
}
}
})
}
- fun itemGetAvailable(usuario:String,password:String,itemFk: String,warehouseFk: String){
- getSacadorControladorUserCase.itemGetAvailable(usuario,password,itemFk,warehouseFk).enqueue(object : Callback{
- override fun onFailure(call: Call, t: Throwable) {
- _item.value = ItemVO(isError = true,errorMessage = ""+t.message!!)
- }
-
- override fun onResponse(call: Call, response: Response) {
- if (response.body() == null){
- _item.value = ItemVO(isError = true,errorMessage = "Error en la llamada item_GetVisibleAvailable")
- }else{
- _item.value = response.body()
- }
- }
- })
- }
-
- fun collectionAddItem(usuario:String,password:String,itemFk: String,quantityFk: String,ticketFk: String,warehouseFk: String){
- getSacadorControladorUserCase.collectionAddItem(usuario,password,itemFk,quantityFk,ticketFk,warehouseFk).enqueue(object : Callback{
- override fun onFailure(call: Call, t: Throwable) {
- _responseNew.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
- }
-
- override fun onResponse(call: Call, response: Response) {
- if (response.body() == null){
- _responseNew.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada collectionAddItem")
- }else{
- _responseNew.value = ResponseItemVO(isError = false,response = response.body()!!)
- }
- }
- })
- }
-
- fun saleMove(usuario:String,password:String,saleFk: String,quantity: String,originalQuantity : String){
- getSacadorControladorUserCase.saleMove(usuario,password,saleFk,quantity,originalQuantity).enqueue(object : Callback{
- override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
- }
-
- override fun onResponse(call: Call, response: Response) {
- if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada saleMove")
- }else{
- _response.value = ResponseItemVO(isError = false,response = response.body()!!)
- }
- }
- })
- }
-
- fun collectionMissingTrash(usuario:String,password:String,saleFk: String,quantity: String,type:String,warehouseFk:String,originalQuantity: String){
- getSacadorControladorUserCase.collectionMissingTrash(usuario,password,saleFk,quantity,type,warehouseFk,originalQuantity).enqueue(object : Callback{
- override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
- }
-
- override fun onResponse(call: Call, response: Response) {
- if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada collectionMissingTrash")
- }else{
- _response.value = ResponseItemVO(isError = false,response = response.body()!!)
- }
- }
- })
- }
-
-
- fun saleTrackingDel(usuario:String,password:String,saleFk: String){
- getSacadorControladorUserCase.saleTrackingDel(usuario,password,saleFk).enqueue(object : Callback{
- override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
- }
-
- override fun onResponse(call: Call, response: Response) {
- if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada collectionMissingTrash")
- }else{
- _response.value = ResponseItemVO(isError = false,response = response.body()!!)
- }
- }
- })
- }
-
- fun parking(usuario: String,password: String,ticketFk: String,parking:String){
- getUbicadorUserCase.shelvingPark(usuario,password,ticketFk,parking).enqueue(object : Callback{
- override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
- }
-
- override fun onResponse(call: Call, response: Response) {
- if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada shelvingPark")
- }else{
- _response.value = ResponseItemVO(isError = false,response = response.body()!!)
- }
- }
- })
- }
-
- fun collectionUpdateState(usuario:String,password:String,collectionFk: String,state : String){
- getSacadorControladorUserCase.collectionUpdateState(usuario,password,collectionFk,state).enqueue(object : Callback{
- override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
- }
-
- override fun onResponse(call: Call, response: Response) {
- if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada collectionUpdateState")
- }else{
- _response.value = ResponseItemVO(isError = false,response = response.body()!!)
- }
- }
- })
- }
-
- fun getIdFromCode(usuario:String,password:String,code: String){
- getSacadorControladorUserCase.getIdFromCode(usuario,password,code).enqueue(object : Callback{
- override fun onFailure(call: Call, t: Throwable) {
- _responseCode.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
- }
-
- override fun onResponse(call: Call, response: Response) {
- if (response.body() == null){
- _responseCode.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada barcodeToItem")
- }else{
- _responseCode.value = ResponseItemVO(isError = false,response = response.body()!!)
- }
- }
- })
- }
-
- fun collectionIncreaseQuantity(usuario:String,password:String,saleFk: String,quantity: String){
- getSacadorControladorUserCase.collectionIncreaseQuantity(usuario,password,saleFk,quantity).enqueue(object : Callback{
- override fun onFailure(call: Call, t: Throwable) {
- _responseIncQuantity.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
- }
-
- override fun onResponse(call: Call, response: Response) {
- if (response.body() == null){
- _responseIncQuantity.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada collectionIncreaseQuantity")
- }else{
- _responseIncQuantity.value = ResponseItemVO(isError = false,response = response.body()!!)
- }
- }
- })
- }
-
- fun sendChekingPresence(token:String,workerId:String,message:String){
- try{
- getLoginUserCase.sendChekingPresence(token,workerId.toInt(),message).enqueue(object : Callback{
- override fun onResponse(call: Call, response: Response) {
- Log.i("Salix","Mensaje enviado a salix")
+ fun itemGetAvailable(usuario: String, password: String, itemFk: String, warehouseFk: String,callFunction:String)
+ {
+ getSacadorControladorUserCase.itemGetAvailable(usuario, password, itemFk, warehouseFk)
+ .enqueue(object : Callback
+ {
+ override fun onFailure(call: Call, t: Throwable)
+ {
+ _item.value = ItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
+ )
}
- override fun onFailure(call: Call, t: Throwable) {
- Log.i("Salix Error",""+t.message)
+ override fun onResponse(call: Call, response: Response)
+ {
+ if (response.body() == null)
+ {
+ _item.value = ItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,response.message())
+ )
+ } else
+ {
+ _item.value = response.body()
+ }
}
})
- }catch (e:Exception){}
-
}
- fun saleMistakeAdd(usuario:String,password:String,vSaleFk: String, vUserFk: String, vTypeFk: String){
- getSacadorControladorUserCase.saleMistakeAdd(usuario,password,vSaleFk,vUserFk,vTypeFk).enqueue(object :
- Callback {
- override fun onFailure(call: Call, t: Throwable) {
- _response.value = ResponseItemVO(isError = true,errorMessage = ""+t.message!!)
+ fun collectionAddItem(
+ usuario: String,
+ password: String,
+ itemFk: String,
+ quantityFk: String,
+ ticketFk: String,
+ warehouseFk: String,callFunction:String)
+
+ {
+ getSacadorControladorUserCase.collectionAddItem(
+ usuario,
+ password,
+ itemFk,
+ quantityFk,
+ ticketFk,
+ warehouseFk
+ ).enqueue(object : Callback
+ {
+ override fun onFailure(call: Call, t: Throwable)
+ {
+ _responseNew.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
+ )
}
- override fun onResponse(
- call: Call,
- response: Response
- ) {
- if (response.body() == null){
- _response.value = ResponseItemVO(isError = true,errorMessage = "Error en la llamada saleMistakeAdd")
- }else{
- _response.value = ResponseItemVO(isError = false,response = response.body()!!)
+
+ override fun onResponse(call: Call, response: Response)
+ {
+ if (response.body() == null)
+ {
+ _responseNew.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,response.message())
+ )
+ } else
+ {
+ _responseNew.value =
+ ResponseItemVO(isError = false, response = response.body()!!)
}
}
})
}
- fun mistakeType(usuario:String,password:String){
- getSacadorControladorUserCase.mistakeType(usuario,password).enqueue(object : Callback>{
- override fun onFailure(call: Call>, t: Throwable) {
- val listError:ArrayList = ArrayList()
- listError.add(MistakeTypeVO("0",""))
- _mistakeList.value = MistakeTypeListVO(listError)
+ fun saleMove(
+ usuario: String,
+ password: String,
+ saleFk: String,
+ quantity: String,
+ originalQuantity: String,callFunction:String)
+
+ {
+ getSacadorControladorUserCase.saleMove(
+ usuario,
+ password,
+ saleFk,
+ quantity,
+ originalQuantity
+ ).enqueue(object : Callback
+ {
+ override fun onFailure(call: Call, t: Throwable)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
+ )
}
- override fun onResponse(
- call: Call>,
- response: Response>
- ) {
- if (response.body() != null){
- _mistakeList.value = response.body()?.let { MistakeTypeListVO(it) }
- }else{
- val listError:ArrayList = ArrayList()
- listError.add(MistakeTypeVO("0",""))
+ override fun onResponse(call: Call, response: Response)
+ {
+ if (response.body() == null)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,response.message()))
+
+ } else
+ {
+ _response.value = ResponseItemVO(isError = false, response = response.body()!!)
+ }
+ }
+ })
+ }
+
+ fun collectionMissingTrash(
+ usuario: String,
+ password: String,
+ saleFk: String,
+ quantity: String,
+ type: String,
+ warehouseFk: String,
+ originalQuantity: String,callFunction:String
+ )
+ {
+ getSacadorControladorUserCase.collectionMissingTrash(
+ usuario,
+ password,
+ saleFk,
+ quantity,
+ type,
+ warehouseFk,
+ originalQuantity
+ ).enqueue(object : Callback
+ {
+ override fun onFailure(call: Call, t: Throwable)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
+ )
+ }
+
+ override fun onResponse(call: Call, response: Response)
+ {
+ if (response.body() == null)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,response.message())
+ )
+ } else
+ {
+ _response.value = ResponseItemVO(isError = false, response = response.body()!!)
+ }
+ }
+ })
+ }
+
+ fun saleTrackingDel(usuario: String, password: String, saleFk: String,callFunction:String)
+ {
+ getSacadorControladorUserCase.saleTrackingDel(usuario, password, saleFk)
+ .enqueue(object : Callback
+ {
+ override fun onFailure(call: Call, t: Throwable)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
+ )
+ }
+
+ override fun onResponse(call: Call, response: Response)
+ {
+ if (response.body() == null)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,response.message())
+ )
+ } else
+ {
+ _response.value =
+ ResponseItemVO(isError = false, response = response.body()!!)
+ }
+ }
+ })
+ }
+
+ fun parking(usuario: String, password: String, ticketFk: String, parking: String,callFunction:String)
+ {
+ getUbicadorUserCase.shelvingPark(usuario, password, ticketFk, parking)
+ .enqueue(object : Callback
+ {
+ override fun onFailure(call: Call, t: Throwable)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
+ )
+ }
+
+ override fun onResponse(call: Call, response: Response)
+ {
+
+ if (response.body() == null)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,response.message())
+ )
+ } else
+ {
+ _response.value =
+ ResponseItemVO(isError = false, response = response.body()!!)
+ }
+ }
+ })
+ }
+
+ fun collectionUpdateState(
+ usuario: String,
+ password: String,
+ collectionFk: String,
+ state: String,callFunction:String
+ )
+ {
+ getSacadorControladorUserCase.collectionUpdateState(usuario, password, collectionFk, state)
+ .enqueue(object : Callback
+ {
+ override fun onFailure(call: Call, t: Throwable)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage =getMessageFromAllResponse(callFunction,t.message!!)
+ )
+ }
+
+ override fun onResponse(call: Call, response: Response)
+ {
+ if (response.body() == null)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,response.message())
+ )
+ } else
+ {
+ _response.value =
+ ResponseItemVO(isError = false, response = response.body()!!)
+ }
+ }
+ })
+ }
+
+ fun getIdFromCode(usuario: String, password: String, code: String,callFunction:String)
+ {
+ getSacadorControladorUserCase.getIdFromCode(usuario, password, code)
+ .enqueue(object : Callback
+ {
+ override fun onFailure(call: Call, t: Throwable)
+ {
+ _responseCode.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
+ )
+ }
+
+ override fun onResponse(call: Call, response: Response)
+ {
+ if (response.body() == null)
+ {
+ _responseCode.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,response.message())
+ )
+ } else
+ {
+ _responseCode.value =
+ ResponseItemVO(isError = false, response = response.body()!!)
+ }
+ }
+ })
+ }
+
+ fun collectionIncreaseQuantity(
+ usuario: String,
+ password: String,
+ saleFk: String,
+ quantity: String,callFunction:String
+ )
+ {
+ getSacadorControladorUserCase.collectionIncreaseQuantity(
+ usuario,
+ password,
+ saleFk,
+ quantity,
+
+ ).enqueue(object : Callback
+ {
+ override fun onFailure(call: Call, t: Throwable)
+ {
+ _responseIncQuantity.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
+ )
+ }
+
+ override fun onResponse(call: Call, response: Response)
+ {
+ if (response.body() == null)
+ {
+ _responseIncQuantity.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,response.message())
+ )
+ } else
+ {
+ _responseIncQuantity.value =
+ ResponseItemVO(isError = false, response = response.body()!!)
+ }
+ }
+ })
+ }
+
+ fun sendChekingPresence(token: String, workerId: String, message: String,calledFunction:String)
+ {
+ try
+ {
+ getLoginUserCase.sendChekingPresence(token, workerId.toInt(), message)
+ .enqueue(object : Callback
+ {
+ override fun onResponse(call: Call, response: Response)
+ {
+
+ if (!response.isSuccessful)
+ {
+ _responseSalixMessage.value = ResponseItemVO(
+ isError = true,
+ errorMessage = "Error en la llamada $calledFunction al enviar mensaje rocket." + getMessageFromResponse(
+ response.message()
+ ))
+ //Log.i("Salix","Mensaje enviado a salix")
+ }
+
+ }
+
+ override fun onFailure(call: Call, t: Throwable)
+ {
+
+ //Log.i("Salix Error",""+t.message)
+ }
+ })
+ } catch (e: Exception)
+ {
+ }
+
+ }
+
+ fun saleMistakeAdd(
+ usuario: String,
+ password: String,
+ vSaleFk: String,
+ vUserFk: String,
+ vTypeFk: String,callFunction:String
+ )
+ {
+ getSacadorControladorUserCase.saleMistakeAdd(usuario, password, vSaleFk, vUserFk, vTypeFk)
+ .enqueue(object :
+ Callback
+ {
+ override fun onFailure(call: Call, t: Throwable)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage =getMessageFromAllResponse(callFunction,t.message!!)
+ )
+ }
+
+ override fun onResponse(
+ call: Call,
+ response: Response
+ )
+ {
+ if (response.body() == null)
+ {
+ _response.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,response.message())
+ )
+ } else
+ {
+ _response.value =
+ ResponseItemVO(isError = false, response = response.body()!!)
+ }
+ }
+ })
+ }
+
+ fun mistakeType(usuario: String, password: String)
+ {
+ getSacadorControladorUserCase.mistakeType(usuario, password)
+ .enqueue(object : Callback>
+ {
+ override fun onFailure(call: Call>, t: Throwable)
+ {
+ val listError: ArrayList = ArrayList()
+ listError.add(MistakeTypeVO("0", ""))
_mistakeList.value = MistakeTypeListVO(listError)
}
+
+ override fun onResponse(
+ call: Call>,
+ response: Response>
+ )
+ {
+ if (response.body() != null)
+ {
+ _mistakeList.value = response.body()?.let { MistakeTypeListVO(it) }
+ } else
+ {
+ val listError: ArrayList = ArrayList()
+ listError.add(MistakeTypeVO("0", ""))
+ _mistakeList.value = MistakeTypeListVO(listError)
+ }
+ }
+
+ })
+ }
+
+ fun ticketOrCollection_checkFullyControlled(
+ usuario: String,
+ password: String,
+ collectionFk: String,callFunction:String
+ )
+ {
+ getSacadorControladorUserCase.ticketOrCollection_checkFullyControlled(
+ usuario,
+ password,
+ collectionFk
+ ).enqueue(object :
+ Callback
+ {
+ override fun onFailure(call: Call, t: Throwable)
+ {
+ _responsecheckfully.value = ResponseItemVO(
+ isError = true,
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
+ )
}
- })
- }
- fun ticketOrCollection_checkFullyControlled(usuario:String,password:String,collectionFk:String){
- getSacadorControladorUserCase.ticketOrCollection_checkFullyControlled(usuario,password,collectionFk).enqueue(object :
- Callback {
- override fun onFailure(call: Call, t: Throwable) {
- _responsecheckfully.value = ResponseItemVO(isError = true, errorMessage = "" + t.message!!)
- }
override fun onResponse(
call: Call,
response: Response
- ) {
+ )
+ {
- if (response.body() != "false"){
+ if (response.body() != "false")
+ {
//sergio:
- _responsecheckfully.value = ResponseItemVO(isError = false, response = response.body()!!,errorMessage = "")
+ _responsecheckfully.value = ResponseItemVO(
+ isError = false,
+ response = response.body()!!,
+ errorMessage = ""
+ )
}
}
})
}
-
}
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorFragment.kt
index f5aab8d0..cde3b4d4 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorFragment.kt
@@ -85,7 +85,7 @@ class ControladorFragment : BaseFragment {
override fun onFailure(call: Call, t: Throwable) {
- _collectionTicketList.value = CollectionVO(isError = true,errorMessage = t.message!!)
+ _collectionTicketList.value = CollectionVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,t.message!!))
}
override fun onResponse(
call: Call,
@@ -41,7 +43,7 @@ class ControladorViewModel(context: Context) : BaseViewModel() {
}else{
- _collectionTicketList.value = CollectionVO(isError = true,errorMessage = "No hay tickets para sacar")
+ _collectionTicketList.value = CollectionVO(isError = true,errorMessage = getMessageFromAllResponse(callFunction,response.message()))
}
}
})
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt
index f83cf441..2c7c2df4 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt
@@ -201,7 +201,7 @@ class ControlVehiculoFragment(
if (!goBack) {
splash_progress.visibility = VISIBLE
- viewModel.workerMachinery_isRegistered(user, password)
+ viewModel.workerMachinery_isRegistered(user, password,"workerMachinery_isRegistered")
}
}
@@ -214,10 +214,10 @@ class ControlVehiculoFragment(
)
} else if (direction.equals("IN")) {
splash_progress.visibility = VISIBLE
- viewModel.machineWorker_add(user, password, plateNumber)
+ viewModel.machineWorker_add(user, password, plateNumber,"machineWorker_add")
} else if (direction.equals("OUT")) {
- viewModel.machineWorker_update(user, password, plateNumber)
+ viewModel.machineWorker_update(user, password, plateNumber,"machineWorker_update")
} else if (direction.equals("")) {
(activity as MainActivity).openFragmentPickers()
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoUsuarioFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoUsuarioFragment.kt
index d007c84b..94a53c02 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoUsuarioFragment.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoUsuarioFragment.kt
@@ -67,9 +67,9 @@ class ControlVehiculoUsuarioFragment(
if (userFk.equals(vUserFK)) {
splash_progress.visibility = VISIBLE
- viewModel.machine_getWorkerPlate(user, password)
- viewModel.deviceProduction_getnameDevice(user, password, android_id)
- viewModel.deviceProductionUser_getWorker(user, password, android_id)
+ viewModel.machine_getWorkerPlate(user, password,"machine_getWorkerPlate")
+ viewModel.deviceProduction_getnameDevice(user, password, android_id,"deviceProduction_getnameDevice")
+ viewModel.deviceProductionUser_getWorker(user, password, android_id,"deviceProductionUser_getWorker")
} else {
userFk = vUserFK
@@ -80,7 +80,7 @@ class ControlVehiculoUsuarioFragment(
}
user_image.loadUrl("https://salix.verdnatura.es/api/Images/user/160x160/$userFk/download?access_token=$token")
- viewModel.machine_getWorkerPlate(user, password)
+ viewModel.machine_getWorkerPlate(user, password,"machine_getWorkerPlate")
name_vehiclecontrol.text = user
registered_vehiclecontrol.text = ""
deviceName.text = ""
diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt
index 6152648d..767c6aa8 100644
--- a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt
+++ b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt
@@ -6,6 +6,8 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.GetVehicleControlTimeUserCase
import es.verdnatura.presentation.base.BaseViewModel
+import es.verdnatura.presentation.base.getMessageError
+import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.common.ResponseItemMachineControl
import es.verdnatura.presentation.common.ResponseItemVO
@@ -33,14 +35,14 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() {
fun machineWorker_add(
usuario: String,
password: String,
- PlateNumber: String
+ PlateNumber: String,callFunction:String
) {
getVehicleControlTimeUserCase.machineWorker_add(usuario, password, PlateNumber)
.enqueue(object : Callback {
override fun onFailure(call: Call, t: Throwable) {
_responseinsert.value = ResponseItemVO(
isError = true,
- errorMessage = "Error en la llamada de registro de vehículo"
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
)
}
@@ -48,13 +50,13 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() {
if (response.body() == null || response.body().toString() == "false") {
_responseinsert.value = ResponseItemVO(
isError = true,
- errorMessage = "Error en la llamada. Escanea matrícula de nuevo"
+ errorMessage = getMessageFromAllResponse(callFunction,response.message())
)
} else {
- //_response.value = ResponseItemVO(isError = false,response = response.body()!!)
+
_responseinsert.value =
ResponseItemVO(isError = false, response = response.body()!!.toString())
- //Log.i("VERDNATURA:","Respuesta call vehicle_insert ${response.body()}")
+
}
}
@@ -65,14 +67,14 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() {
fun machineWorker_update(
usuario: String,
password: String,
- PlateNumber: String
+ PlateNumber: String,callFunction:String
) {
getVehicleControlTimeUserCase.machineWorker_update(usuario, password, PlateNumber)
.enqueue(object : Callback {
override fun onFailure(call: Call, t: Throwable) {
_responseinsert.value = ResponseItemVO(
isError = true,
- errorMessage = "Error en la llamada de registro de vehículo"
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
)
}
@@ -80,7 +82,7 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() {
if (response.body() == null || response.body().toString() == "false") {
_responseinsert.value = ResponseItemVO(
isError = true,
- errorMessage = "Error en la llamada. Escanea matrícula de nuevo"
+ errorMessage = getMessageFromAllResponse(callFunction,response.message())
)
} else {
//_response.value = ResponseItemVO(isError = false,response = response.body()!!)
@@ -94,7 +96,7 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() {
})
}
- fun workerMachinery_isRegistered(usuario: String, password: String) {
+ fun workerMachinery_isRegistered(usuario: String, password: String,callFunction:String) {
getVehicleControlTimeUserCase.workerMachinery_isRegistered(
usuario,
password
@@ -102,7 +104,7 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() {
override fun onFailure(call: Call, t: Throwable) {
_responsecontrol.value = ResponseItemVO(
isError = true,
- errorMessage = "Error al comprobar el control vehículo"
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!)
)
}
@@ -110,7 +112,7 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() {
if (response.body() == null) {
_responsecontrol.value = ResponseItemVO(
isError = true,
- errorMessage = "Error al comprobar control vehículo"
+ errorMessage = getMessageFromAllResponse(callFunction,response.message())
)
} else {
_responsecontrol.value =
@@ -124,7 +126,7 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() {
- fun deviceProduction_getnameDevice(usuario: String, password: String, android_id: String) {
+ fun deviceProduction_getnameDevice(usuario: String, password: String, android_id: String,callFunction:String) {
getVehicleControlTimeUserCase.deviceProduction_getnameDevice(
usuario,
password,
@@ -134,7 +136,7 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() {
// Log.i("VERDNATURA::","${t.message}")
_responsemachine.value = ResponseItemMachineControl(
isError = true,
- errorMessage = "Error al comprobar el nombre del dispositivo",
+ errorMessage = getMessageFromAllResponse(callFunction,t.message!!),
type = ""
)
}
@@ -161,7 +163,7 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() {
})
}
- fun deviceProductionUser_getWorker(usuario: String, password: String, userFk: String) {
+ fun deviceProductionUser_getWorker(usuario: String, password: String, userFk: String,callFunction:String) {
getVehicleControlTimeUserCase.deviceProductionUser_getWorker(
usuario,
password,
@@ -170,7 +172,7 @@ class ControlVehiculoViewModel(context: Context) : BaseViewModel() {
override fun onFailure(call: Call