diff --git a/app/src/main/java/es/verdnatura/domain/SalixService.kt b/app/src/main/java/es/verdnatura/domain/SalixService.kt index ab124a3d..31c48b00 100644 --- a/app/src/main/java/es/verdnatura/domain/SalixService.kt +++ b/app/src/main/java/es/verdnatura/domain/SalixService.kt @@ -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> @POST("Applications/{routine}/execute-func") @@ -104,6 +109,7 @@ interface SalixService { @Query("schema") schema: String = "vn", @Query("params") params: Any? = null ): Call + @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> + ): Call> @GET("Expeditions") fun getRoutesFromExpedition( @Query("filter") filter: Any, - ): Call> + ): Call> @GET("Routes/getTickets") fun getTickets( @Query("filter") filter: Any, - ): Call> + ): Call> @GET("Routes/getByWorker") fun getRoutes( - ): Call> - + ): Call> @POST("Applications/{routine}/execute-proc") fun executeProc( @@ -142,6 +147,7 @@ interface SalixService { @Query("schema") schema: String = "vn", @Query("params") params: Any? = null ): Call + @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 + @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 + + @GET("ExpeditionPallets/getPallet")//REVISADA + fun expeditionPalletGetPallet( + @Query("expeditionFk") expeditionFk: Number, + ): Call + + @GET("Operators/getPrinter")//NO SALIX + fun getprinters(): + Call> + @GET("Collections/getSalesFromTicketOrCollection")//REVISADA + fun collectionGetTickets( + @Query("collectionOrTicketFk") collectionOrTicketFk: Number, + @Query("sectorFk") sectorFk: Number, + @Query("printFk") printFk: Number, + @Query("source") source: String, + + ): + Call + + @POST("almacennew/SaleTrackings/mark")//REVISADA + fun saleTrackingMark( + @Body vararg params: Any? + ): + Call + @GET("ItemShelvings/getSale")//NO SALIX + fun sectorCollectionGetSale( + @Query("sectorFk") sectorFk: Int, + @Query("sectorCollectionFk") sectorCollectionFk: Int, + ): + Call> + @POST("Collections/addItem")//REVISADA + fun collectionAddItem( + @Body params: Any + ): + Call + + @POST("Collections/assignCollection")//NO SALIX + fun collectionAssign( + ): + Call + + @POST("ItemShelvings/updateFromSale")//REVISADA + fun itemShelvingUpdateFromSale( + @Body params: Any + ): + Call + + @POST("SaleTrackings/delete")//REVISADA + fun saleTrackingDel( + @Body params: Any + ): + Call + + @POST("Shelvings/addLog")//REVISADA + fun shelvingLogAdd( + @Body params: Any + ): + Call + + @POST("ItemShelvings/makeMulti")//REVISADA + fun itemShelvingMakeMulti( + @Body params: Any + ): + Call + + @POST("MachineWorkers/updateInTime")//REVISADA + fun machineWorkerUpdateInTime( + @Query("plate") plate: Any + ): + Call + + @POST("SaleTrackings/updateTracking")//REVISADA + fun saleTrackingUpdate( + @Body params: Any + ): + Call + + + @GET("ItemShelvings/return") + fun itemShelvingReturn( + @Query("shelvingFk") shelvingFk: String + ): + Call> + + @GET("MobileAppVersionControls/getVersion")//REVISADA + fun getVersion( + @Query("app") app: String + ): + Call + + @GET("Items/card")//NO SALIX + fun getCard( + @Query("itemFk") itemFk: Number, + @Query("warehouseFk") warehouseFk: Int + ): + Call + @POST("Applications/itemPlacementSupplyAiming/execute-proc") fun itemPlacementSupplyAiming( @Query("params") params: Any? = null, @@ -277,6 +381,12 @@ interface SalixService { @Query("schema") schema: String = "vn" ): Call + @POST("Applications/itemShelvingSale_setSaleGroup/execute-proc") + fun itemShelvingSaleSetSaleGroup( + @Query("params") params: Any? = null, + @Query("schema") schema: String = "vn" + ): Call + @POST("Applications/itemShelvingSale_unpicked/execute-proc") fun itemShelvingSaleUnpicked( @Query("params") params: Any? = null, @@ -597,10 +707,8 @@ interface SalixService { ): Call //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 @POST("DeviceLogs") @@ -630,12 +738,13 @@ interface SalixService { @PUT("ItemBarCodes")//REVISADA fun barcodes_edit( - @Body params: itemBarCodeSalix + @Body params: ItemBarCodeSalix ): Call - @DELETE("ItemBarCodes")//REVISADA - fun deleteItemBarCode( - @Body params: itemBarCodeSalix + @DELETE("ItemBarcodes/delete")//REVISADA + fun barcodesDelete( + @Query("barcode") barcode: String, + @Query("itemFk") itemFk: Int, ): Call @GET("ItemBarCodes/{barCodeValue}/toItem")//REVISADA @@ -731,7 +840,6 @@ interface SalixService { @Body params: Any ): Call - @PATCH("ItemShelvingSales/{id}") fun itemShelvingsReservedUpdate( @Path("id") id: Number, diff --git a/app/src/main/java/es/verdnatura/presentation/common/SalixBackItems.kt b/app/src/main/java/es/verdnatura/presentation/common/SalixBackItems.kt index 6d3b52df..53914aca 100644 --- a/app/src/main/java/es/verdnatura/presentation/common/SalixBackItems.kt +++ b/app/src/main/java/es/verdnatura/presentation/common/SalixBackItems.kt @@ -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 -) \ No newline at end of file +) + +data class CollectionItemSalix( + var code: Int, + var quantity: Int, + var ticketFk: Int, + var warehouseFk: Int + +) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt index bbb04627..23081fbc 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ajustes/fragment/AjustesViewModel.kt @@ -261,6 +261,8 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) { } fun printer_get() { + //Tarea 6276 + //salix.getprinters().enqueue(object : SalixCallback>(context) { silex.printer_get().enqueue(object : SilexCallback>(context) { override fun onSuccess(response: Response>) { 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(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}}""") diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt index a771d33b..fed40dae 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragment.kt @@ -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 diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPicker.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPicker.kt index 1ead5abd..f70080b9 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPicker.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionFragmentPicker.kt @@ -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 ) } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt index 6784bd86..e798ec4e 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/collection/fragment/CollectionViewModel.kt @@ -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 get() = _responseItemShelvingSale - private val _responseItemShelvingSaleUnPicked by lazy { MutableLiveData() } val responseItemShelvingSaleUnPicked: LiveData get() = _responseItemShelvingSaleUnPicked @@ -132,6 +132,10 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) { val responseSaleGroup: LiveData get() = _responseSaleGroup + private val _responseItemShelvingSaleGroup by lazy { MutableLiveData() } + val responseItemShelvingSaleGroup: LiveData + get() = _responseItemShelvingSaleGroup + private val _responsecheckfully by lazy { MutableLiveData() } val responsecheckfully: LiveData 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(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(context) { + originalQuantity, + code, + isChecked != "0", + buyFk, + isScanned!! + )*/ + .enqueue(object : SilexCallback(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(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(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(context) { + ).enqueue(object : SalixCallback(context) { override fun onSuccess(response: Response) { _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(context) { + override fun onError(t: Throwable) { + _responseItemShelvingSaleGroup.value = ResponseItemVO( + isError = true, + errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) + ) + } + + override fun onSuccess(response: Response) { + _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(context) { + ) + .enqueue(object : SilexCallback(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(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(context) { override fun onError(t: Throwable) { _responseItemShelvingUpdate.value = ResponseItemVO( diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt index c1e51bdd..a7650733 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/controlvehiculo/fragment/ControlVehiculoViewModel.kt @@ -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(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(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 = "") } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/PalletScanViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/PalletScanViewModel.kt index eebfaaa4..7bde04c1 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/PalletScanViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/paletizador/fragment/PalletScanViewModel.kt @@ -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(context) { + .enqueue(object : SalixCallback(context) { override fun onError(t: Throwable) { _responsePalletGet.value = ItemExpeditionTruckVO( diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt index dcd819e2..61aa77b5 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/EndSacadorFragment.kt @@ -461,7 +461,7 @@ class EndSacadorFragment( binding.splashProgress.visibility = VISIBLE viewModel.sectorCollection_getSale( collection.collectionFk, - vSectorFk = getDataInt(SECTORFK) + sectorFk = getDataInt(SECTORFK) ) } diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt index d4833c7c..ab1ee7e8 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/presacador/fragment/PreSacadorViewModel.kt @@ -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>(context) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorViewModel.kt index 9c894203..a487f58a 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/SacadorViewModel.kt @@ -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(context) { override fun onError(t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/showticket/ShowTicketViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/showticket/ShowTicketViewModel.kt index c836af96..37531643 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/showticket/ShowTicketViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/sacador/fragment/showticket/ShowTicketViewModel.kt @@ -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(context) { override fun onError(t: Throwable) { _collectionTicketList.value = CollectionVO( diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragment.kt index ffb9c22b..04e4ad75 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragment.kt @@ -117,7 +117,7 @@ class AutomaticAddItemFragment( getDataInt(WAREHOUSEFK) ) } else { - viewModel.itemShelvingMake_multi( + viewModel.itemShelvingMakeMulti( shelvingFk, listString, getDataInt(WAREHOUSEFK) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragmentTEST.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragmentTEST.kt index 1e0324f1..3d00b31b 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragmentTEST.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemFragmentTEST.kt @@ -120,7 +120,7 @@ class AutomaticAddItemFragmentTEST( ) } else { - viewModel.itemShelvingMake_multi( + viewModel.itemShelvingMakeMulti( shelvingFk, listString, getDataInt(WAREHOUSEFK) diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemViewModel.kt index 3b46a22e..cb6a22bf 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/AutomaticAddItemViewModel.kt @@ -18,12 +18,14 @@ class AutomaticAddItemViewModel(val context: Context) : BaseViewModel(context) { val response: LiveData get() = _response - fun itemShelvingMake_multi( - shelving: String, + fun itemShelvingMakeMulti( + shelvingFk: String, items: List, - 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(context) { override fun onError(t: Throwable) { diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt index 2eb942e4..6dd80e02 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorFragment.kt @@ -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 -> diff --git a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt index 17088cf4..0b9e5c12 100644 --- a/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt +++ b/app/src/main/java/es/verdnatura/presentation/view/feature/ubicador/fragment/UbicadorViewModel.kt @@ -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(context) { - override fun onError(t: Throwable) { - _responseLog.value = ResponseItemVO( - isError = true, - errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) - ) - } + .enqueue(object : SalixCallback(context) { override fun onSuccess(response: Response) { _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>(context) { override fun onError(t: Throwable) {