refs #6651feat:itemShelving_get

This commit is contained in:
Sergio De la torre 2024-02-09 08:11:33 +01:00
parent bd6fda1130
commit 6e05933728
3 changed files with 17 additions and 12 deletions

View File

@ -21,7 +21,6 @@ class UbicadorAdapter(
private val onMoreClickListener: OnMoreClickListener private val onMoreClickListener: OnMoreClickListener
) : RecyclerView.Adapter<UbicadorAdapter.ItemHolder>() { ) : RecyclerView.Adapter<UbicadorAdapter.ItemHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
return ItemHolder( return ItemHolder(
ItemUbicationRowBinding.inflate(LayoutInflater.from(parent.context), parent, false) ItemUbicationRowBinding.inflate(LayoutInflater.from(parent.context), parent, false)
@ -44,7 +43,13 @@ class UbicadorAdapter(
binding.apply { binding.apply {
this.item = item this.item = item
multiText.text = "${item.stickers}x${item.packing}" multiText.text = "${item.stickers}x${item.packing}"
imgItem.loadUrl("https://cdn.verdnatura.es/image/catalog/200x200/" + item.item) //Tarea 6651
if (!item.urlImage.isNullOrBlank()) {
imgItem.loadUrl(item.urlImage)
} else {
imgItem.loadUrl("https://cdn.verdnatura.es/image/catalog/200x200/" + item.item)
}
imgItem.setOnClickListener { imgItem.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener( onPasillerosItemClickListener.onPasillerosItemClickListener(
PasillerosItemVO( PasillerosItemVO(

View File

@ -443,7 +443,7 @@ class UbicadorFragment(
shelvingFk, shelvingFk,
"" + listInt + "", "" + listInt + "",
TRUE, TRUE,
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK) mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK)
) )
adapter!!.notifyDataSetChanged() adapter!!.notifyDataSetChanged()
@ -478,8 +478,8 @@ class UbicadorFragment(
var contEtiquetas = 0 var contEtiquetas = 0
it.list.forEach { item -> it.list.forEach { item ->
try { try {
contEtiquetas += item.stickers.toInt() contEtiquetas += item.stickers?.toInt() ?: 0
parking = item.code parking = item.code ?: ""
} catch (ex: Exception) { } catch (ex: Exception) {
ex.message!!.toast(requireContext()) ex.message!!.toast(requireContext())
@ -582,7 +582,7 @@ class UbicadorFragment(
}) })
loadAddList.observe(viewLifecycleOwner) { event -> loadAddList.observe(viewLifecycleOwner) { event ->
event.getContentIfNotHandled().notNull { event.getContentIfNotHandled().notNull {
viewModel.itemShelvingList(shelvingFk) viewModel.itemShelvingList(shelvingFk)
} }
} }
response.observe(viewLifecycleOwner, Observer { response.observe(viewLifecycleOwner, Observer {
@ -821,7 +821,7 @@ class UbicadorFragment(
itemFk, itemFk,
visible, visible,
packing, packing,
mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK), mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK),
groupingPack groupingPack
) )
@ -839,7 +839,7 @@ class UbicadorFragment(
item = itemFk, item = itemFk,
quantity = visible_calc, quantity = visible_calc,
packing = packing, packing = packing,
warehouse = mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK), warehouse = mobileApplication.dataStoreApp.readDataStoreKey(WAREHOUSEFK),
grouping = groupingPack grouping = groupingPack
) )

View File

@ -1,23 +1,23 @@
package es.verdnatura.presentation.view.feature.ubicador.model package es.verdnatura.presentation.view.feature.ubicador.model
class ItemUbicadorVO( class ItemUbicadorVO(
var item: Int , var item: Int,
var description: String = "", var description: String = "",
var visible: String = "", var visible: String = "",
var stickers: String = "", var stickers: String = "",
var packing: String = "", var packing: String = "",
var grouping: String = "", var grouping: String = "",
//Tarea 4904 refactor itemShelving_get, quitar col y row
var col: String = "", var col: String = "",
var row: String = "", var row: String = "",
var code: String = "", var code: String? = "",
var id: Int = 0, var id: Int = 0,
var priority: String = "", var priority: String = "",
var isError: Boolean = false, var isError: Boolean = false,
var errorMessage: String = "", var errorMessage: String = "",
var checked: Boolean = false, var checked: Boolean = false,
var isNew: Boolean = false, var isNew: Boolean = false,
var isChecked: Int? = null var isChecked: Int? = null,
var urlImage: String = ""
) )
class ItemEscanerVO( class ItemEscanerVO(