Version 9.8Beta_4897
This commit is contained in:
parent
6b7b0c907a
commit
042979a8fe
|
@ -44,8 +44,8 @@
|
|||
</shared>
|
||||
</component>
|
||||
<component name="AndroidLogFilters">
|
||||
<option name="TOOL_WINDOW_CUSTOM_FILTER" value="verdnatura::" />
|
||||
<option name="TOOL_WINDOW_LOG_LEVEL" value="debug" />
|
||||
<option name="TOOL_WINDOW_CUSTOM_FILTER" value="verdnatura" />
|
||||
<option name="TOOL_WINDOW_LOG_LEVEL" value="error" />
|
||||
<option name="TOOL_WINDOW_CONFIGURED_FILTER" value="No Filters" />
|
||||
<option name="TOOL_WINDOW_REGEXP_FILTER" value="false" />
|
||||
</component>
|
||||
|
@ -83,30 +83,19 @@
|
|||
</select>
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="Version 9.6Beta. TEST7">
|
||||
<list default="true" id="fa688d1c-dbee-4864-9e33-4d84ef9afca8" name="Default Changelist" comment="Version 9.6Beta.Modificadas llamadas y fallo en checkItemScan">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetItemCardUserCase.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetItemCardUserCase.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetPaletizadoresUserCase.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetPaletizadoresUserCase.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetSacadorControladorUserCase.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetSacadorControladorUserCase.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetVehicleControlTimeUserCase.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetVehicleControlTimeUserCase.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetInventaryUserCase.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/GetInventaryUserCase.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/VerdnaturaService.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/articulo/fragment/ItemCardViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragmentViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buffer/fragment/BufferFragmentViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/buscaritem/fragment/BuscarItemViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/BuyersViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/calidad/fragment/QaualityViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/ClaimViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/claim/fragment/ClaimViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/adapter/SaleAdapter.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlador/fragment/ControladorViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/fragment/DayOfSaleViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/diadeventa/fragment/DayOfSaleViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/faltas/fragment/FaltasViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoarticulo/fragment/HistoricoArticuloViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelving/fragment/ItemShelvingLogViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelvinglog/fragment/shelvingLogViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicoshelvinglog/fragment/shelvingLogViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/historicovehiculo/fragment/HistoricoVehiculoViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/showticket/ShowTicketViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/showticket/ShowTicketViewModel.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemViewModel.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemViewModel.kt" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -425,6 +414,13 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1618825571576</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00056" summary="Version 8.2 Subida de ficheros que no estaban versionados">
|
||||
<created>1651648467597</created>
|
||||
<option name="number" value="00056" />
|
||||
<option name="presentableId" value="LOCAL-00056" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1651648467597</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00057" summary="Version 8.3 Diseño grafico, llamadas a Salix y return "Finish"">
|
||||
<created>1652788345754</created>
|
||||
<option name="number" value="00057" />
|
||||
|
@ -761,14 +757,7 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1670915898013</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00105" summary="Version 9.6Beta. TEST7">
|
||||
<created>1670944142191</created>
|
||||
<option name="number" value="00105" />
|
||||
<option name="presentableId" value="LOCAL-00105" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1670944142191</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="106" />
|
||||
<option name="localTasksCounter" value="105" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.History.Properties">
|
||||
|
@ -870,6 +859,7 @@
|
|||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
||||
<MESSAGE value="Version 9.2Beta-Controlador sin animacion y vuelve al sitio" />
|
||||
<MESSAGE value="Version 9 Arreglado vuelta atrás controlador" />
|
||||
<MESSAGE value="Version 9.2.1 Refactor Inicio" />
|
||||
<MESSAGE value="Version 9.2.1 Refactor Inicio, pintar a través del rgb, modificado diseño,se añade shelvingLog y muestra colección a través de ticket" />
|
||||
|
@ -894,32 +884,11 @@
|
|||
<MESSAGE value="Version 9.6Beta. TEST6-final: Modificando llamadas con clase" />
|
||||
<MESSAGE value="Version 9.6Beta. TEST6-final: Modificando llamadas a SilexCallback (AjustesFragment)" />
|
||||
<MESSAGE value="Version 9.6Beta. TEST6-13122022. Dos revisiones de ubicador." />
|
||||
<MESSAGE value="Version 9.6Beta. TEST7" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Version 9.6Beta. TEST7" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Version 9.6Beta. TEST6-13122022. Dos revisiones de ubicador." />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<breakpoints>
|
||||
<line-breakpoint enabled="true" suspend="THREAD" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/login/fragment/LoginFragment.kt</url>
|
||||
<line>351</line>
|
||||
<option name="timeStamp" value="10" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" suspend="THREAD" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt</url>
|
||||
<line>694</line>
|
||||
<option name="timeStamp" value="13" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" suspend="THREAD" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt</url>
|
||||
<line>695</line>
|
||||
<option name="timeStamp" value="14" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" suspend="THREAD" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt</url>
|
||||
<line>699</line>
|
||||
<option name="timeStamp" value="15" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" suspend="THREAD" type="kotlin-line">
|
||||
<url>file://$PROJECT_DIR$/app/src/main/java/es/verdnatura/domain/SilexCallback.kt</url>
|
||||
<line>34</line>
|
||||
|
|
|
@ -28,12 +28,12 @@ class GetInventaryUserCase(context: Context) : RestClient(context) {
|
|||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(warehouseFk)
|
||||
return restClient!!.faultsReview(
|
||||
"json",
|
||||
/* "json",
|
||||
"1",
|
||||
usuario,
|
||||
password,
|
||||
"application/json",
|
||||
params = params
|
||||
params = params*/
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -47,12 +47,12 @@ class GetInventaryUserCase(context: Context) : RestClient(context) {
|
|||
params.add(itemFk)
|
||||
params.add(warehouseFk)
|
||||
return restClient!!.faultsReview_isChecked(
|
||||
"json",
|
||||
/* "json",
|
||||
"1",
|
||||
usuario,
|
||||
password,
|
||||
"application/json",
|
||||
params = params
|
||||
params = params*/
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -579,23 +579,14 @@ interface VerdnaturaService {
|
|||
|
||||
@POST("almacennew/faultsReview")//REVISADA
|
||||
fun faultsReview(
|
||||
@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<String>
|
||||
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<List<ItemFaltasVO>>
|
||||
|
||||
@POST("almacennew/faultsReview_isChecked")//REVISADA
|
||||
fun faultsReview_isChecked(
|
||||
@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<String>
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
|
||||
|
@ -681,8 +672,7 @@ interface VerdnaturaService {
|
|||
|
||||
@POST("almacennew/itemShelvingMake_multi")//REVISADA
|
||||
fun itemShelvingMake_multi(
|
||||
|
||||
@Body params: List<Any>
|
||||
@Body vararg params: Any
|
||||
):
|
||||
Call<Any>
|
||||
|
||||
|
|
|
@ -59,11 +59,10 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
} else {
|
||||
_responseinsert.value = ResponseItemVO(
|
||||
isError = true,
|
||||
isError = false,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
nameofFunction(this),response.message()),
|
||||
response=response.body().toString()
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import android.content.Context
|
|||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.GetDayOfSaleUSerCase
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -13,14 +13,9 @@ import es.verdnatura.presentation.common.ResponseItemVO
|
|||
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate
|
||||
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDateList
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
import timber.log.Timber.i
|
||||
|
||||
class DayOfSaleViewModel(context: Context) : BaseViewModel(context) {
|
||||
private val GetDayOfSaleUSerCase: GetDayOfSaleUSerCase =
|
||||
GetDayOfSaleUSerCase(context)
|
||||
|
||||
class DayOfSaleViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val response: LiveData<ResponseItemVO>
|
||||
|
@ -35,8 +30,8 @@ class DayOfSaleViewModel(context: Context) : BaseViewModel(context) {
|
|||
|
||||
fun itemShelving_getSaleDate(vShelvingFK: String) {
|
||||
silex.itemShelving_getSaleDate(vShelvingFK).enqueue(object :
|
||||
Callback<List<ItemShelvingSaleDate>> {
|
||||
override fun onFailure(call: Call<List<ItemShelvingSaleDate>>, t: Throwable) {
|
||||
SilexCallback<List<ItemShelvingSaleDate>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemShelvingSaleDate> = ArrayList()
|
||||
listError.add(
|
||||
ItemShelvingSaleDate(
|
||||
|
@ -47,25 +42,17 @@ class DayOfSaleViewModel(context: Context) : BaseViewModel(context) {
|
|||
_itemShelvingSaleDateList.value = ItemShelvingSaleDateList(listError)
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<List<ItemShelvingSaleDate>>,
|
||||
response: Response<List<ItemShelvingSaleDate>>
|
||||
) {
|
||||
override fun onSuccess(response: Response<List<ItemShelvingSaleDate>>) {
|
||||
|
||||
if (!response.isSuccessful) {
|
||||
|
||||
}
|
||||
if (response.body() != null) {
|
||||
|
||||
_itemShelvingSaleDateList.value = response.body()?.let {
|
||||
ItemShelvingSaleDateList(it)
|
||||
}
|
||||
i("finalizada la lista ${response.body()}")
|
||||
|
||||
} else {
|
||||
if (!response.isSuccessful) {
|
||||
|
||||
|
||||
val listError: ArrayList<ItemShelvingSaleDate> = ArrayList()
|
||||
listError.add(
|
||||
ItemShelvingSaleDate(
|
||||
|
@ -84,23 +71,21 @@ class DayOfSaleViewModel(context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
/* fun getListFromJSON(json: JsonObject): MutableList<itemsExpeditionDynamics> {
|
||||
val gson = Gson()
|
||||
var list = mutableListOf<itemsExpeditionDynamics>()
|
||||
var expeditionState: Map<String, Any> = gson.fromJson(json, object : TypeToken<Map<String, Any>>() {}.type)
|
||||
expeditionState.forEach {
|
||||
|
||||
list.add(itemsExpeditionDynamics(key=it.key,value=it.value.toString()))
|
||||
|
||||
}
|
||||
return list
|
||||
}*/
|
||||
|
||||
fun parking(scanItem: String, parking: String) {
|
||||
GetDayOfSaleUSerCase.shelvingPark(scanItem, parking).enqueue(object :
|
||||
Callback<Any> {
|
||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||
silex.shelvingPark(scanItem, parking).enqueue(object :
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
|
@ -108,21 +93,7 @@ class DayOfSaleViewModel(context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
||||
|
||||
/*
|
||||
if (response.isSuccessful == null){
|
||||
_response.value = ResponseItemVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()))
|
||||
}else{*/
|
||||
if (response.isSuccessful)
|
||||
_response.value = ResponseItemVO(isError = false, response = response.message())
|
||||
else
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
})
|
||||
|
|
|
@ -3,8 +3,7 @@ package es.verdnatura.presentation.view.feature.faltas.fragment
|
|||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetInventaryUserCase
|
||||
import es.verdnatura.domain.GetItemCardUserCase
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
|
@ -12,15 +11,9 @@ import es.verdnatura.presentation.common.ResponseItemVO
|
|||
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasListVO
|
||||
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
||||
class FaltasViewModel(context: Context) : BaseViewModel(context) {
|
||||
|
||||
|
||||
private val getInventaryUserCase: GetInventaryUserCase = GetInventaryUserCase(context)
|
||||
private val getItemCardUserCase: GetItemCardUserCase = GetItemCardUserCase(context)
|
||||
|
||||
class FaltasViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
private val _faltasList by lazy { MutableLiveData<ItemFaltasListVO>() }
|
||||
val faltasList: LiveData<ItemFaltasListVO>
|
||||
|
@ -35,9 +28,9 @@ class FaltasViewModel(context: Context) : BaseViewModel(context) {
|
|||
|
||||
|
||||
fun getFaltas(user: String, password: String, warehouseFk: String) {
|
||||
getInventaryUserCase.faultsReview(user, password, warehouseFk).enqueue(object :
|
||||
Callback<List<ItemFaltasVO>> {
|
||||
override fun onFailure(call: Call<List<ItemFaltasVO>>, t: Throwable) {
|
||||
silex.faultsReview(user, password, warehouseFk).enqueue(object :
|
||||
SilexCallback<List<ItemFaltasVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemFaltasVO> = ArrayList()
|
||||
listError.add(
|
||||
ItemFaltasVO(
|
||||
|
@ -48,10 +41,7 @@ class FaltasViewModel(context: Context) : BaseViewModel(context) {
|
|||
_faltasList.value = ItemFaltasListVO(listError)
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<List<ItemFaltasVO>>,
|
||||
response: Response<List<ItemFaltasVO>>
|
||||
) {
|
||||
override fun onSuccess(response: Response<List<ItemFaltasVO>>) {
|
||||
if (response.body() != null) {
|
||||
_faltasList.value = response.body()?.let { ItemFaltasListVO(it) }
|
||||
} else {
|
||||
|
@ -78,10 +68,10 @@ class FaltasViewModel(context: Context) : BaseViewModel(context) {
|
|||
newValue: String,
|
||||
isTrash: String
|
||||
) {
|
||||
getItemCardUserCase.itemStockUpdate( itemFk, warehouseFk, newValue, isTrash)
|
||||
silex.itemTrash(itemFk, warehouseFk, newValue, isTrash)
|
||||
.enqueue(object :
|
||||
Callback<Any> {
|
||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
|
@ -113,29 +103,21 @@ class FaltasViewModel(context: Context) : BaseViewModel(context) {
|
|||
itemFk: String,
|
||||
warehouseFk: String
|
||||
) {
|
||||
getInventaryUserCase.faultsReview_isChecked(user, password, itemFk, warehouseFk)
|
||||
silex.faultsReview_isChecked(user, password, itemFk, warehouseFk)
|
||||
.enqueue(object :
|
||||
Callback<Any> {
|
||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
||||
if (!response.isSuccessful) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
} else {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message())
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
|
|
@ -4,21 +4,16 @@ import android.content.Context
|
|||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.GetItemCardUserCase
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.Event
|
||||
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoListVO
|
||||
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
||||
class HistoricoArticuloViewModel(context: Context) : BaseViewModel(context) {
|
||||
private val getItemCardUserCase: GetItemCardUserCase = GetItemCardUserCase(context)
|
||||
|
||||
|
||||
class HistoricoArticuloViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
private val _historicoList by lazy { MutableLiveData<ItemHistoricoListVO>() }
|
||||
val historicoList: LiveData<ItemHistoricoListVO>
|
||||
|
@ -30,22 +25,32 @@ class HistoricoArticuloViewModel(context: Context) : BaseViewModel(context) {
|
|||
|
||||
fun itemDiary(itemFk: Int, vWarehouseFk: Int) {
|
||||
silex.itemDiary(itemFk, vWarehouseFk).enqueue(object :
|
||||
Callback<List<ItemHistoricoVO>> {
|
||||
override fun onFailure(call: Call<List<ItemHistoricoVO>>, t: Throwable) {
|
||||
SilexCallback<List<ItemHistoricoVO>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemHistoricoVO> = ArrayList()
|
||||
listError.add(ItemHistoricoVO(isError = true,errorMessage =getMessageFromAllResponse(nameofFunction(this),t.message!!)))
|
||||
listError.add(
|
||||
ItemHistoricoVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_historicoList.value = ItemHistoricoListVO(listError)
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<List<ItemHistoricoVO>>,
|
||||
response: Response<List<ItemHistoricoVO>>
|
||||
) {
|
||||
override fun onSuccess(response: Response<List<ItemHistoricoVO>>) {
|
||||
if (response.body() != null) {
|
||||
_historicoList.value = response.body()?.let { ItemHistoricoListVO(it) }
|
||||
} else {
|
||||
val listError: ArrayList<ItemHistoricoVO> = ArrayList()
|
||||
listError.add(ItemHistoricoVO(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())))
|
||||
listError.add(
|
||||
ItemHistoricoVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_historicoList.value = ItemHistoricoListVO(listError)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,29 +2,18 @@ package es.verdnatura.presentation.view.feature.historicoshelving.fragment
|
|||
|
||||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.itemShelvingLogUSerCase
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.Event
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
|
||||
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDateList
|
||||
import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLogList
|
||||
import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLog
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLogList
|
||||
import retrofit2.Response
|
||||
import timber.log.Timber.i
|
||||
|
||||
class itemShelvingLogViewModel(context: Context) : BaseViewModel(context) {
|
||||
private val itemShelvingLogUSerCase: itemShelvingLogUSerCase =
|
||||
itemShelvingLogUSerCase(context)
|
||||
|
||||
|
||||
class itemShelvingLogViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
private val _itemShelvingLogList by lazy { MutableLiveData<ItemShelvingLogList>() }
|
||||
|
||||
|
@ -32,37 +21,27 @@ class itemShelvingLogViewModel(context: Context) : BaseViewModel(context) {
|
|||
val loadItemShelvingLogList = Transformations.map(_itemShelvingLogList) { Event(it) }
|
||||
|
||||
|
||||
|
||||
fun itemShelvingLog_get(vShelvingFK: String) {
|
||||
silex.itemShelvingLog_get(vShelvingFK).enqueue(object :
|
||||
Callback<List<ItemShelvingLog>> {
|
||||
override fun onFailure(call: Call<List<ItemShelvingLog>>, t: Throwable) {
|
||||
SilexCallback<List<ItemShelvingLog>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemShelvingLog> = ArrayList()
|
||||
listError.add(ItemShelvingLog(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)))
|
||||
listError.add(
|
||||
ItemShelvingLog(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_itemShelvingLogList.value = ItemShelvingLogList(listError)
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<List<ItemShelvingLog>>,
|
||||
response: Response<List<ItemShelvingLog>>
|
||||
) {
|
||||
override fun onSuccess(response: Response<List<ItemShelvingLog>>) {
|
||||
|
||||
if (!response.isSuccessful){
|
||||
val listError:ArrayList<ItemShelvingLog> = ArrayList()
|
||||
listError.add(ItemShelvingLog(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())))
|
||||
_itemShelvingLogList.value = ItemShelvingLogList(listError)
|
||||
}else{
|
||||
|
||||
if (response.body() != null)
|
||||
{
|
||||
i("crea la lista %s", response.body())
|
||||
if (response.body() != null) {
|
||||
_itemShelvingLogList.value = response.body()?.let {
|
||||
ItemShelvingLogList(it)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -71,7 +50,6 @@ class itemShelvingLogViewModel(context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4,83 +4,26 @@ package es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment
|
|||
import android.content.Context
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.Event
|
||||
import es.verdnatura.presentation.view.feature.historicoshelvinglog.model.ShelvingLogSalix
|
||||
import es.verdnatura.presentation.view.feature.historicoshelvinglog.model.ShelvingLogSalixList
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
||||
|
||||
class shelvingLogViewModel(context: Context) : BaseViewModel(context) {
|
||||
/* private val itemShelvingLogUSerCase: itemShelvingLogUSerCase =
|
||||
itemShelvingLogUSerCase(context)*/
|
||||
|
||||
/*private val _itemShelvingLogList by lazy { MutableLiveData<ShelvingLogList>() }
|
||||
val loadShelvingLogList = Transformations.map(_itemShelvingLogList) { Event(it) }*/
|
||||
class shelvingLogViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
private val _itemShelvingLogSalixList by lazy { MutableLiveData<ShelvingLogSalixList>() }
|
||||
val loadShelvingLogSalixList = Transformations.map(_itemShelvingLogSalixList) { Event(it) }
|
||||
|
||||
/* private val _shelvingResponse by lazy { MutableLiveData<ShelvingLogSalix>() }
|
||||
val shelvingResponse: LiveData<ShelvingLogSalix>
|
||||
get() = _shelvingResponse*/
|
||||
|
||||
/*fun shelvingLog_get(usuario: String, password: String, vShelvingFK: String) {
|
||||
itemShelvingLogUSerCase.shelvingLog_get(usuario, password, vShelvingFK).enqueue(object :
|
||||
Callback<List<ShelvingLog>> {
|
||||
override fun onFailure(call: Call<List<ShelvingLog>>, t: Throwable) {
|
||||
val listError: ArrayList<ShelvingLog> = ArrayList()
|
||||
listError.add(
|
||||
ShelvingLog(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_itemShelvingLogList.value = ShelvingLogList(listError)
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<List<ShelvingLog>>,
|
||||
response: Response<List<ShelvingLog>>
|
||||
) {
|
||||
|
||||
if (!response.isSuccessful) {
|
||||
val listError: ArrayList<ShelvingLog> = ArrayList()
|
||||
listError.add(
|
||||
ShelvingLog(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_itemShelvingLogList.value = ShelvingLogList(listError)
|
||||
} else {
|
||||
|
||||
if (response.body() != null) {
|
||||
_itemShelvingLogList.value = response.body()?.let {
|
||||
ShelvingLogList(it)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}*/
|
||||
|
||||
fun Shelvings(vShelvingFK: String) {
|
||||
salix.Shelvings(vShelvingFK).enqueue(object :
|
||||
Callback<List<ShelvingLogSalix>> {
|
||||
override fun onFailure(call: Call<List<ShelvingLogSalix>>, t: Throwable) {
|
||||
SilexCallback<List<ShelvingLogSalix>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
||||
val listError: ArrayList<ShelvingLogSalix> = ArrayList()
|
||||
listError.add(
|
||||
ShelvingLogSalix(
|
||||
|
@ -91,33 +34,24 @@ class shelvingLogViewModel(context: Context) : BaseViewModel(context) {
|
|||
_itemShelvingLogSalixList.value = ShelvingLogSalixList(listError)
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<List<ShelvingLogSalix>>,
|
||||
response: Response<List<ShelvingLogSalix>>
|
||||
) {
|
||||
|
||||
if (!response.isSuccessful) {
|
||||
val listError: ArrayList<ShelvingLogSalix> = ArrayList()
|
||||
listError.add(
|
||||
ShelvingLogSalix(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_itemShelvingLogSalixList.value = ShelvingLogSalixList(listError)
|
||||
|
||||
} else {
|
||||
override fun onSuccess(response: Response<List<ShelvingLogSalix>>) {
|
||||
|
||||
if (response.body() != null) {
|
||||
_itemShelvingLogSalixList.value = response.body()?.let {
|
||||
ShelvingLogSalixList(it)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} else {
|
||||
val listError: ArrayList<ShelvingLogSalix> = ArrayList()
|
||||
listError.add(
|
||||
ShelvingLogSalix(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_itemShelvingLogSalixList.value = ShelvingLogSalixList(listError)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3,50 +3,49 @@ package es.verdnatura.presentation.view.feature.historicovehiculo.fragment
|
|||
import android.content.Context
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Transformations
|
||||
import es.verdnatura.domain.GetVehicleControlTimeUserCase
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.Event
|
||||
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculo
|
||||
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculoList
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
import timber.log.Timber.d
|
||||
import timber.log.Timber.i
|
||||
|
||||
class HistoricoVehiculoViewModel (context: Context) : BaseViewModel(context) {
|
||||
private val GetVehicleControlTimeUserCase: GetVehicleControlTimeUserCase = GetVehicleControlTimeUserCase(context)
|
||||
|
||||
class HistoricoVehiculoViewModel(var context: Context) : BaseViewModel(context) {
|
||||
|
||||
private val _historicovehiculoList by lazy { MutableLiveData<ItemHistoricoVehiculoList>() }
|
||||
|
||||
|
||||
val loadHistoricoVehiculoList = Transformations.map(_historicovehiculoList) { Event(it) }
|
||||
|
||||
|
||||
fun machineWorker_getHistorical(plateNumber: String) {
|
||||
silex.machineWorker_getHistorical(plateNumber).enqueue(object :
|
||||
Callback<List<ItemHistoricoVehiculo>> {
|
||||
override fun onFailure(call: Call<List<ItemHistoricoVehiculo>>, t: Throwable) {
|
||||
SilexCallback<List<ItemHistoricoVehiculo>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
val listError: ArrayList<ItemHistoricoVehiculo> = ArrayList()
|
||||
listError.add(ItemHistoricoVehiculo(isError = true,errorMessage =getMessageFromAllResponse(nameofFunction(this),t.message!!)))
|
||||
listError.add(
|
||||
ItemHistoricoVehiculo(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
)
|
||||
_historicovehiculoList.value = ItemHistoricoVehiculoList(listError)
|
||||
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<List<ItemHistoricoVehiculo>>,
|
||||
response: Response<List<ItemHistoricoVehiculo>>
|
||||
) {
|
||||
override fun onSuccess(response: Response<List<ItemHistoricoVehiculo>>) {
|
||||
if (response.body() != null) {
|
||||
|
||||
_historicovehiculoList.value = response.body()?.let { ItemHistoricoVehiculoList(it) }
|
||||
|
||||
_historicovehiculoList.value =
|
||||
response.body()?.let { ItemHistoricoVehiculoList(it) }
|
||||
} else {
|
||||
val listError: ArrayList<ItemHistoricoVehiculo> = ArrayList()
|
||||
listError.add(ItemHistoricoVehiculo(isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())))
|
||||
listError.add(
|
||||
ItemHistoricoVehiculo(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
)
|
||||
_historicovehiculoList.value = ItemHistoricoVehiculoList(listError)
|
||||
|
||||
}
|
||||
|
|
|
@ -3,44 +3,43 @@ package es.verdnatura.presentation.view.feature.precontrol
|
|||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.domain.GetPreControladorUserCase
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import es.verdnatura.presentation.view.feature.collection.mapper.map
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
||||
class ShowTicketViewModel(context: Context) : BaseViewModel(context) {
|
||||
private val contextApp=context
|
||||
|
||||
private val getPreControladorUserCase: GetPreControladorUserCase = GetPreControladorUserCase(context)
|
||||
class ShowTicketViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
private val _collectionTicketList by lazy { MutableLiveData<CollectionVO>() }
|
||||
val collectionTicketList: LiveData<CollectionVO>
|
||||
get() = _collectionTicketList
|
||||
|
||||
private val _responseTicket by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseTicket: LiveData<ResponseItemVO>
|
||||
get() = _responseTicket
|
||||
|
||||
fun collectionTicketGet(collectionFk: Int, sectorFk: Int, print: String, type: String) {
|
||||
silex.collection_getTickets(collectionFk, sectorFk, print, type).enqueue(object :
|
||||
Callback<CollectionVO> {
|
||||
override fun onFailure(call: Call<CollectionVO>, t: Throwable) {
|
||||
_collectionTicketList.value = CollectionVO(0,isError = true,errorMessage =getMessageFromAllResponse(nameofFunction(this),t.message!!))
|
||||
SilexCallback<CollectionVO>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_collectionTicketList.value = CollectionVO(
|
||||
0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
override fun onResponse(
|
||||
call: Call<CollectionVO>,
|
||||
response: Response<CollectionVO>
|
||||
) {
|
||||
|
||||
override fun onSuccess(response: Response<CollectionVO>) {
|
||||
if (response.body() != null) {
|
||||
_collectionTicketList.value = response.body()?.let { it.map(contextApp) }
|
||||
_collectionTicketList.value = response.body()?.let { it.map(context) }
|
||||
} else {
|
||||
_collectionTicketList.value = CollectionVO(0,isError = true,errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message()))
|
||||
_collectionTicketList.value = CollectionVO(
|
||||
0,
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -3,19 +3,15 @@ package es.verdnatura.presentation.view.feature.ubicador.fragment
|
|||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.GetUbicadorUserCase
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
import es.verdnatura.presentation.base.getMessageFromAllResponse
|
||||
import es.verdnatura.presentation.base.nameofFunction
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import retrofit2.Call
|
||||
import retrofit2.Callback
|
||||
import retrofit2.Response
|
||||
|
||||
class AutomaticAddItemViewModel(context: Context) : BaseViewModel(context) {
|
||||
class AutomaticAddItemViewModel(val context: Context) : BaseViewModel(context) {
|
||||
|
||||
|
||||
private val getUbicadorUserCase: GetUbicadorUserCase = GetUbicadorUserCase(context)
|
||||
private val _response by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val response: LiveData<ResponseItemVO>
|
||||
get() = _response
|
||||
|
@ -26,10 +22,10 @@ class AutomaticAddItemViewModel(context: Context) : BaseViewModel(context) {
|
|||
items: List<Int>,
|
||||
warehouse: Int
|
||||
) {
|
||||
getUbicadorUserCase.itemShelvingMake_multi(shelving, items, warehouse)
|
||||
silex.itemShelvingMake_multi(shelving, items, warehouse)
|
||||
.enqueue(object :
|
||||
Callback<Any> {
|
||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true, errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this), t.message!!
|
||||
|
@ -37,19 +33,10 @@ class AutomaticAddItemViewModel(context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
||||
if (!response.isSuccessful) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()!!
|
||||
)
|
||||
)
|
||||
} else {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
@ -67,8 +54,8 @@ class AutomaticAddItemViewModel(context: Context) : BaseViewModel(context) {
|
|||
isChecking,
|
||||
warehouse
|
||||
).enqueue(object :
|
||||
Callback<Any> {
|
||||
override fun onFailure(call: Call<Any>, t: Throwable) {
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true, errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this), t.message!!
|
||||
|
@ -76,19 +63,9 @@ class AutomaticAddItemViewModel(context: Context) : BaseViewModel(context) {
|
|||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Any>, response: Response<Any>) {
|
||||
if (!response.isSuccessful) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()!!
|
||||
)
|
||||
)
|
||||
} else {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.message()!!)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue