refs #6276: prepare Salixback
This commit is contained in:
parent
fe98c3f9fb
commit
d6255b03be
|
@ -1,11 +1,13 @@
|
|||
package es.verdnatura.domain
|
||||
|
||||
import com.google.gson.JsonObject
|
||||
import es.verdnatura.presentation.common.itemBarCodeSalix
|
||||
import es.verdnatura.presentation.common.ItemBarCodeSalix
|
||||
import es.verdnatura.presentation.common.packingSiteSalix
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.Printers
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
|
||||
import es.verdnatura.presentation.view.feature.ajustes.model.Train
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.AddressLoses
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardVO
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
|
||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
|
||||
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
|
||||
|
@ -34,6 +36,7 @@ import es.verdnatura.presentation.view.feature.login.model.OperatorSalix
|
|||
import es.verdnatura.presentation.view.feature.login.model.RenewToken
|
||||
import es.verdnatura.presentation.view.feature.login.model.SalixGrupo
|
||||
import es.verdnatura.presentation.view.feature.login.model.accessConfigSalix
|
||||
import es.verdnatura.presentation.view.feature.login.model.versionApp
|
||||
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
|
||||
|
@ -42,6 +45,8 @@ import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionT
|
|||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletViewVO
|
||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemScanVO
|
||||
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
|
||||
import es.verdnatura.presentation.view.feature.reubication.model.Reubication
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
|
||||
|
@ -95,7 +100,7 @@ interface SalixService {
|
|||
|
||||
@GET("Buyers")
|
||||
fun getBuyers(
|
||||
@Query("filter") filter:String
|
||||
@Query("filter") filter: String
|
||||
): Call<List<BuyerVO>>
|
||||
|
||||
@POST("Applications/{routine}/execute-func")
|
||||
|
@ -104,6 +109,7 @@ interface SalixService {
|
|||
@Query("schema") schema: String = "vn",
|
||||
@Query("params") params: Any? = null
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/expedition_checkRoute/execute-func")
|
||||
fun expeditionCheckRoute(
|
||||
@Query("params") params: Any,
|
||||
|
@ -113,22 +119,21 @@ interface SalixService {
|
|||
@GET("ExpeditionStates/filter")
|
||||
fun getExpeditionStates(
|
||||
@Query("filter") filter: Any,
|
||||
): Call<List<ExpeditionInfoLog>>
|
||||
): Call<List<ExpeditionInfoLog>>
|
||||
|
||||
@GET("Expeditions")
|
||||
fun getRoutesFromExpedition(
|
||||
@Query("filter") filter: Any,
|
||||
): Call<List<RouteDelivery>>
|
||||
): Call<List<RouteDelivery>>
|
||||
|
||||
@GET("Routes/getTickets")
|
||||
fun getTickets(
|
||||
@Query("filter") filter: Any,
|
||||
): Call<MutableList<ClientTicket>>
|
||||
): Call<MutableList<ClientTicket>>
|
||||
|
||||
@GET("Routes/getByWorker")
|
||||
fun getRoutes(
|
||||
): Call<MutableList<RouteInfo>>
|
||||
|
||||
): Call<MutableList<RouteInfo>>
|
||||
|
||||
@POST("Applications/{routine}/execute-proc")
|
||||
fun executeProc(
|
||||
|
@ -142,6 +147,7 @@ interface SalixService {
|
|||
@Query("schema") schema: String = "vn",
|
||||
@Query("params") params: Any? = null
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/collection_addWithReservation/execute-proc")
|
||||
fun collectionAddWithReservation(
|
||||
@Query("schema") schema: String = "vn",
|
||||
|
@ -176,6 +182,7 @@ interface SalixService {
|
|||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Any>
|
||||
|
||||
@POST("Applications/cmrPallet_add/execute-proc")
|
||||
fun cmrPalletAdd(
|
||||
@Query("params") params: Any? = null,
|
||||
|
@ -229,6 +236,103 @@ interface SalixService {
|
|||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Unit>
|
||||
|
||||
@GET("ExpeditionPallets/getPallet")//REVISADA
|
||||
fun expeditionPalletGetPallet(
|
||||
@Query("expeditionFk") expeditionFk: Number,
|
||||
): Call<ItemExpeditionTruckVO>
|
||||
|
||||
@GET("Operators/getPrinter")//NO SALIX
|
||||
fun getprinters():
|
||||
Call<List<Printers>>
|
||||
@GET("Collections/getSalesFromTicketOrCollection")//REVISADA
|
||||
fun collectionGetTickets(
|
||||
@Query("collectionOrTicketFk") collectionOrTicketFk: Number,
|
||||
@Query("sectorFk") sectorFk: Number,
|
||||
@Query("printFk") printFk: Number,
|
||||
@Query("source") source: String,
|
||||
|
||||
):
|
||||
Call<CollectionVO>
|
||||
|
||||
@POST("almacennew/SaleTrackings/mark")//REVISADA
|
||||
fun saleTrackingMark(
|
||||
@Body vararg params: Any?
|
||||
):
|
||||
Call<Any>
|
||||
@GET("ItemShelvings/getSale")//NO SALIX
|
||||
fun sectorCollectionGetSale(
|
||||
@Query("sectorFk") sectorFk: Int,
|
||||
@Query("sectorCollectionFk") sectorCollectionFk: Int,
|
||||
):
|
||||
Call<List<PreSacadorItemVO>>
|
||||
@POST("Collections/addItem")//REVISADA
|
||||
fun collectionAddItem(
|
||||
@Body params: Any
|
||||
):
|
||||
Call<Any>
|
||||
|
||||
@POST("Collections/assignCollection")//NO SALIX
|
||||
fun collectionAssign(
|
||||
):
|
||||
Call<Int>
|
||||
|
||||
@POST("ItemShelvings/updateFromSale")//REVISADA
|
||||
fun itemShelvingUpdateFromSale(
|
||||
@Body params: Any
|
||||
):
|
||||
Call<Any>
|
||||
|
||||
@POST("SaleTrackings/delete")//REVISADA
|
||||
fun saleTrackingDel(
|
||||
@Body params: Any
|
||||
):
|
||||
Call<Any>
|
||||
|
||||
@POST("Shelvings/addLog")//REVISADA
|
||||
fun shelvingLogAdd(
|
||||
@Body params: Any
|
||||
):
|
||||
Call<Any>
|
||||
|
||||
@POST("ItemShelvings/makeMulti")//REVISADA
|
||||
fun itemShelvingMakeMulti(
|
||||
@Body params: Any
|
||||
):
|
||||
Call<Any>
|
||||
|
||||
@POST("MachineWorkers/updateInTime")//REVISADA
|
||||
fun machineWorkerUpdateInTime(
|
||||
@Query("plate") plate: Any
|
||||
):
|
||||
Call<Any>
|
||||
|
||||
@POST("SaleTrackings/updateTracking")//REVISADA
|
||||
fun saleTrackingUpdate(
|
||||
@Body params: Any
|
||||
):
|
||||
Call<Any>
|
||||
|
||||
|
||||
@GET("ItemShelvings/return")
|
||||
fun itemShelvingReturn(
|
||||
@Query("shelvingFk") shelvingFk: String
|
||||
):
|
||||
Call<ArrayList<Reubication>>
|
||||
|
||||
@GET("MobileAppVersionControls/getVersion")//REVISADA
|
||||
fun getVersion(
|
||||
@Query("app") app: String
|
||||
):
|
||||
Call<versionApp>
|
||||
|
||||
@GET("Items/card")//NO SALIX
|
||||
fun getCard(
|
||||
@Query("itemFk") itemFk: Number,
|
||||
@Query("warehouseFk") warehouseFk: Int
|
||||
):
|
||||
Call<ItemCardVO>
|
||||
|
||||
@POST("Applications/itemPlacementSupplyAiming/execute-proc")
|
||||
fun itemPlacementSupplyAiming(
|
||||
@Query("params") params: Any? = null,
|
||||
|
@ -277,6 +381,12 @@ interface SalixService {
|
|||
@Query("schema") schema: String = "vn"
|
||||
): Call<Unit>
|
||||
|
||||
@POST("Applications/itemShelvingSale_setSaleGroup/execute-proc")
|
||||
fun itemShelvingSaleSetSaleGroup(
|
||||
@Query("params") params: Any? = null,
|
||||
@Query("schema") schema: String = "vn"
|
||||
): Call<Unit>
|
||||
|
||||
@POST("Applications/itemShelvingSale_unpicked/execute-proc")
|
||||
fun itemShelvingSaleUnpicked(
|
||||
@Query("params") params: Any? = null,
|
||||
|
@ -597,10 +707,8 @@ interface SalixService {
|
|||
): Call<Any>
|
||||
|
||||
//DE MOMENTO NO FUNCIONA, SE QUERÍA AÑADIR POR INSERTIGNORE
|
||||
@POST("Operators/upsertWithWhere")
|
||||
@POST("Operators/add")
|
||||
fun operatorAdd(
|
||||
@Query("where") where: String,
|
||||
@Body params: Any
|
||||
): Call<Any>
|
||||
|
||||
@POST("DeviceLogs")
|
||||
|
@ -630,12 +738,13 @@ interface SalixService {
|
|||
|
||||
@PUT("ItemBarCodes")//REVISADA
|
||||
fun barcodes_edit(
|
||||
@Body params: itemBarCodeSalix
|
||||
@Body params: ItemBarCodeSalix
|
||||
): Call<Any>
|
||||
|
||||
@DELETE("ItemBarCodes")//REVISADA
|
||||
fun deleteItemBarCode(
|
||||
@Body params: itemBarCodeSalix
|
||||
@DELETE("ItemBarcodes/delete")//REVISADA
|
||||
fun barcodesDelete(
|
||||
@Query("barcode") barcode: String,
|
||||
@Query("itemFk") itemFk: Int,
|
||||
): Call<Any>
|
||||
|
||||
@GET("ItemBarCodes/{barCodeValue}/toItem")//REVISADA
|
||||
|
@ -731,7 +840,6 @@ interface SalixService {
|
|||
@Body params: Any
|
||||
): Call<Any>
|
||||
|
||||
|
||||
@PATCH("ItemShelvingSales/{id}")
|
||||
fun itemShelvingsReservedUpdate(
|
||||
@Path("id") id: Number,
|
||||
|
|
|
@ -1,10 +1,28 @@
|
|||
package es.verdnatura.presentation.common
|
||||
|
||||
|
||||
class itemBarCodeSalix(
|
||||
class ItemBarCodeSalix(
|
||||
var itemFk: Int,
|
||||
var code: String
|
||||
)
|
||||
data class SaleTrackingReplaceSalix(
|
||||
var saleFk: Int,
|
||||
var originalQuantity: Int,
|
||||
var code: String,
|
||||
var isChecked: Boolean,
|
||||
var buyFk: Long,
|
||||
var isScanned: Boolean,
|
||||
)
|
||||
data class SaleTrackingSalix(
|
||||
var saleFk: Int,
|
||||
var originalQuantity: Int,
|
||||
var code: String,
|
||||
var isChecked: Boolean,
|
||||
var buyFk: Long,
|
||||
var isScanned: Boolean,
|
||||
var quantity: Int,
|
||||
var itemShelvingFk: Int
|
||||
|
||||
)
|
||||
|
||||
class packingSiteSalix(
|
||||
var ticketFk: Int,
|
||||
|
@ -35,4 +53,12 @@ data class ItemDiscardSalixShortage(
|
|||
data class BackSalixCall(
|
||||
var schema: String = "vn",
|
||||
var params: ArrayList<Any?>
|
||||
)
|
||||
)
|
||||
|
||||
data class CollectionItemSalix(
|
||||
var code: Int,
|
||||
var quantity: Int,
|
||||
var ticketFk: Int,
|
||||
var warehouseFk: Int
|
||||
|
||||
)
|
||||
|
|
|
@ -261,6 +261,8 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
fun printer_get() {
|
||||
//Tarea 6276
|
||||
//salix.getprinters().enqueue(object : SalixCallback<List<Printers>>(context) {
|
||||
silex.printer_get().enqueue(object : SilexCallback<List<Printers>>(context) {
|
||||
override fun onSuccess(response: Response<List<Printers>>) {
|
||||
if (response.body() != null) {
|
||||
|
@ -381,7 +383,7 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}*/
|
||||
|
||||
fun operator_getItemPackingType() {
|
||||
/* fun operator_getItemPackingType() {
|
||||
|
||||
silex.operator_getItemPackingType()
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
|
@ -403,7 +405,7 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
}
|
||||
})
|
||||
}
|
||||
}*/
|
||||
|
||||
fun worker_isF11Allowed() {
|
||||
salix.worker_isF11Allowed("""{"where":{"id":${(context as MobileApplication).userId}},"fields":{"isF11Allowed":true}}""")
|
||||
|
|
|
@ -1154,7 +1154,7 @@ class CollectionFragment(
|
|||
},
|
||||
object : onPackingClickListener {
|
||||
override fun onPackingClick(sale: SaleVO) {
|
||||
// item_updatePackingShelve(sale.itemFk)
|
||||
// item_updatePackingShelve(sale.itemFk)
|
||||
}
|
||||
},
|
||||
object : OnTicketClickListener {
|
||||
|
@ -1565,11 +1565,11 @@ class CollectionFragment(
|
|||
//binding.splashProgress.visibility=VISIBLE
|
||||
viewModel.saleTrackingReplace(
|
||||
saleFk = sales[position].saleFk,
|
||||
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
|
||||
vOriginalQuantity = sales[position].pickedQuantity!!,
|
||||
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
|
||||
vBuyFk = originalItemScan!!,
|
||||
vIsScanned = isScanned
|
||||
isChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
|
||||
originalQuantity = sales[position].pickedQuantity!!,
|
||||
code = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
|
||||
buyFk = originalItemScan!!,
|
||||
isScanned = isScanned
|
||||
|
||||
)
|
||||
|
||||
|
@ -1582,13 +1582,13 @@ class CollectionFragment(
|
|||
viewModel.run {
|
||||
saleTracking_mark(
|
||||
saleFk = sales[position].saleFk,
|
||||
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
|
||||
vOriginalQuantity = sales[position].pickedQuantity!!,
|
||||
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
|
||||
vBuyFk = originalItemScan!!,
|
||||
vItemShelvingFk = itemShelvingTracking_mark,
|
||||
vQuantity = customDialogList.getValue().toInt(),
|
||||
vIsScanned = isScanned
|
||||
isChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
|
||||
originalQuantity = sales[position].pickedQuantity!!,
|
||||
code = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
|
||||
buyFk = originalItemScan!!,
|
||||
itemShelvingFk = itemShelvingTracking_mark,
|
||||
quantity = customDialogList.getValue().toInt(),
|
||||
isScanned = isScanned
|
||||
|
||||
)
|
||||
}
|
||||
|
@ -2247,60 +2247,60 @@ class CollectionFragment(
|
|||
|
||||
}
|
||||
|
||||
/* private fun item_updatePackingShelve(itemFk: Int) {
|
||||
/* private fun item_updatePackingShelve(itemFk: Int) {
|
||||
|
||||
isMarking = false
|
||||
customDialogInput.setTitle(getString(R.string.packetNumberShelves))
|
||||
.setDescription(getString(R.string.packetIndicate))
|
||||
.setOkButton(getString(R.string.accept)) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
isMarking = false
|
||||
customDialogInput.setTitle(getString(R.string.packetNumberShelves))
|
||||
.setDescription(getString(R.string.packetIndicate))
|
||||
.setOkButton(getString(R.string.accept)) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.item_updatePackingShelve(
|
||||
vSelf = itemFk,
|
||||
vPacking = customDialogInput.getValue().toInt()
|
||||
)
|
||||
hideKeyboards()
|
||||
//showKeyboards()
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.item_updatePackingShelve(
|
||||
vSelf = itemFk,
|
||||
vPacking = customDialogInput.getValue().toInt()
|
||||
)
|
||||
hideKeyboards()
|
||||
//showKeyboards()
|
||||
|
||||
}
|
||||
customDialogInput.setValue("")
|
||||
customDialogInput.dismiss()
|
||||
// hideKeyboards()
|
||||
showKeyboards()
|
||||
}.setKoButton(getString(R.string.cancel)) {
|
||||
}
|
||||
customDialogInput.setValue("")
|
||||
customDialogInput.dismiss()
|
||||
// hideKeyboards()
|
||||
showKeyboards()
|
||||
}.setKoButton(getString(R.string.cancel)) {
|
||||
|
||||
customDialogInput.dismiss()
|
||||
//hideKeyboards()
|
||||
showKeyboards()
|
||||
}.setValue("").show()
|
||||
customDialogInput.dismiss()
|
||||
//hideKeyboards()
|
||||
showKeyboards()
|
||||
}.setValue("").show()
|
||||
|
||||
customDialogInput.setInputText(TYPE_CLASS_NUMBER)
|
||||
customDialogInput.currentFocus
|
||||
customDialogInput.setFocusText()
|
||||
showKeyboards()
|
||||
customDialogInput.setInputText(TYPE_CLASS_NUMBER)
|
||||
customDialogInput.currentFocus
|
||||
customDialogInput.setFocusText()
|
||||
showKeyboards()
|
||||
|
||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
customDialogInput.getEditText().setOnEditorActionListener { v, actionId, event ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
||||
if (!customDialogInput.getValue().isNullOrEmpty()) {
|
||||
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.item_updatePackingShelve(
|
||||
vSelf = itemFk,
|
||||
vPacking = customDialogInput.getValue().toInt()
|
||||
)
|
||||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.item_updatePackingShelve(
|
||||
vSelf = itemFk,
|
||||
vPacking = customDialogInput.getValue().toInt()
|
||||
)
|
||||
|
||||
}
|
||||
customDialogInput.setValue("")
|
||||
scanRequest()
|
||||
customDialogInput.dismiss()
|
||||
hideKeyboards()
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
}
|
||||
customDialogInput.setValue("")
|
||||
scanRequest()
|
||||
customDialogInput.dismiss()
|
||||
hideKeyboards()
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
}*/
|
||||
}*/
|
||||
|
||||
//FALTAS / BASURA / SPLIT
|
||||
|
||||
|
|
|
@ -1608,11 +1608,11 @@ class CollectionFragmentPicker(
|
|||
//binding.splashProgress.visibility=VISIBLE
|
||||
viewModel.saleTrackingReplace(
|
||||
saleFk = sales[position].saleFk,
|
||||
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
|
||||
vOriginalQuantity = sales[position].pickedQuantity!!,
|
||||
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
|
||||
vBuyFk = originalItemScan!!,
|
||||
vIsScanned = isScanned
|
||||
isChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
|
||||
originalQuantity = sales[position].pickedQuantity!!,
|
||||
code = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
|
||||
buyFk = originalItemScan!!,
|
||||
isScanned = isScanned
|
||||
|
||||
)
|
||||
|
||||
|
@ -1625,13 +1625,13 @@ class CollectionFragmentPicker(
|
|||
viewModel.run {
|
||||
saleTracking_mark(
|
||||
saleFk = sales[position].saleFk,
|
||||
vIsChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
|
||||
vOriginalQuantity = sales[position].pickedQuantity!!,
|
||||
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
|
||||
vBuyFk = originalItemScan!!,
|
||||
vItemShelvingFk = itemShelvingTracking_mark,
|
||||
vQuantity = customDialogList.getValue().toInt(),
|
||||
vIsScanned = isScanned
|
||||
isChecked = if (type == SACADOR) sales[position].isPrepared else if (type == CONTROLADOR) sales[position].isControlled else if (type == "PRECHECKER") sales[position].isPreControlled else "1",
|
||||
originalQuantity = sales[position].pickedQuantity!!,
|
||||
code = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
|
||||
buyFk = originalItemScan!!,
|
||||
itemShelvingFk = itemShelvingTracking_mark,
|
||||
quantity = customDialogList.getValue().toInt(),
|
||||
isScanned = isScanned
|
||||
|
||||
)
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ 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.common.SaleTrackingReplaceSalix
|
||||
import es.verdnatura.presentation.view.feature.collection.ItemVO
|
||||
import es.verdnatura.presentation.view.feature.collection.SalesModifiedList
|
||||
import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity
|
||||
|
@ -87,7 +88,6 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val responseItemShelvingSale: LiveData<ResponseItemVO>
|
||||
get() = _responseItemShelvingSale
|
||||
|
||||
|
||||
private val _responseItemShelvingSaleUnPicked by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseItemShelvingSaleUnPicked: LiveData<ResponseItemVO>
|
||||
get() = _responseItemShelvingSaleUnPicked
|
||||
|
@ -132,6 +132,10 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val responseSaleGroup: LiveData<ResponseItemVO>
|
||||
get() = _responseSaleGroup
|
||||
|
||||
private val _responseItemShelvingSaleGroup by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responseItemShelvingSaleGroup: LiveData<ResponseItemVO>
|
||||
get() = _responseItemShelvingSaleGroup
|
||||
|
||||
private val _responsecheckfully by lazy { MutableLiveData<ResponseItemVO>() }
|
||||
val responsecheckfully: LiveData<ResponseItemVO>
|
||||
get() = _responsecheckfully
|
||||
|
@ -269,12 +273,13 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
type: String
|
||||
) {
|
||||
//Falta back de Salix
|
||||
// salix.collectionGet(params = arrayListOf(collectionFk, sectorFk, print, type).formatWithQuotes())
|
||||
silex.collection_get(
|
||||
collectionFk,
|
||||
sectorFk,
|
||||
print,
|
||||
type)
|
||||
// salix.collectionGet(params = arrayListOf(collectionFk, sectorFk, print, type).formatWithQuotes())
|
||||
silex.collection_get(
|
||||
collectionFk,
|
||||
sectorFk,
|
||||
print,
|
||||
type
|
||||
)
|
||||
.enqueue(object :
|
||||
SalixCallback<CollectionVO>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
@ -305,20 +310,24 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
fun saleTrackingReplace(
|
||||
saleFk: Int,
|
||||
vOriginalQuantity: Int,
|
||||
vStateFk: String,
|
||||
vIsChecked: String,
|
||||
vBuyFk: Long,
|
||||
vIsScanned: Boolean?
|
||||
originalQuantity: Int,
|
||||
code: String,
|
||||
isChecked: String,
|
||||
buyFk: Long,
|
||||
isScanned: Boolean?
|
||||
) {
|
||||
silex.saleTrackingReplace(
|
||||
salix.saleTrackingUpdate(SaleTrackingReplaceSalix(
|
||||
saleFk,originalQuantity,code, isChecked != "0",buyFk,isScanned!!
|
||||
))
|
||||
/*silex.saleTrackingReplace(
|
||||
saleFk,
|
||||
vOriginalQuantity,
|
||||
vStateFk,
|
||||
vIsChecked != "0",
|
||||
vBuyFk,
|
||||
vIsScanned!!
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
originalQuantity,
|
||||
code,
|
||||
isChecked != "0",
|
||||
buyFk,
|
||||
isScanned!!
|
||||
)*/
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseSaleReplace.value = ResponseItemVO(
|
||||
isError = true,
|
||||
|
@ -334,23 +343,34 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
fun saleTracking_mark(
|
||||
saleFk: Int,
|
||||
vOriginalQuantity: Int,
|
||||
vStateFk: String,
|
||||
vIsChecked: String,
|
||||
vBuyFk: Long,
|
||||
vItemShelvingFk: Int,
|
||||
vQuantity: Int,
|
||||
vIsScanned: Boolean?
|
||||
originalQuantity: Int,
|
||||
code: String,
|
||||
isChecked: String,
|
||||
buyFk: Long,
|
||||
itemShelvingFk: Int,
|
||||
quantity: Int,
|
||||
isScanned: Boolean?
|
||||
) {
|
||||
//Tarea 6276 flata probar
|
||||
/* salix.saleTrackingMark(
|
||||
SaleTrackingSalix(saleFk,
|
||||
originalQuantity,
|
||||
code,
|
||||
isChecked!="0",
|
||||
buyFk,
|
||||
itemShelvingFk = itemShelvingFk,
|
||||
quantity = quantity,
|
||||
isScanned = isScanned)
|
||||
)*/
|
||||
silex.saleTracking_mark(
|
||||
saleFk,
|
||||
vOriginalQuantity,
|
||||
vStateFk,
|
||||
vIsChecked != "0",
|
||||
vBuyFk,
|
||||
vItemShelvingFk,
|
||||
vQuantity,
|
||||
vIsScanned
|
||||
originalQuantity,
|
||||
code,
|
||||
isChecked != "0",
|
||||
buyFk,
|
||||
itemShelvingFk,
|
||||
quantity,
|
||||
isScanned
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseSaleTracking_mark.value = ResponseItemVO(
|
||||
|
@ -381,9 +401,10 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
quantity: Int,
|
||||
isItemShelvingSaleEmpty: Boolean?
|
||||
) {
|
||||
salix.itemShelvingSaleSetquantitySalix(params = arrayListOf(itemShelvingSaleFk,quantity,isItemShelvingSaleEmpty)
|
||||
//salix.itemShelvingSaleSetQuantity(
|
||||
// params = ItemShelvingSaleSalix(itemShelvingSaleFk, quantity, isItemShelvingSaleEmpty)
|
||||
salix.itemShelvingSaleSetquantitySalix(
|
||||
params = arrayListOf(itemShelvingSaleFk, quantity, isItemShelvingSaleEmpty)
|
||||
//salix.itemShelvingSaleSetQuantity(
|
||||
// params = ItemShelvingSaleSalix(itemShelvingSaleFk, quantity, isItemShelvingSaleEmpty)
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseConfirmReservedItemShelvingSale.value = ResponseItemVO(
|
||||
|
@ -416,18 +437,18 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
) {
|
||||
salix.collectionAddWithReservation(
|
||||
params = arrayListOf(item, quantity, ticketSelected)
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
).enqueue(object : SalixCallback<Any>(context) {
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseCollectionAddItem.value =
|
||||
ResponseItemVO(isError = false, response = "")
|
||||
}
|
||||
|
||||
override fun onError(t: Throwable) {
|
||||
_responseCollectionAddItem.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
/* override fun onError(t: Throwable) {
|
||||
_responseCollectionAddItem.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}*/
|
||||
|
||||
})
|
||||
}
|
||||
|
@ -600,18 +621,42 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
})
|
||||
}
|
||||
|
||||
fun itemShelvingSaleSetSaleGroup(
|
||||
saleGroupFk: Int
|
||||
) {
|
||||
salix.itemShelvingSaleSetSaleGroup(
|
||||
arrayListOf(
|
||||
saleGroupFk
|
||||
)
|
||||
).enqueue(object : SalixCallback<Unit>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseItemShelvingSaleGroup.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onSuccess(response: Response<Unit>) {
|
||||
_responseItemShelvingSaleGroup.value = ResponseItemVO(isError = false)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun collectionAddItem(
|
||||
itemFk: Int,
|
||||
quantityFk: Int,
|
||||
ticketFk: Int,
|
||||
warehouseFk: Int
|
||||
) {
|
||||
//Tarea 6276
|
||||
//salix.collectionAddItem(CollectionItemSalix(itemFk,quantityFk,ticketFk,warehouseFk))
|
||||
silex.collectionAddItem(
|
||||
itemFk,
|
||||
quantityFk,
|
||||
ticketFk,
|
||||
warehouseFk
|
||||
).enqueue(object : SilexCallback<Any>(context) {
|
||||
)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
||||
_responseNew.value = ResponseItemVO(
|
||||
|
@ -706,6 +751,7 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
fun saleTrackingDel(saleFk: Int) {
|
||||
//salix.saleTrackingDel(SaleTrackingDelSalix(saleFk = saleFk, stateCodes = listOf("CHECKED","OK","PREPARED")))
|
||||
silex.saleTrackingDel(saleFk)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
@ -723,12 +769,11 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
fun itemShelving_updateFromSale(
|
||||
itemShelvingFk: Int
|
||||
saleFk: Int
|
||||
) {
|
||||
silex.itemShelving_updateFromSale(
|
||||
itemShelvingFk
|
||||
|
||||
)
|
||||
//Tarea 6276
|
||||
//salix.itemShelvingUpdateFromSale(hashMapOf("saleFk" to saleFk))
|
||||
silex.itemShelving_updateFromSale(saleFk)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseItemShelvingUpdate.value = ResponseItemVO(
|
||||
|
|
|
@ -42,6 +42,8 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
|
|||
fun machineWorker_add(
|
||||
PlateNumber: String
|
||||
) {
|
||||
//tarea 6276
|
||||
// salix.machineWorkerUpdateInTime()
|
||||
silex.machineWorker_add(PlateNumber)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
@ -79,10 +81,11 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
fun machineWorker_update(
|
||||
|
||||
PlateNumber: String
|
||||
plate: String
|
||||
) {
|
||||
silex.machineWorker_update(PlateNumber)
|
||||
//Tarea 6276
|
||||
//salix.machineWorkerUpdateInTime(plate)
|
||||
silex.machineWorker_update(plate)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseinsert.value = ResponseItemVO(
|
||||
|
@ -106,7 +109,7 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
|
|||
} else {
|
||||
|
||||
_responseinsert.value =
|
||||
ResponseItemVO(isError = false, response = response.body()!!.toString())
|
||||
ResponseItemVO(isError = false, response = "")
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.paletizador.fragment
|
|||
import android.content.Context
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import es.verdnatura.domain.SalixCallback
|
||||
import es.verdnatura.domain.SilexCallback
|
||||
import es.verdnatura.domain.formatWithQuotes
|
||||
import es.verdnatura.presentation.base.BaseViewModel
|
||||
|
@ -52,8 +53,10 @@ class PalletScanViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
fun expeditionPallet_get(vPalletId: Int) {
|
||||
//Tarea 6276
|
||||
//salix.expeditionPalletGetPallet(vPalletId)
|
||||
silex.expeditionPallet_get(vPalletId)
|
||||
.enqueue(object : SilexCallback<ItemExpeditionTruckVO>(context) {
|
||||
.enqueue(object : SalixCallback<ItemExpeditionTruckVO>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
||||
_responsePalletGet.value = ItemExpeditionTruckVO(
|
||||
|
|
|
@ -461,7 +461,7 @@ class EndSacadorFragment(
|
|||
binding.splashProgress.visibility = VISIBLE
|
||||
viewModel.sectorCollection_getSale(
|
||||
collection.collectionFk,
|
||||
vSectorFk = getDataInt(SECTORFK)
|
||||
sectorFk = getDataInt(SECTORFK)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -384,11 +384,13 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
|
||||
fun sectorCollection_getSale(
|
||||
sectorCollectionFK: Int,
|
||||
vSectorFk: Int
|
||||
sectorFk: Int
|
||||
) {
|
||||
silex.sectorCollection_getSale(
|
||||
//Tarea 6276
|
||||
//salix.sectorCollectionGetSale(sectorCollectionFK, sectorFk)
|
||||
silex.sectorCollection_getSale(
|
||||
sectorCollectionFK,
|
||||
vSectorFk.toString()
|
||||
sectorFk.toString()
|
||||
)
|
||||
.enqueue(object :
|
||||
SilexCallback<List<PreSacadorItemVO>>(context) {
|
||||
|
|
|
@ -135,7 +135,10 @@ class SacadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
}
|
||||
|
||||
fun collection_assign() {
|
||||
silex.collection_assign().enqueue(
|
||||
//Tarea 6276
|
||||
//salix.collectionAssign()
|
||||
silex.collection_assign()
|
||||
.enqueue(
|
||||
object :
|
||||
SilexCallback<Int>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
|
|
@ -18,7 +18,10 @@ class ShowTicketViewModel(val context: Context) : BaseViewModel(context) {
|
|||
get() = _collectionTicketList
|
||||
|
||||
fun collectionTicketGet(collectionFk: Int, sectorFk: Int, print: String, type: String) {
|
||||
silex.collection_getTickets(collectionFk, sectorFk, print, type).enqueue(object :
|
||||
//Tarea 6276
|
||||
//salix.collectionGetTickets(collectionFk,sectorFk,print.toInt(),type)
|
||||
silex.collection_getTickets(collectionFk, sectorFk, print, type)
|
||||
.enqueue(object :
|
||||
SilexCallback<CollectionVO>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_collectionTicketList.value = CollectionVO(
|
||||
|
|
|
@ -117,7 +117,7 @@ class AutomaticAddItemFragment(
|
|||
getDataInt(WAREHOUSEFK)
|
||||
)
|
||||
} else {
|
||||
viewModel.itemShelvingMake_multi(
|
||||
viewModel.itemShelvingMakeMulti(
|
||||
shelvingFk,
|
||||
listString,
|
||||
getDataInt(WAREHOUSEFK)
|
||||
|
|
|
@ -120,7 +120,7 @@ class AutomaticAddItemFragmentTEST(
|
|||
)
|
||||
} else {
|
||||
|
||||
viewModel.itemShelvingMake_multi(
|
||||
viewModel.itemShelvingMakeMulti(
|
||||
shelvingFk,
|
||||
listString,
|
||||
getDataInt(WAREHOUSEFK)
|
||||
|
|
|
@ -18,12 +18,14 @@ class AutomaticAddItemViewModel(val context: Context) : BaseViewModel(context) {
|
|||
val response: LiveData<ResponseItemVO>
|
||||
get() = _response
|
||||
|
||||
fun itemShelvingMake_multi(
|
||||
shelving: String,
|
||||
fun itemShelvingMakeMulti(
|
||||
shelvingFk: String,
|
||||
items: List<Long>,
|
||||
warehouse: Int
|
||||
warehouseFk: Int
|
||||
) {
|
||||
silex.itemShelvingMake_multi(shelving, items, warehouse)
|
||||
//Tarea 6276
|
||||
//salix.itemShelvingMakeMulti(MakeMultiSalix(shelvingFk,items,warehouseFk))
|
||||
silex.itemShelvingMake_multi(shelvingFk, items, warehouseFk)
|
||||
.enqueue(object :
|
||||
SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
|
|
@ -630,13 +630,8 @@ class UbicadorFragment(
|
|||
})
|
||||
responseLog.observe(viewLifecycleOwner, Observer {
|
||||
|
||||
if (it.isError) {
|
||||
ma.messageWithSound(it.errorMessage, it.isError, false)
|
||||
|
||||
|
||||
} else {
|
||||
if (!it.isError) {
|
||||
isShelvinLogfromMainScreen = false
|
||||
|
||||
}
|
||||
})
|
||||
loadResponseCode.observe(viewLifecycleOwner) { event ->
|
||||
|
|
|
@ -280,14 +280,10 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
fun shelvinLog_add(
|
||||
code: String
|
||||
) {
|
||||
//Tarea 6276
|
||||
// salix.shelvingLogAdd(hashMapOf("code" to code))
|
||||
silex.shelvingLog_add(code)
|
||||
.enqueue(object : SilexCallback<Any>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
_responseLog.value = ResponseItemVO(
|
||||
isError = true,
|
||||
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
|
||||
)
|
||||
}
|
||||
.enqueue(object : SalixCallback<Any>(context) {
|
||||
|
||||
override fun onSuccess(response: Response<Any>) {
|
||||
_responseLog.value =
|
||||
|
@ -301,6 +297,8 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
|
|||
shelvingFk: String,
|
||||
|
||||
) {
|
||||
//Tarea 6273
|
||||
// salix.itemShelvingReturn(shelvingFk)
|
||||
silex.itemShelving_return(shelvingFk)
|
||||
.enqueue(object : SilexCallback<ArrayList<Reubication>>(context) {
|
||||
override fun onError(t: Throwable) {
|
||||
|
|
Loading…
Reference in New Issue