Añadido funcionalidad nueva de PreSacador y solucionado tema de la referencia en ItemCard. Cambiado forma de coger vehículo y arreglado volver atrás en controaldor
This commit is contained in:
parent
897061f92b
commit
c423a765ef
|
@ -134,7 +134,7 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_sacador.xml" value="0.12952898550724637" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_sacador_associatesmarttag.xml" value="0.22" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_shelving_parking.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_shelvinglog.xml" value="0.13269927536231885" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_shelvinglog.xml" value="0.3333333333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_smarttag_register.xml" value="0.3118811881188119" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_transferencia.xml" value="0.10666666666666667" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_ubicador.xml" value="0.22" />
|
||||
|
@ -168,7 +168,7 @@
|
|||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_proposal_row.xml" value="0.22604166666666667" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_reposicion.xml" value="0.1" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_shelvingdayofsale_row.xml" value="0.2375" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_shelvinglog_row.xml" value="0.21739130434782608" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_shelvinglog_row.xml" value="0.3333333333333333" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_shelvingparking_row.xml" value="0.1793478260869565" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_smarttag_row.xml" value="0.20153985507246377" />
|
||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_toolbar_row.xml" value="0.15307971014492755" />
|
||||
|
|
|
@ -14,8 +14,12 @@ android {
|
|||
applicationId "es.verdnatura"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
versionCode 102
|
||||
versionName "7.7" //VERSION CODE 102.Incorpora pantalla Fallo trabajador, ara es guarda i recupera el sector en bbdd, es lleva demanar permisos de sonido,
|
||||
versionCode 106
|
||||
versionName "7.8" //VERSION CODE 106 Previa final,tiene en cuenta si hay varios carros donde coger,,
|
||||
//versionName "7.7.2" //VERSION CODE 105 Previa final , si se pone a 0 un artículo se revisa el total de líneas
|
||||
//versionName "7.7.2" //VERSION CODE 103 Reparado previa que se duplicaban los iconos en previa
|
||||
//versionName "7.7.1" //VERSION CODE 103 Estaba salix en test.
|
||||
//versionName "7.7" //VERSION CODE 102.Incorpora pantalla Fallo trabajador, ara es guarda i recupera el sector en bbdd, es lleva demanar permisos de sonido,
|
||||
// i es soluciona l'error en Pasillero que tancava la app en antics mòvils.S'afegeix camp prioritat al buscar item. No demana posar vehicle un altra vegada al fer botó enrere.
|
||||
//versionName "7.6.1" //VERSION CODE 101. Pide las baldas, se había quitado sin querer y se quita menú Voz
|
||||
//versionName "7.6" //VERSION CODE 100. Envios rocket a previa, revisados databinding layouts,
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 102,
|
||||
"versionName": "7.7",
|
||||
"versionCode": 106,
|
||||
"versionName": "7.8",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
|
|
Binary file not shown.
|
@ -7,7 +7,7 @@ class ApiSalixUtils {
|
|||
companion object {
|
||||
//const val BASE_URL:String = "http://192.168.1.155:9009/"
|
||||
const val BASE_URL: String = "https://salix.verdnatura.es/api/"
|
||||
//const val BASE_URL: String = "https://test-salix.verdnatura.es/api/"
|
||||
// const val BASE_URL: String = "https://test-salix.verdnatura.es/api/"
|
||||
fun getApiService(): SalixService {
|
||||
val salixRetrofit = Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(
|
||||
GsonConverterFactory.create()
|
||||
|
|
|
@ -8,6 +8,8 @@ object ConstAndValues {
|
|||
const val ON_PREPARATION = "ON_PREPARATION"
|
||||
//const val CHECKED = "CHECKED"
|
||||
const val PRESACADOR = "PRESACADOR" //PREITEMPICKER
|
||||
const val PREITEMPICKER = "PREITEMPICKER"
|
||||
|
||||
const val ON_CHECKING = "ON_CHECKING"
|
||||
const val PRECHECKER = "PRECHECKER"
|
||||
const val MAINACTIVITY = "MAIN"
|
||||
|
|
|
@ -2,6 +2,7 @@ package es.verdnatura.domain
|
|||
|
||||
import android.content.Context
|
||||
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import retrofit2.Call
|
||||
|
||||
class GetPreSacadorUseCase(context: Context) : RestClient(context) {
|
||||
|
@ -61,4 +62,111 @@ class GetPreSacadorUseCase(context: Context) : RestClient(context) {
|
|||
)
|
||||
}
|
||||
|
||||
}
|
||||
fun sectorCollection_new(
|
||||
usuario: String,
|
||||
password: String,
|
||||
sectorFk: String
|
||||
|
||||
): Call<Unit> {
|
||||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(sectorFk)
|
||||
return restClient!!.sectorCollection_new(
|
||||
"json",
|
||||
"1",
|
||||
usuario,
|
||||
password,
|
||||
"application/json",
|
||||
params
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
fun sectorCollectionSaleGroup_add(
|
||||
usuario: String,
|
||||
password: String,
|
||||
vSaleGroupFk: String,
|
||||
vSectorCollectionFk:String
|
||||
|
||||
): Call<Unit> {
|
||||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(vSaleGroupFk)
|
||||
params.add(vSectorCollectionFk)
|
||||
return restClient!!.sectorCollectionSaleGroup_add(
|
||||
"json",
|
||||
"1",
|
||||
usuario,
|
||||
password,
|
||||
"application/json",
|
||||
params
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
fun saleTracking_addPrevOK(
|
||||
usuario: String,
|
||||
password: String,
|
||||
vSectorCollectionFk:String
|
||||
|
||||
): Call<Unit> {
|
||||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(vSectorCollectionFk)
|
||||
return restClient!!.saleTracking_addPrevOK(
|
||||
"json",
|
||||
"1",
|
||||
usuario,
|
||||
password,
|
||||
"application/json",
|
||||
params
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
fun saleTracking_updateIsChecked(
|
||||
usuario: String,
|
||||
password: String,
|
||||
vSaleFk:String,
|
||||
vIsChecked:String
|
||||
|
||||
): Call<Unit> {
|
||||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(vSaleFk)
|
||||
params.add(vIsChecked)
|
||||
return restClient!!.saleTracking_updateIsChecked(
|
||||
"json",
|
||||
"1",
|
||||
usuario,
|
||||
password,
|
||||
"application/json",
|
||||
params
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
||||
fun sectorCollection_get(usuario: String, password: String): Call<List<CollectionVO>> {
|
||||
return restClient!!.sectorCollection_get("json", "1", usuario, password, "application/json")
|
||||
}
|
||||
|
||||
fun sectorCollection_getSale(
|
||||
usuario: String,
|
||||
password: String,
|
||||
sectorCollectionFK: String,
|
||||
vSectorFk:String
|
||||
|
||||
): Call<List<PreSacadorItemVO>> {
|
||||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(sectorCollectionFK)
|
||||
params.add(vSectorFk)
|
||||
|
||||
return restClient!!.sectorCollection_getSale(
|
||||
"json",
|
||||
"1",
|
||||
usuario,
|
||||
password,
|
||||
"application/json",
|
||||
params
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -120,6 +120,9 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
|
|||
// val params:ArrayList<String> = ArrayList()
|
||||
return restClient!!.collectionGet("json", "1", usuario, password, "application/json")
|
||||
}
|
||||
|
||||
|
||||
|
||||
fun collectionGetSalix(token:String): Call<List<CollectionVO>> {
|
||||
// val params:ArrayList<String> = ArrayList()
|
||||
return salixClient!!.getCollectionSalix(content_type = "application/json",token)
|
||||
|
@ -150,22 +153,7 @@ class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
|
|||
)
|
||||
}
|
||||
|
||||
fun saleTracking_update(
|
||||
usuario: String,
|
||||
password: String,
|
||||
saleFk: String
|
||||
): Call<Unit> {
|
||||
val params: ArrayList<String> = ArrayList()
|
||||
params.add(saleFk)
|
||||
return restClient!!.saleTracking_update(
|
||||
"json",
|
||||
"1",
|
||||
usuario,
|
||||
password,
|
||||
"application/json",
|
||||
params
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
fun itemPlacementSupplyAiming(
|
||||
usuario: String,
|
||||
|
|
|
@ -48,4 +48,12 @@ interface SalixService {
|
|||
):
|
||||
Call<List<CollectionVO>>
|
||||
|
||||
|
||||
@GET("collections/sectorCollection_get")
|
||||
fun sectorCollection_get(
|
||||
@Header("Content-Type") content_type: String,
|
||||
@Header("Authorization") authorization: String,
|
||||
):
|
||||
Call<List<CollectionVO>>
|
||||
|
||||
}
|
|
@ -148,6 +148,17 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<List<PreSacadorItemVO>>
|
||||
|
||||
@POST("almacennew/sectorCollection_getSale")//REVISADA
|
||||
fun sectorCollection_getSale(
|
||||
@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>
|
||||
):
|
||||
Call<List<PreSacadorItemVO>>
|
||||
|
||||
@POST("almacennew/itemPlacementSupplyGetOrder")//REVISADA
|
||||
fun itemPlacementSupplyGetOrder(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
|
@ -181,6 +192,17 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<List<CollectionVO>>
|
||||
|
||||
|
||||
@POST("almacennew/sectorCollection_get") //REVISADA
|
||||
fun sectorCollection_get(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
@Header("user") user: String,
|
||||
@Header("pass") pass: String,
|
||||
@Header("Content-Type") content_type: String
|
||||
):
|
||||
Call<List<CollectionVO>>
|
||||
|
||||
@POST("almacennew/collectionNew")//REVISADA
|
||||
fun collectionNew(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
|
@ -192,6 +214,50 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<String>
|
||||
|
||||
@POST("almacennew/sectorCollection_new")//REVISADA
|
||||
fun sectorCollection_new(
|
||||
@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>
|
||||
):
|
||||
Call<Unit>
|
||||
|
||||
@POST("almacennew/sectorCollectionSaleGroup_add")//REVISADA
|
||||
fun sectorCollectionSaleGroup_add(
|
||||
@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>
|
||||
):
|
||||
Call<Unit>
|
||||
|
||||
@POST("almacennew/saleTracking_addPrevOK")//REVISADA
|
||||
fun saleTracking_addPrevOK(
|
||||
@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>
|
||||
):
|
||||
Call<Unit>
|
||||
|
||||
@POST("almacennew/saleTracking_updateIsChecked")//REVISADA
|
||||
fun saleTracking_updateIsChecked(
|
||||
@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>
|
||||
):
|
||||
Call<Unit>
|
||||
|
||||
/* @POST("almacennew/collectionTicketGet")//REVISADA-ANULADA POT collection_getTickets
|
||||
fun collectionTicketGet(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
|
@ -259,7 +325,7 @@ interface VerdnaturaService {
|
|||
):
|
||||
Call<String>
|
||||
|
||||
@POST("almacennew/saleTracking_update")//REVISADA
|
||||
/* @POST("almacennew/saleTracking_update")//REVISADA
|
||||
fun saleTracking_update(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
|
@ -268,7 +334,7 @@ interface VerdnaturaService {
|
|||
@Header("Content-Type") content_type: String,
|
||||
@Body params: List<String>
|
||||
):
|
||||
Call<Unit>
|
||||
Call<Unit>*/
|
||||
|
||||
@POST("almacennew/itemPlacementSupplyAiming")//REVISADA
|
||||
fun itemPlacementSupplyAiming(
|
||||
|
@ -674,7 +740,8 @@ interface VerdnaturaService {
|
|||
|
||||
//INVENTARIO ========================================================================>
|
||||
|
||||
@POST("almacennew/itemShelvingRadar")//REVISADA
|
||||
|
||||
/* @POST("almacennew/itemShelvingRadar")//REVISADA
|
||||
fun itemShelvingRadar(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
@Header("version") version: String,
|
||||
|
@ -684,7 +751,7 @@ interface VerdnaturaService {
|
|||
@Body params: List<String>
|
||||
):
|
||||
Call<List<ItemInventaryVO>>
|
||||
|
||||
*/
|
||||
@POST("almacennew/itemShelving_filterBuyer")//REVISADA
|
||||
fun itemShelvingRadarFilterBuyer(
|
||||
@Header("aplicacion") aplicacion: String,
|
||||
|
|
|
@ -23,6 +23,7 @@ import androidx.annotation.LayoutRes
|
|||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.databinding.ViewDataBinding
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import es.verdnatura.R
|
||||
|
@ -495,7 +496,10 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
|||
mSpeechRecognizer = null
|
||||
}
|
||||
}
|
||||
|
||||
private fun getDefaults(key: String?, context: Context?): String? {
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return preferences.getString(key, null)
|
||||
}
|
||||
fun getData(name:String):String{
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
return when (name){
|
||||
|
@ -515,23 +519,46 @@ override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
|||
DATENOVEHICLE->prefs.getString(name,"0").toString()
|
||||
DEPARTMENTMISTAKE->prefs.getString(name,"").toString()
|
||||
DEPARTMENTMISTAKEID->prefs.getString(name,"").toString()
|
||||
"base_url"->{
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
preferences.getString("base_url","").toString()
|
||||
}
|
||||
|
||||
else -> {""}
|
||||
}
|
||||
|
||||
}
|
||||
fun setDefaults(key: String?, value: String?, context: Context?) {
|
||||
|
||||
val preferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
val editor = preferences.edit()
|
||||
editor.putString(key, value)
|
||||
editor.commit()
|
||||
}
|
||||
|
||||
fun saveData(name:String,value:String){
|
||||
|
||||
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||
val editor = prefs.edit()
|
||||
|
||||
when (name){
|
||||
name-> editor.putString(name, value)
|
||||
ANDROID_ID->editor.putString(name, value)
|
||||
}
|
||||
Log.d("VERDNATURA::","El name es "+name+":"+ "y el valor "+value)
|
||||
when (name) {
|
||||
|
||||
editor.apply()
|
||||
ANDROID_ID -> editor.putString(name, value)
|
||||
"base_url" -> {
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
val editorPref = preferences.edit()
|
||||
editorPref.putString("base_url", value)
|
||||
editorPref.commit()
|
||||
|
||||
}
|
||||
|
||||
else -> {
|
||||
editor.putString(name, value)
|
||||
}
|
||||
|
||||
}
|
||||
editor.commit()
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import android.content.Context.CLIPBOARD_SERVICE
|
|||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.util.Log
|
||||
import android.view.KeyEvent
|
||||
import android.view.View
|
||||
import androidx.appcompat.widget.TooltipCompat.setTooltipText
|
||||
|
@ -78,7 +79,8 @@ class AjustesFragment :
|
|||
binding.androididText.setText(
|
||||
getData(ANDROID_ID)
|
||||
)
|
||||
binding.txtserver.setText(this.getDefaults("base_url", this.requireContext()))
|
||||
binding.txtserver.setText(getData("base_url"))
|
||||
Log.d("VERDNATURA::","La base es "+getData("base_url"))
|
||||
|
||||
super.init()
|
||||
|
||||
|
@ -300,17 +302,17 @@ class AjustesFragment :
|
|||
}
|
||||
|
||||
|
||||
fun setDefaults(key: String?, value: String?, context: Context?) {
|
||||
/* fun setDefaults(key: String?, value: String?, context: Context?) {
|
||||
val preferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
val editor = preferences.edit()
|
||||
editor.putString(key, value)
|
||||
editor.commit()
|
||||
}
|
||||
}*/
|
||||
|
||||
private fun getDefaults(key: String?, context: Context?): String? {
|
||||
/* private fun getDefaults(key: String?, context: Context?): String? {
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return preferences.getString(key, null)
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
private fun copyanddrag(string: String): Boolean {
|
||||
|
|
|
@ -353,7 +353,7 @@ class ItemCardFragment(
|
|||
listItemsRow.add(
|
||||
ItemCardRowVO(
|
||||
title = getString(R.string.Referencia),
|
||||
value = itemInfo.referencia,
|
||||
value = itemInfo.reference,
|
||||
isEditable = true,
|
||||
action = "item_saveReference"
|
||||
)
|
||||
|
|
|
@ -31,7 +31,7 @@ class ItemCardVO (
|
|||
var urlImage200:String = "",
|
||||
var urlImage:String = "",
|
||||
var itemPackingTypeFk:String =" ",
|
||||
var referencia:String="",
|
||||
var reference:String="",
|
||||
|
||||
|
||||
//sergio para modificar la llamada de itemCard a item_getInfo
|
||||
|
|
|
@ -349,10 +349,11 @@ class CollectionFragment(
|
|||
responseUsedShelves.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = GONE
|
||||
|
||||
if (!goBack){
|
||||
ma.messageWithSound(
|
||||
if (it.isError) it.errorMessage else "Baldas guardadas",
|
||||
it.isError,true
|
||||
)
|
||||
)}
|
||||
|
||||
})
|
||||
responseItem_updatePackingShelve.observe(viewLifecycleOwner, Observer {
|
||||
|
@ -418,6 +419,8 @@ class CollectionFragment(
|
|||
if (binding.splashProgress != null) binding.splashProgress.visibility =
|
||||
View.VISIBLE
|
||||
|
||||
|
||||
if (!goBack){
|
||||
sendSalixMessage(
|
||||
item = dataMessageSalix.item,
|
||||
ticketFk = dataMessageSalix.ticket,
|
||||
|
@ -434,6 +437,7 @@ class CollectionFragment(
|
|||
|
||||
// //Log.i("VERDNATURA:","La collection es ${collection.collectionFk}")
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
goBack = false
|
||||
|
@ -470,14 +474,16 @@ class CollectionFragment(
|
|||
|
||||
responseMissingTrash.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, isError = true,true)
|
||||
if (!goBack){
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, isError = true,true)
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
missingTrashSuccesful()
|
||||
missingTrashSuccesful()
|
||||
|
||||
} //sergio:esto ya estaba
|
||||
}
|
||||
} //sergio:esto ya estaba
|
||||
/* binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.collectionTicketGet(user,password,collection.collectionFk,getData(SECTORFK))*/
|
||||
})
|
||||
|
@ -489,7 +495,7 @@ class CollectionFragment(
|
|||
ma.messageWithSound(it.errorMessage, isError = true,true)
|
||||
|
||||
} else {
|
||||
incresaseSuccesful()
|
||||
if (!goBack){ incresaseSuccesful()}else{goBack=false}
|
||||
}
|
||||
|
||||
})
|
||||
|
@ -500,7 +506,9 @@ class CollectionFragment(
|
|||
ma.messageWithSound(it.errorMessage, isError = true,true)
|
||||
|
||||
} else {
|
||||
if (!goBack)
|
||||
responseSaleMoveSuccesful()
|
||||
goBack=false
|
||||
}
|
||||
|
||||
})
|
||||
|
@ -509,11 +517,13 @@ class CollectionFragment(
|
|||
binding.splashProgress.visibility=GONE
|
||||
|
||||
if (it.isError) {
|
||||
if (!goBack)
|
||||
ma.messageWithSound(it.errorMessage+"Usuario:"+workerFkFromTicket, isError = true,true)
|
||||
|
||||
goBack = false
|
||||
} else {
|
||||
|
||||
if (!goBack)
|
||||
callPicker(it.response)
|
||||
goBack = false
|
||||
}
|
||||
|
||||
})
|
||||
|
@ -521,7 +531,8 @@ class CollectionFragment(
|
|||
|
||||
mistakeList.observe(viewLifecycleOwner, Observer {
|
||||
if (binding.splashProgress != null) binding.splashProgress.visibility = GONE
|
||||
/*sergio:se quita esta comprobacion if (!goBack) */
|
||||
/*sergio:se quita y se pone esta comprobacion porque si no aparece de nuevo otra vez al volver atrás */
|
||||
if (!goBack)
|
||||
showMistakeList(it.list)
|
||||
goBack = false
|
||||
})
|
||||
|
@ -565,8 +576,11 @@ class CollectionFragment(
|
|||
|
||||
responseSalixMessage.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage,it.isError,false)
|
||||
|
||||
if (!goBack){
|
||||
ma.messageWithSound(it.errorMessage,it.isError,false)}else{goBack=false}
|
||||
|
||||
/*customDialog.setTitle("Error").setDescription(it.errorMessage)
|
||||
.setOkButton("Aceptar") {
|
||||
|
@ -1624,7 +1638,9 @@ class CollectionFragment(
|
|||
|
||||
if (totalMark == sales.size) {
|
||||
getString(R.string.Coleccióncompleta).toast(this.context, Toast.LENGTH_SHORT)
|
||||
if (!goBack)
|
||||
ticketCollection_setUsedShelves()
|
||||
goBack=false
|
||||
|
||||
//showBottomNavigation(View.VISIBLE)
|
||||
//sergio: se quita porque se realiza desde triggers
|
||||
|
|
|
@ -154,7 +154,7 @@ class ControlVehiculoFragment(
|
|||
|
||||
}.setValue("").show()
|
||||
|
||||
customDialogInput.getEditText().requestFocus()
|
||||
customDialogInput.setFocusText()
|
||||
|
||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
|
@ -379,7 +379,7 @@ class ControlVehiculoFragment(
|
|||
|
||||
if (it.response.equals("0")) {
|
||||
setToolBar("IN")
|
||||
customDialog.setTitle("Control de vehículos")
|
||||
/* customDialog.setTitle("Control de vehículos")
|
||||
.setDescription("Escanea la matrícula del vehículo o elige sin vehículo")
|
||||
.setOkButton("Escanear vehículo") {
|
||||
customDialog.dismiss()
|
||||
|
@ -390,7 +390,29 @@ class ControlVehiculoFragment(
|
|||
saveData(DATENOVEHICLE, SimpleDateFormat("yyyy-MM-dd",Locale.getDefault()).format(Date()).toString())
|
||||
ma.openFragmentPickers(true)
|
||||
|
||||
}.show()
|
||||
}.show()*/
|
||||
customDialogInput.setTitle(getString(R.string.vehiclecontrol)).setDescription("Escanea la matrícula del vehículo o elige sin vehículo")
|
||||
.setOkButton("Coger vehículo") {
|
||||
if (customDialogInput.getValue().isNotEmpty()) {
|
||||
// "$description ${customDialogInput.getValue()} OK".toast(requireContext())
|
||||
insertControlTimeVehicle(customDialogInput.getValue(), "IN")
|
||||
}
|
||||
customDialogInput.setValue("")
|
||||
scanRequest()
|
||||
customDialogInput.dismiss()
|
||||
hideKeyboards()
|
||||
}
|
||||
|
||||
.setKoButton("Sin vehículo") {
|
||||
customDialogInput.dismiss()
|
||||
ma.openFragmentPickers(true)
|
||||
/* if (tagName.equals(HistoricoVehiculoFragment.TAG)) {
|
||||
ma.onBackPressed()
|
||||
}*/
|
||||
|
||||
}.setValue("").show()
|
||||
|
||||
customDialogInput.setFocusText()
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,19 +64,18 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
|||
|
||||
|
||||
|
||||
binding.edittextServer.setText(getDefaults("base_url", this.requireContext()))
|
||||
binding.edittextServer.setText(getData("base_url"))
|
||||
binding.edittextServer.setOnKeyListener { _, keyCode, event ->
|
||||
if (keyCode == KeyEvent.KEYCODE_ENTER && event.action == KeyEvent.ACTION_UP) {
|
||||
this.setDefaults(
|
||||
|
||||
saveData(
|
||||
"base_url",
|
||||
binding.edittextServer.text.toString(),
|
||||
this.requireContext()
|
||||
binding.edittextServer.text.toString()
|
||||
)
|
||||
|
||||
this.hideKeyboard()
|
||||
//sergio: deberia lanzar la funcion nueva creada por mi restartapp de BaseFragment. Pero no vuelve a arrancar
|
||||
exitProcess(0)
|
||||
//restartapp()
|
||||
//return@OnKeyListener false
|
||||
|
||||
}
|
||||
false
|
||||
|
@ -246,35 +245,6 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
|||
|
||||
})
|
||||
|
||||
/* loginitem.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgress.visibility = View.INVISIBLE
|
||||
if (it.isError) {
|
||||
customDialog.setTitle("Error").setDescription(it.errorMessage)
|
||||
.setOkButton("Cerrar") {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
} else {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
saveUserFkPref(it)
|
||||
if (binding.switchRemember.isChecked) {
|
||||
saveRemember(true)
|
||||
} else {
|
||||
saveRemember(false)
|
||||
}
|
||||
|
||||
saveUserAccesPref(
|
||||
binding.edittextUsername.text.toString(),
|
||||
binding.edittextPassword.text.toString()
|
||||
)
|
||||
|
||||
loginSalix(
|
||||
user = binding.edittextUsername.text.toString(),
|
||||
password = binding.edittextPassword.text.toString(),
|
||||
callFunction = "login de Salix"
|
||||
)
|
||||
}
|
||||
|
||||
})*/
|
||||
|
||||
devicelogresponse.observe(viewLifecycleOwner, {
|
||||
|
||||
|
@ -326,7 +296,7 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
|||
binding.edittextPassword.text.toString(),
|
||||
getData(ANDROID_ID), callFunction = "device_checkLogin"
|
||||
)
|
||||
//getVersion()
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -393,18 +363,18 @@ class LoginFragment : BaseFragment<FragmentLoginBinding, LoginViewModel>(LoginVi
|
|||
|
||||
}
|
||||
|
||||
fun setDefaults(key: String?, value: String?, context: Context?) {
|
||||
/*fun setDefaults(key: String?, value: String?, context: Context?) {
|
||||
|
||||
val preferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
val editor = preferences.edit()
|
||||
editor.putString(key, value)
|
||||
editor.commit()
|
||||
}
|
||||
}*/
|
||||
|
||||
fun getDefaults(key: String?, context: Context?): String? {
|
||||
/* fun getDefaults(key: String?, context: Context?): String? {
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return preferences.getString(key, null)
|
||||
}
|
||||
}*/
|
||||
|
||||
// sergio:creada restart en BaseFragment para AjustesFragment...
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import es.verdnatura.BuildConfig
|
|||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.ActivityMainBinding
|
||||
import es.verdnatura.domain.ConstAndValues.MAINACTIVITY
|
||||
import es.verdnatura.domain.ConstAndValues.PREITEMPICKER
|
||||
import es.verdnatura.domain.toast
|
||||
import es.verdnatura.presentation.base.BaseActivity
|
||||
import es.verdnatura.presentation.common.*
|
||||
|
@ -46,6 +47,8 @@ import es.verdnatura.presentation.view.feature.parking.fragment.ParkingFragment
|
|||
import es.verdnatura.presentation.view.feature.pasillero.fragment.PasilleroFragment
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import es.verdnatura.presentation.view.feature.precontrol.PreControladorFragment
|
||||
import es.verdnatura.presentation.view.feature.presacador.fragment.EndSacadorFragment
|
||||
import es.verdnatura.presentation.view.feature.presacador.fragment.InitPreSacadorFragment
|
||||
import es.verdnatura.presentation.view.feature.presacador.fragment.PreSacadorFragment
|
||||
import es.verdnatura.presentation.view.feature.qr.QrFragment
|
||||
import es.verdnatura.presentation.view.feature.reposicion.fragment.ReposicionFragment
|
||||
|
@ -317,7 +320,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
|
||||
true
|
||||
}
|
||||
bottomMenu!!.setOnNavigationItemReselectedListener {
|
||||
bottomMenu.setOnNavigationItemReselectedListener {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -472,7 +475,10 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
"Fallo del trabajador" -> {
|
||||
addFragmentOnTop(WorkermistakeFragment.newInstance(item.title))
|
||||
}
|
||||
|
||||
// sergio: previa nuevo
|
||||
"Obtener colección previa"->{
|
||||
addFragmentOnTop(InitPreSacadorFragment.newInstance(item.title))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -538,11 +544,32 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
override fun onCollectionSelected(collection: CollectionVO, type: String) {
|
||||
// fm.popBackStack()
|
||||
|
||||
|
||||
when (type){
|
||||
PREITEMPICKER->{
|
||||
// d("VERDNATURA::"," entrando en preitempicker")
|
||||
// d("VERDNATURA::"," entrando en preitempicker, la colecc es "+collection.collectionFk)
|
||||
addFragmentOnTop(EndSacadorFragment.newInstance(collection,type))
|
||||
}
|
||||
"SHOWTICKET"->{
|
||||
addFragmentOnTop(CollectionShowTicketFragment.newInstance(collection, type))
|
||||
}
|
||||
|
||||
else->{
|
||||
addFragmentOnTop(CollectionFragment.newInstance(collection, type))
|
||||
}
|
||||
}
|
||||
/*if (type.equals(PREITEMPICKER)){
|
||||
d("VERDNATURA::"," entrando en preitempicker")
|
||||
addFragmentOnTop(PreSacadorFragment.newInstance(collection,type))
|
||||
}
|
||||
|
||||
if (type.equals("SHOWTICKET")) {
|
||||
addFragmentOnTop(CollectionShowTicketFragment.newInstance(collection, type))
|
||||
} else {
|
||||
addFragmentOnTop(CollectionFragment.newInstance(collection, type))
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
override fun onBuyerSelected(userFk: String) {
|
||||
|
@ -586,7 +613,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
// fm.popBackStack(null,FragmentManager.POP_BACK_STACK_INCLUSIVE)
|
||||
// addFragment(ExpeditionStateFragment.newInstance("main"),R.id.main_frame_layout, ExpeditionStateFragment.TAG,false)
|
||||
|
||||
addFragmentOnTop(ExpeditionStateFragment.newInstance("main"))
|
||||
addFragmentOnTop(ExpeditionStateFragment.newInstance("Consultar estado expedición"))
|
||||
|
||||
}
|
||||
|
||||
|
@ -594,7 +621,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
binding.mainBottomNavigation.visibility = visible
|
||||
}
|
||||
|
||||
fun messageWithSound(message: String, isError: Boolean,isPlayed:Boolean?,titleWithError:String="Error") {
|
||||
fun messageWithSound(message: String, isError: Boolean,isPlayed:Boolean?,titleWithError:String="Error",isToasted:Boolean?=false) {
|
||||
|
||||
if (!isError) {
|
||||
|
||||
|
@ -604,10 +631,14 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnPasillerosItemClickL
|
|||
|
||||
if (isPlayed == true)( mperror?.start())
|
||||
|
||||
customDialog.setTitle(titleWithError).setDescription(message)
|
||||
.setOkButton("Aceptar") {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
if (isToasted==true){
|
||||
message.toast(this, Toast.LENGTH_SHORT)
|
||||
}else{
|
||||
customDialog.setTitle(titleWithError).setDescription(message)
|
||||
.setOkButton("Aceptar") {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -31,13 +31,28 @@ class PasilleroViewModel(context: Context) : BaseViewModel() {
|
|||
|
||||
//sergio para que aparezca el nuevo menu
|
||||
|
||||
_pasillerositem.add(
|
||||
/* _pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
7,
|
||||
R.drawable.ic_add_black_24dp,
|
||||
"Obtener colección previa", R.string.PreSacador,"Obtiene colecciones para sacar en previa"
|
||||
)
|
||||
)*/
|
||||
|
||||
/* _pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
7,
|
||||
R.drawable.ic_streetview_black_24dp,
|
||||
"Pre Sacador", R.string.PreSacador,"Carga un ticket de previa para sacarlo"
|
||||
)
|
||||
)
|
||||
)*/
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(
|
||||
7,
|
||||
R.drawable.ic_streetview_black_24dp,
|
||||
"Obtener colección previa", R.string.PreSacador,"Obtiene colecciones para sacar en previa"
|
||||
)
|
||||
)
|
||||
//precontrol
|
||||
_pasillerositem.add(
|
||||
PasillerosItemVO(7,
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
package es.verdnatura.presentation.view.feature.presacador.adapter
|
||||
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import es.verdnatura.databinding.ItemCollectionRowBinding
|
||||
import es.verdnatura.domain.ConstAndValues.PREITEMPICKER
|
||||
|
||||
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
|
||||
|
||||
class PreCollectionAdapter (
|
||||
private val items: List<CollectionVO>,
|
||||
private val onCollectionSelected: OnCollectionSelectedListener
|
||||
): RecyclerView.Adapter<PreCollectionAdapter.AjustesItemHolder> () {
|
||||
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
|
||||
return AjustesItemHolder(
|
||||
ItemCollectionRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
|
||||
)
|
||||
}
|
||||
|
||||
override fun getItemCount() =items.size
|
||||
|
||||
override fun onBindViewHolder(holder: AjustesItemHolder, position: Int) {
|
||||
holder.bind(items[position])
|
||||
holder.binding.root.setOnClickListener {
|
||||
onCollectionSelected.onCollectionSelected(items[position],PREITEMPICKER)
|
||||
Log.d("VERDNATURA::","2-Click item ${items[position].collectionFk}+PREITEMPICKER")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class AjustesItemHolder(
|
||||
val binding: ItemCollectionRowBinding
|
||||
) : RecyclerView.ViewHolder(binding.root){
|
||||
fun bind(item: CollectionVO) {
|
||||
binding.apply {
|
||||
this.item = item
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,190 @@
|
|||
package es.verdnatura.presentation.view.feature.presacador.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.FragmentSacadorBinding
|
||||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnCollectionSelectedListener
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
import es.verdnatura.presentation.view.feature.presacador.adapter.PreCollectionAdapter
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
|
||||
|
||||
class InitPreSacadorFragment (
|
||||
var entrypoint:String = ""
|
||||
) :
|
||||
BaseFragment<FragmentSacadorBinding, PreSacadorViewModel>(PreSacadorViewModel::class) {
|
||||
|
||||
private var onCollectionSelectedListener: OnCollectionSelectedListener? = null
|
||||
private var goBack: Boolean = false
|
||||
private var goBack2: Boolean = false
|
||||
private lateinit var customDialog: CustomDialog
|
||||
private var collectionsList: ArrayList<CollectionVO> = ArrayList()
|
||||
private var adapter: PreCollectionAdapter? = null
|
||||
|
||||
|
||||
companion object {
|
||||
fun newInstance(entryPoint:String) = InitPreSacadorFragment(entryPoint)
|
||||
}
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
super.onAttach(context)
|
||||
if (context is OnCollectionSelectedListener) onCollectionSelectedListener = context
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int = R.layout.fragment_sacador
|
||||
|
||||
|
||||
override fun init() {
|
||||
|
||||
customDialog = CustomDialog(requireContext())
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
binding.splashProgressTwo.visibility = View.GONE
|
||||
binding.mainToolbar.toolbarTitle.text = getString(R.string.getcollection)
|
||||
setToolBar()
|
||||
setEvents()
|
||||
viewModel.sectorCollection_get(getData(USER),getData(PASSWORD),"sectorCollection_get")
|
||||
super.init()
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
goBack = true
|
||||
goBack2 = true
|
||||
super.onPause()
|
||||
}
|
||||
|
||||
private fun setToolBar() {
|
||||
|
||||
ma.hideBottomNavigation(View.VISIBLE)
|
||||
binding.mainToolbar.backButton.visibility = View.GONE
|
||||
binding.mainToolbar.toolbarTitle.text=entrypoint
|
||||
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
val iconAdd = ImageView(context)
|
||||
iconAdd.setImageResource(R.drawable.ic_add_black_24dp)
|
||||
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
|
||||
iconAdd.tooltipText=getTooltip(R.drawable.ic_add_black_24dp)
|
||||
|
||||
}
|
||||
|
||||
|
||||
listIcons.add(iconAdd)
|
||||
|
||||
binding.mainToolbar.toolbarIcons.adapter = ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
|
||||
when(item){
|
||||
|
||||
iconAdd.drawable -> {
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.sectorCollection_new(getData(USER),
|
||||
getData(PASSWORD),getData(SECTORFK),"sectorCollection_new")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
private fun setEvents() {
|
||||
binding.sacadorSwipe.setOnRefreshListener {
|
||||
viewModel.sectorCollection_get(getData(USER),getData(PASSWORD),"sectorCollection_get")
|
||||
binding.sacadorSwipe.isRefreshing = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
override fun observeViewModel() {
|
||||
|
||||
with(viewModel) {
|
||||
|
||||
collectionList.observe(viewLifecycleOwner, Observer {
|
||||
if (!goBack2) binding.splashProgress.visibility = View.GONE
|
||||
createCollectionList(it.list)
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
goBack2 = false
|
||||
})
|
||||
|
||||
response.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgressTwo.visibility = View.GONE
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage,true,false)
|
||||
|
||||
} else {
|
||||
if (goBack) addCollectionToList(it.response)
|
||||
}
|
||||
goBack = false
|
||||
//sergio:para asegurarnos que aparece en pantalla. En mi movil personal y trabajo no hacia falta.
|
||||
//viewModel.PrecollectionGetSalix(token=getData(TOKEN))
|
||||
})
|
||||
responseNew.observe(viewLifecycleOwner, Observer {
|
||||
binding.splashProgressTwo.visibility = View.GONE
|
||||
binding.splashProgress.visibility = View.GONE
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage,true,false)
|
||||
|
||||
} else {
|
||||
//if (goBack)
|
||||
viewModel.sectorCollection_get(getData(USER),getData(PASSWORD),getData(SECTORFK))
|
||||
}
|
||||
goBack = false
|
||||
//sergio:para asegurarnos que aparece en pantalla. En mi movil personal y trabajo no hacia falta.
|
||||
//viewModel.PrecollectionGetSalix(token=getData(TOKEN))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
private fun createCollectionList(collections: List<CollectionVO>) {
|
||||
collectionsList = ArrayList()
|
||||
collections.forEach {
|
||||
collectionsList.add(it)
|
||||
}
|
||||
val lm = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
adapter = PreCollectionAdapter(collectionsList, onCollectionSelectedListener!!)
|
||||
binding.fragmentSacadorCollections.layoutManager = lm
|
||||
binding.fragmentSacadorCollections.adapter = adapter
|
||||
|
||||
}
|
||||
|
||||
private fun addCollectionToList(collection: String) {
|
||||
var isNew = true
|
||||
collectionsList.forEach {
|
||||
if (it.collectionFk == collection) {
|
||||
isNew = false
|
||||
}
|
||||
}
|
||||
if (isNew) {
|
||||
collectionsList.add(CollectionVO(collectionFk = collection, created = "Nuevo"))
|
||||
adapter?.notifyDataSetChanged()
|
||||
} else {
|
||||
customDialog.setTitle("Atención")
|
||||
.setDescription("La colección " + collection + " sigue pendiente de preparar")
|
||||
.setOkButton("Aceptar") {
|
||||
customDialog.dismiss()
|
||||
}.show()
|
||||
}
|
||||
//sergio:para asegurarnos que se actualiza pantalla.
|
||||
adapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -73,7 +73,7 @@ class PreSacadorFragment :
|
|||
private var quantityCollectionSplit = ""
|
||||
private var positionCollectionSplit = 0
|
||||
|
||||
private val listIcons:ArrayList<ImageView> = ArrayList()
|
||||
// private val listIcons:ArrayList<ImageView> = ArrayList()
|
||||
|
||||
//sergio: se añada para leer el articulo leido que era el buyFk
|
||||
private var originalItemScan: String = ""
|
||||
|
@ -595,16 +595,7 @@ class PreSacadorFragment :
|
|||
setTotalLines()
|
||||
}
|
||||
|
||||
private fun saleTracking_update(){
|
||||
|
||||
viewModel.saleTracking_update(
|
||||
usuario = getData(USER),
|
||||
password = getData(PASSWORD),
|
||||
saleFk ="000"
|
||||
|
||||
)
|
||||
|
||||
}
|
||||
private fun saleTrackingReplace(position: Int) {
|
||||
viewModel.saleTrackingReplace(
|
||||
usuario = getData(USER),
|
||||
|
@ -947,7 +938,7 @@ class PreSacadorFragment :
|
|||
private fun setToolBar() {
|
||||
binding.mainToolbar.toolbarSubtitle.visibility = View.VISIBLE
|
||||
|
||||
// val listIcons:ArrayList<ImageView> = ArrayList()
|
||||
val listIcons:ArrayList<ImageView> = ArrayList()
|
||||
|
||||
val iconParking = ImageView(context)
|
||||
iconParking.setImageResource(R.drawable.ic_local_parking_black_24dp)
|
||||
|
@ -968,16 +959,14 @@ class PreSacadorFragment :
|
|||
binding.mainToolbar.toolbarIcons.adapter =
|
||||
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
||||
override fun onOptionsItemSelected(item: Drawable) {
|
||||
/*if (item == iconEraser) {
|
||||
saleTracking_update()
|
||||
} else*/
|
||||
|
||||
when (item){
|
||||
iconParking.drawable-> pasillerosItemClickListener?.onPasillerosItemClickListener(
|
||||
PasillerosItemVO(
|
||||
title = "Parking"
|
||||
), ""
|
||||
)
|
||||
iconEraser.drawable->saleTracking_update()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,6 +12,9 @@ import es.verdnatura.domain.GetUbicadorUserCase
|
|||
import es.verdnatura.presentation.base.*
|
||||
import es.verdnatura.presentation.common.ResponseItemVO
|
||||
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.mapper.toDateFormat
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionListVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyListVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
|
||||
import retrofit2.Call
|
||||
|
@ -70,6 +73,27 @@ class PreSacadorViewModel(context: Context) : BaseViewModel()
|
|||
get() = _responseMissingTrash
|
||||
|
||||
|
||||
//sergio: previa nuevo
|
||||
private val _collectionList by lazy { MutableLiveData<CollectionListVO>() }
|
||||
val collectionList: LiveData<CollectionListVO>
|
||||
get() = _collectionList
|
||||
|
||||
private val _responseNew by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseNew: LiveData<ResponseItemVO>
|
||||
get() = _responseNew
|
||||
|
||||
private val _responseSaleGroupAdd by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseSaleGroupAdd: LiveData<ResponseItemVO>
|
||||
get() = _responseSaleGroupAdd
|
||||
|
||||
private val _responseSaleAddPrevOK by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseSaleAddPrevOK: LiveData<ResponseItemVO>
|
||||
get() = _responseSaleAddPrevOK
|
||||
|
||||
private val _responseSaleupdateIsChecked by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseSaleupdateIsChecked: LiveData<ResponseItemVO>
|
||||
get() = _responseSaleupdateIsChecked
|
||||
|
||||
|
||||
fun ticketToPrePrepare(usuario: String, password: String, ticketFk: String, sectorFk: String)
|
||||
{
|
||||
|
@ -284,44 +308,6 @@ class PreSacadorViewModel(context: Context) : BaseViewModel()
|
|||
})
|
||||
}
|
||||
|
||||
fun saleTracking_update(
|
||||
usuario: String,
|
||||
password: String,
|
||||
saleFk: String,
|
||||
|
||||
)
|
||||
{
|
||||
|
||||
getSacadorControladorUserCase.saleTracking_update(
|
||||
usuario,
|
||||
password,
|
||||
saleFk
|
||||
|
||||
).enqueue(object : Callback<Unit>
|
||||
{
|
||||
override fun onFailure(call: Call<Unit>, t: Throwable)
|
||||
{
|
||||
_responseSaleTrackingUpdate.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call<Unit>, response: Response<Unit>)
|
||||
{
|
||||
if (!response.isSuccessful)
|
||||
{
|
||||
_responseSaleTrackingUpdate.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())
|
||||
)
|
||||
} else
|
||||
{
|
||||
_responseSaleTrackingUpdate.value = ResponseItemVO(isError = false, errorMessage = "Actualizado listado previa", response = "Actualizado listado previa")
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
fun saleTrackingReplace(
|
||||
usuario: String,
|
||||
password: String,
|
||||
|
@ -586,4 +572,229 @@ class PreSacadorViewModel(context: Context) : BaseViewModel()
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
fun sectorCollection_get(usuario: String, password: String,callFunction:String){
|
||||
|
||||
getPreSacadorUseCase.sectorCollection_get(usuario, password).enqueue(object :
|
||||
Callback<List<CollectionVO>> {
|
||||
override fun onFailure(call: Call<List<CollectionVO>>, t: Throwable) {
|
||||
val listError: ArrayList<CollectionVO> = ArrayList()
|
||||
listError.add(CollectionVO(isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!)))
|
||||
_collectionList.value = CollectionListVO(listError)
|
||||
}
|
||||
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<List<CollectionVO>>,
|
||||
response: Response<List<CollectionVO>>
|
||||
) {
|
||||
if (response.body() != null) {
|
||||
_collectionList.value =
|
||||
response.body()?.let { CollectionListVO(it.toDateFormat()) }
|
||||
} else {
|
||||
val listError: ArrayList<CollectionVO> = ArrayList()
|
||||
listError.add(
|
||||
CollectionVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())
|
||||
)
|
||||
)
|
||||
_collectionList.value = CollectionListVO(listError)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
fun sectorCollection_new(usuario: String, password: String, sectorFk: String,callFunction:String){
|
||||
getPreSacadorUseCase.sectorCollection_new(usuario, password, sectorFk).enqueue(
|
||||
object :
|
||||
Callback<Unit> {
|
||||
override fun onFailure(call: Call<Unit>, t: Throwable) {
|
||||
_responseNew.value =
|
||||
ResponseItemVO(isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<Unit>,
|
||||
response: Response<Unit>
|
||||
) {
|
||||
|
||||
if (!response.isSuccessful){
|
||||
_responseNew.value=ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = "Error en la llamada al añadir colección." + getMessageFromAllResponse(
|
||||
nameofFunction(this),response.message()
|
||||
))
|
||||
}else{
|
||||
_responseNew.value=ResponseItemVO(
|
||||
isError = false,
|
||||
errorMessage = "" + getMessageFromAllResponse(
|
||||
nameofFunction(this),response.message()
|
||||
))
|
||||
|
||||
}
|
||||
|
||||
|
||||
//Log.i("Salix","Mensaje enviado a salix")
|
||||
|
||||
|
||||
/*if (response.body() != null) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = false, response = response.body()!!)
|
||||
} else {
|
||||
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this),response.message())
|
||||
)
|
||||
|
||||
}*/
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun sectorCollection_getSale(usuario: String, password: String, sectorCollectionFK:String,vSectorFk:String)
|
||||
{
|
||||
getPreSacadorUseCase.sectorCollection_getSale(usuario, password, sectorCollectionFK,vSectorFk)
|
||||
.enqueue(object :
|
||||
Callback<List<PreSacadorItemVO>>
|
||||
{
|
||||
override fun onFailure(call: Call<List<PreSacadorItemVO>>, t: Throwable)
|
||||
{
|
||||
d("VERDNATURA::","ha fallado")
|
||||
_salesList.value = listOf()
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<List<PreSacadorItemVO>>,
|
||||
response: Response<List<PreSacadorItemVO>>
|
||||
)
|
||||
{
|
||||
if (response.body() != null)
|
||||
{
|
||||
d("VERDNATURA::","entra con lineas")
|
||||
_salesList.value = response.body()?.let { it }
|
||||
} else
|
||||
{
|
||||
d("VERDNATURA::","ES NULO")
|
||||
_salesList.value = listOf()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun sectorCollectionSaleGroup_add(usuario: String, password: String, vSaleGroupFk: String,vSectorCollectionFk:String,callFunction:String){
|
||||
getPreSacadorUseCase.sectorCollectionSaleGroup_add(usuario, password, vSaleGroupFk,vSectorCollectionFk).enqueue(
|
||||
object :
|
||||
Callback<Unit> {
|
||||
override fun onFailure(call: Call<Unit>, t: Throwable) {
|
||||
_response.value =
|
||||
ResponseItemVO(isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<Unit>,
|
||||
response: Response<Unit>
|
||||
) {
|
||||
|
||||
if (!response.isSuccessful){
|
||||
_responseSaleGroupAdd.value=ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = "Error al añadir ticket a la colección." + getMessageFromAllResponse(
|
||||
nameofFunction(this),response.message()
|
||||
))
|
||||
}else{
|
||||
_responseSaleGroupAdd.value=ResponseItemVO(
|
||||
isError = false,
|
||||
errorMessage = "" + getMessageFromAllResponse(
|
||||
nameofFunction(this),response.message()
|
||||
))
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun saleTracking_addPrevOK(usuario: String, password: String, vSectorCollectionFk:String,callFunction:String){
|
||||
getPreSacadorUseCase.saleTracking_addPrevOK(usuario, password,vSectorCollectionFk).enqueue(
|
||||
object :
|
||||
Callback<Unit> {
|
||||
override fun onFailure(call: Call<Unit>, t: Throwable) {
|
||||
_responseSaleAddPrevOK.value =
|
||||
ResponseItemVO(isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<Unit>,
|
||||
response: Response<Unit>
|
||||
) {
|
||||
|
||||
if (!response.isSuccessful){
|
||||
_responseSaleAddPrevOK.value=ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = "Error al cambiar el estado a la colección de previa." + getMessageFromAllResponse(
|
||||
nameofFunction(this),response.message()
|
||||
))
|
||||
}else{
|
||||
_responseSaleAddPrevOK.value=ResponseItemVO(
|
||||
isError = false,
|
||||
errorMessage = ""
|
||||
+ getMessageFromAllResponse(
|
||||
nameofFunction(this),response.message()
|
||||
))
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun saleTracking_updateIsChecked(usuario: String, password: String, vSaleFk:String,vIsChecked:String,callFunction:String){
|
||||
getPreSacadorUseCase.saleTracking_updateIsChecked(usuario, password,vSaleFk,vIsChecked).enqueue(
|
||||
object :
|
||||
Callback<Unit> {
|
||||
override fun onFailure(call: Call<Unit>, t: Throwable) {
|
||||
_responseSaleupdateIsChecked.value =
|
||||
ResponseItemVO(isError = true, errorMessage = getMessageFromAllResponse(nameofFunction(this),t.message!!))
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun onResponse(
|
||||
call: Call<Unit>,
|
||||
response: Response<Unit>
|
||||
) {
|
||||
|
||||
if (!response.isSuccessful){
|
||||
_responseSaleupdateIsChecked.value=ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = "Error al cambiar el estado a la colección de previa." + getMessageFromAllResponse(
|
||||
nameofFunction(this),response.message()
|
||||
))
|
||||
}else{
|
||||
_responseSaleupdateIsChecked.value=ResponseItemVO(
|
||||
isError = false,
|
||||
errorMessage = ""
|
||||
+ getMessageFromAllResponse(
|
||||
nameofFunction(this),response.message()
|
||||
))
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,9 +20,9 @@ fun PreSacadorItemVO.toSale() : SaleVO {
|
|||
placements = carros,
|
||||
agencyName = if (trabajador.isNullOrEmpty()) { "" } else trabajador,
|
||||
packingType=packingType,
|
||||
salePersonFk=if (salesPersonFk.isNullOrEmpty()){""}else salesPersonFk
|
||||
|
||||
|
||||
salePersonFk=if (salesPersonFk.isNullOrEmpty()){""}else salesPersonFk,
|
||||
//TODO modificar back y bbdd para obtener reference
|
||||
reference=if (reference.isNullOrEmpty()){""}else{reference}
|
||||
|
||||
)
|
||||
}
|
||||
|
|
|
@ -16,7 +16,9 @@ class PreSacadorItemVO (
|
|||
var carros : List<PlacementVO> = listOf(),
|
||||
//var priority:Int =0, 7-1-2022
|
||||
var pickingOrder:Int =0,
|
||||
var salesPersonFk:String= ""
|
||||
var salesPersonFk:String= "",
|
||||
|
||||
var reference:String=""
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -50,9 +50,17 @@ class SacadorFragment :
|
|||
binding.mainToolbar.toolbarTitle.text = getString(R.string.getcollection)
|
||||
setToolBar()
|
||||
setEvents()
|
||||
viewModel.collectionGetSalix(token = getData(TOKEN))
|
||||
/* viewModel.collectionGet( getData(USER),
|
||||
getData(PASSWORD),"collection_get")*/
|
||||
|
||||
var working_in_test=false
|
||||
|
||||
if (!working_in_test) {
|
||||
viewModel.collectionGetSalix(token = getData(TOKEN))
|
||||
}else{
|
||||
viewModel.collectionGet( getData(USER),
|
||||
getData(PASSWORD),"collection_get")
|
||||
}
|
||||
|
||||
|
||||
super.init()
|
||||
|
||||
|
||||
|
@ -180,8 +188,18 @@ class SacadorFragment :
|
|||
}
|
||||
goBack = false
|
||||
//sergio:para asegurarnos que aparece en pantalla. En mi movil personal y trabajo no hacia falta.
|
||||
/* viewModel.collectionGet(getData(USER),getData(PASSWORD),"collection_get")*/
|
||||
viewModel.collectionGetSalix(token=getData(TOKEN))
|
||||
|
||||
var working_in_test=false
|
||||
|
||||
if (!working_in_test) {
|
||||
viewModel.collectionGetSalix(token=getData(TOKEN))
|
||||
}else{
|
||||
viewModel.collectionGet(getData(USER),getData(PASSWORD),"collection_get")
|
||||
}
|
||||
|
||||
/*viewModel.collectionGetSalix(token=getData(TOKEN))*/
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,8 @@ class SaleVO(
|
|||
var cel2: String = "",
|
||||
var cel3: String = "",
|
||||
var saleGroupFk: String = "",
|
||||
var packingShelve:String=""
|
||||
var packingShelve:String="",
|
||||
var reference:String=""
|
||||
|
||||
|
||||
)
|
||||
|
|
|
@ -227,6 +227,8 @@
|
|||
tool:text="10"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="@dimen/h6"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
|
|
@ -195,6 +195,8 @@
|
|||
tool:text="10"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:textSize="@dimen/h6"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
|
|
@ -36,15 +36,16 @@
|
|||
android:text="@{item.itemFk}"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
|
||||
android:layout_weight="1"
|
||||
android:gravity="left"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{item.longName}"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:singleLine="true"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"/>
|
||||
<TextView
|
||||
|
@ -54,7 +55,7 @@
|
|||
android:text="@{item.shelvingFk}"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
android:layout_weight="1"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -62,8 +63,7 @@
|
|||
android:text="@{item.visible}"
|
||||
android:textSize="@dimen/body2"
|
||||
android:textColor="@color/verdnatura_white"
|
||||
|
||||
android:paddingRight="@dimen/layout_margin_min"
|
||||
android:layout_weight="1"
|
||||
android:gravity="right"/>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue