feat: refs#8455 webSalixLog
This commit is contained in:
parent
611e6d2993
commit
361ebddd2f
|
@ -7,13 +7,15 @@ import androidx.recyclerview.widget.RecyclerView
|
|||
import es.verdnatura.R
|
||||
import es.verdnatura.databinding.ItemHistoricoRowBinding
|
||||
import es.verdnatura.presentation.common.OnClientHistoricItemClickListener
|
||||
import es.verdnatura.presentation.common.OnOutQuantityHistoricItemClickListener
|
||||
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
|
||||
class HistoricoAdapter(
|
||||
private val items: List<ItemHistoricoVO>,
|
||||
private val onClientHistoricItemClickListener: OnClientHistoricItemClickListener
|
||||
private val onClientHistoricItemClickListener: OnClientHistoricItemClickListener,
|
||||
private val onOutQuantityHistoricItemClickListener: OnOutQuantityHistoricItemClickListener
|
||||
) : RecyclerView.Adapter<HistoricoAdapter.ItemHolder>() {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
|
||||
|
@ -76,6 +78,14 @@ class HistoricoAdapter(
|
|||
clientName.setOnClickListener {
|
||||
onClientHistoricItemClickListener.onClientHistoricItemClickListener(item)
|
||||
}
|
||||
outQuantity.setOnClickListener {
|
||||
//tarea 8455
|
||||
/* if (item.out != null && item.out!! < 0 && item.isTicket == 1) {
|
||||
onOutQuantityHistoricItemClickListener.onOutQuantityHistoricItemClickListener(
|
||||
item
|
||||
)
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +96,6 @@ class HistoricoAdapter(
|
|||
binding: ItemHistoricoRowBinding,
|
||||
) {
|
||||
|
||||
|
||||
when (stateName?.lowercase()) {
|
||||
"preparado", "en preparación", "autoimpreso", "impreso" -> {
|
||||
binding.clientName.setBackgroundColor(
|
||||
|
|
|
@ -16,6 +16,7 @@ import es.verdnatura.domain.notNull
|
|||
import es.verdnatura.presentation.base.BaseFragment
|
||||
import es.verdnatura.presentation.common.OnClientHistoricItemClickListener
|
||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
||||
import es.verdnatura.presentation.common.OnOutQuantityHistoricItemClickListener
|
||||
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
|
||||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
||||
import es.verdnatura.presentation.view.component.CustomDialog
|
||||
|
@ -23,6 +24,7 @@ import es.verdnatura.presentation.view.feature.historicoarticulo.adapter.Histori
|
|||
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoListVO
|
||||
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO
|
||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||
import java.net.URLEncoder
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
|
@ -242,6 +244,71 @@ class HistoricoArticuloFragment(
|
|||
|
||||
}
|
||||
}
|
||||
}, object : OnOutQuantityHistoricItemClickListener {
|
||||
override fun onOutQuantityHistoricItemClickListener(item: ItemHistoricoVO) {
|
||||
|
||||
val baseUrl =
|
||||
"${mobileApplication.dataStoreApp.getServerLilium()}/#/ticket/${item.originId}/log"
|
||||
val logsJson = """
|
||||
{
|
||||
"filter": {
|
||||
"limit": 20,
|
||||
"fields": [
|
||||
"id",
|
||||
"originFk",
|
||||
"userFk",
|
||||
"action",
|
||||
"changedModel",
|
||||
"oldInstance",
|
||||
"newInstance",
|
||||
"creationDate",
|
||||
"changedModelId",
|
||||
"changedModelValue",
|
||||
"description",
|
||||
"summaryId"
|
||||
],
|
||||
"where": {
|
||||
"and": [
|
||||
{
|
||||
"originFk": "${item.originId}"
|
||||
},
|
||||
{
|
||||
"or": [
|
||||
{
|
||||
"oldJson": {
|
||||
"like": "%${itemFk}%"
|
||||
}
|
||||
},
|
||||
{
|
||||
"newJson": {
|
||||
"like": "%${itemFk}%"
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": {
|
||||
"like": "%${itemFk}%"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"skip": 0
|
||||
}
|
||||
}
|
||||
""".trimIndent()
|
||||
val encodedJson = URLEncoder.encode(logsJson, "UTF-8")
|
||||
val entryPoint = Gson().toJson(
|
||||
mutableMapOf(
|
||||
"entryPoint" to item.entityId, "web" to "$baseUrl?logs=$encodedJson"
|
||||
)
|
||||
)
|
||||
ma.onPasillerosItemClickListener(
|
||||
PasillerosItemVO(
|
||||
title = R.string.titleWebViewer,
|
||||
), entryPoint = entryPoint
|
||||
)
|
||||
}
|
||||
})
|
||||
binding.historicoRecyclerview.adapter = adapter
|
||||
binding.historicoRecyclerview.layoutManager =
|
||||
|
|
Loading…
Reference in New Issue