refs #5651 notifications
This commit is contained in:
parent
86c51e4e99
commit
c23ae39ae1
|
@ -9,10 +9,7 @@ import es.verdnatura.presentation.view.feature.collection.listSaleSalix
|
|||
import es.verdnatura.presentation.view.feature.historicoshelvinglog.model.ShelvingLogSalix
|
||||
import es.verdnatura.presentation.view.feature.login.model.LoginSalixVO
|
||||
import es.verdnatura.presentation.view.feature.login.model.SalixGrupo
|
||||
import es.verdnatura.presentation.view.feature.packaging.model.EntrySalix
|
||||
import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
|
||||
import es.verdnatura.presentation.view.feature.packaging.model.Supplier
|
||||
import es.verdnatura.presentation.view.feature.packaging.model.obervationEntry
|
||||
import es.verdnatura.presentation.view.feature.packaging.model.*
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import es.verdnatura.presentation.view.feature.workermistake.model.DepartmentMistake
|
||||
import okhttp3.MultipartBody
|
||||
|
@ -207,6 +204,12 @@ interface SalixService {
|
|||
):
|
||||
Call<EntrySalix>
|
||||
|
||||
@POST("notificationQueues")
|
||||
fun notificationQueues(
|
||||
@Body notificationQueue: notificationQueue
|
||||
):
|
||||
Call<Void>
|
||||
|
||||
@POST("Images/upload")
|
||||
@Multipart
|
||||
fun uploadImage(
|
||||
|
|
|
@ -3,7 +3,6 @@ package es.verdnatura.presentation.view.feature.packaging.fragment
|
|||
import android.graphics.drawable.Drawable
|
||||
import android.os.Build
|
||||
import android.text.InputType
|
||||
import android.util.Log.d
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
|
@ -41,12 +40,6 @@ class PackagingCountFragment(
|
|||
|
||||
|
||||
override fun init() {
|
||||
/* binding.quantityPackaging.setOnClickListener {
|
||||
ma.onPasillerosItemClickListener(
|
||||
PasillerosItemVO(title = getString(R.string.titlePackagingObs)),
|
||||
getString(R.string.titlePackagingObs)
|
||||
)
|
||||
}*/
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.getItemsPackaging(
|
||||
getDataInt("SUPPLIERID"), getDataInt("ENTRYID")
|
||||
|
@ -61,7 +54,8 @@ class PackagingCountFragment(
|
|||
|
||||
private fun setToolBar() {
|
||||
|
||||
binding.mainToolbar.toolbarTitle.text = getData("ENTRYTYPE") + ": " + getData("SUPPLIERNAME")
|
||||
binding.mainToolbar.toolbarTitle.text =
|
||||
"${getData("ENTRYTYPE")}: ${getData("SUPPLIERNAME")}"
|
||||
|
||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
||||
val iconNext = ImageView(context)
|
||||
|
@ -124,24 +118,18 @@ class PackagingCountFragment(
|
|||
ItemSupplierAdapter(it.list, object : OnImageUpdateClickListener {
|
||||
|
||||
override fun OnImageUpdateClickListener(item: Any) {
|
||||
d("VERDNATURA::", "Seleccionado update" + (item as ItemSupplier).name)
|
||||
showCustomDialog("quantity", item)
|
||||
showCustomDialog("quantity", item as ItemSupplier)
|
||||
|
||||
|
||||
}
|
||||
|
||||
}, object : OnImageTrashClickListener {
|
||||
override fun OnImageTrashClickListener(item: Any) {
|
||||
d("VERDNATURA::", "Seleccionado trash" + (item as ItemSupplier).name)
|
||||
showCustomDialog("delete", item)
|
||||
showCustomDialog("delete", item as ItemSupplier)
|
||||
}
|
||||
|
||||
}, object : OnEditSubQuantityListener {
|
||||
override fun OnEditSubQuantityListener(item: Any, text: String) {
|
||||
d(
|
||||
"VERDNATURA::",
|
||||
"la subquantity es " + (item as ItemSupplier).name + "el valor es :" + text
|
||||
)
|
||||
hideKeyboard()
|
||||
}
|
||||
})
|
||||
|
@ -161,36 +149,28 @@ class PackagingCountFragment(
|
|||
when (action) {
|
||||
"quantity" -> {
|
||||
customDialogInput.getEditText().setRawInputType(InputType.TYPE_CLASS_NUMBER)
|
||||
// customDialogInput.getEditText().inputType = InputType.TYPE_CLASS_NUMBER
|
||||
customDialogInput.setTitle(getString(R.string.quantityReviewed))
|
||||
.setDescription(getString(R.string.Indicanuevacantidad))
|
||||
.setOkButton(getString(R.string.accept)) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
if (!customDialogInput.getValue().isEmpty()) {
|
||||
requireActivity().hideKeyboard()
|
||||
}
|
||||
|
||||
/* println("Cantidad total stickers ${item.quantityTotal}")
|
||||
println("Cantidad entrada ${item.quantity}")
|
||||
println("cantidad" + customDialogInput.getValue().toInt())
|
||||
println("suma:"+item.quantity!!.plus(customDialogInput.getValue().toInt()))*/
|
||||
|
||||
binding.splashProgress.visibility = View.VISIBLE
|
||||
viewModel.entry_addFromBuy(
|
||||
getDataInt("ENTRYID"), item = item.id!!.toInt(),
|
||||
(if (getData("ENTRYTYPE") == "Rec") {
|
||||
(item.printedStickers!!.plus(customDialogInput.getValue().toInt()))
|
||||
(item.printedStickers.plus(customDialogInput.getValue().toInt()))
|
||||
} else {
|
||||
item.printedStickers!!.plus(customDialogInput.getValue().toInt() * -1)
|
||||
item.printedStickers.plus(customDialogInput.getValue().toInt() * -1)
|
||||
}) as Number
|
||||
)
|
||||
customDialog.cancel()
|
||||
customDialogInput.dismiss()
|
||||
customDialogInput.setValue("")
|
||||
// requireActivity().showKeyboard()
|
||||
}.setKoButton(getString(R.string.cancel)) {
|
||||
customDialog.cancel()
|
||||
customDialogInput.dismiss()
|
||||
// requireActivity().showKeyboard()
|
||||
}.setValue("")
|
||||
.show()
|
||||
|
||||
|
@ -198,7 +178,6 @@ class PackagingCountFragment(
|
|||
|
||||
customDialogInput.currentFocus
|
||||
customDialogInput.setFocusText()
|
||||
// requireActivity().showKeyboard()
|
||||
}
|
||||
"delete" -> {
|
||||
customDialog.setTitle(getString(R.string.deleteEntryReviewed))
|
||||
|
|
|
@ -113,6 +113,7 @@ class PackagingSummaryFragment(
|
|||
R.string.accept
|
||||
)
|
||||
) {
|
||||
viewModel.notificationQueues("modified-entry",getDataInt(USERFK),"""{"url":"${getData("base_urlSalix")}/#!/entry/${getDataInt("ENTRYID")}/summary"}""")
|
||||
customDialog.dismiss()
|
||||
}
|
||||
|
||||
|
|
|
@ -254,6 +254,31 @@ class PackagingViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
})
|
||||
}
|
||||
fun notificationQueues(notification: String, workerfk: Int, bodyUrl: String) {
|
||||
salix.notificationQueues(notificationQueue(notification,workerfk,bodyUrl))
|
||||
.enqueue(object : SilexCallback<Void>(context){override fun onError(t: Throwable) {
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
t.message!!
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Void>) {
|
||||
|
||||
_response.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(
|
||||
nameofFunction(this),
|
||||
response.message()
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
fun entry_addFromPackaging(supplier: Number,isPackaging: Boolean) {
|
||||
salix.addFromPackaging(supplier, isPackaging)
|
||||
.enqueue(object : SilexCallback<EntrySalix>(context) {
|
||||
|
|
|
@ -29,4 +29,10 @@ fun List<EntrySalix>.toDateFormat(): ArrayList<EntrySalix> {
|
|||
|
||||
data class obervationEntry(
|
||||
val observation:String
|
||||
)
|
||||
)
|
||||
|
||||
data class notificationQueue(
|
||||
val notificationFk:String,
|
||||
val authorFk:Int,
|
||||
val params: String
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue