refs #6276: prepare Salixback

This commit is contained in:
Sergio De la torre 2024-01-03 14:13:43 +01:00
parent fe98c3f9fb
commit d6255b03be
17 changed files with 359 additions and 169 deletions

View File

@ -1,11 +1,13 @@
package es.verdnatura.domain package es.verdnatura.domain
import com.google.gson.JsonObject 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.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.SectorItemVO
import es.verdnatura.presentation.view.feature.ajustes.model.Train 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.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.ItemPackingType
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO 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.RenewToken
import es.verdnatura.presentation.view.feature.login.model.SalixGrupo 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.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.EntrySalix
import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier 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.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.ItemPalletVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletViewVO import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletViewVO
import es.verdnatura.presentation.view.feature.paletizador.model.ItemScanVO 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.CollectionTicket
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
@ -95,7 +100,7 @@ interface SalixService {
@GET("Buyers") @GET("Buyers")
fun getBuyers( fun getBuyers(
@Query("filter") filter:String @Query("filter") filter: String
): Call<List<BuyerVO>> ): Call<List<BuyerVO>>
@POST("Applications/{routine}/execute-func") @POST("Applications/{routine}/execute-func")
@ -104,6 +109,7 @@ interface SalixService {
@Query("schema") schema: String = "vn", @Query("schema") schema: String = "vn",
@Query("params") params: Any? = null @Query("params") params: Any? = null
): Call<Any> ): Call<Any>
@POST("Applications/expedition_checkRoute/execute-func") @POST("Applications/expedition_checkRoute/execute-func")
fun expeditionCheckRoute( fun expeditionCheckRoute(
@Query("params") params: Any, @Query("params") params: Any,
@ -129,7 +135,6 @@ interface SalixService {
fun getRoutes( fun getRoutes(
): Call<MutableList<RouteInfo>> ): Call<MutableList<RouteInfo>>
@POST("Applications/{routine}/execute-proc") @POST("Applications/{routine}/execute-proc")
fun executeProc( fun executeProc(
@Path("routine") routine: String, @Path("routine") routine: String,
@ -142,6 +147,7 @@ interface SalixService {
@Query("schema") schema: String = "vn", @Query("schema") schema: String = "vn",
@Query("params") params: Any? = null @Query("params") params: Any? = null
): Call<Any> ): Call<Any>
@POST("Applications/collection_addWithReservation/execute-proc") @POST("Applications/collection_addWithReservation/execute-proc")
fun collectionAddWithReservation( fun collectionAddWithReservation(
@Query("schema") schema: String = "vn", @Query("schema") schema: String = "vn",
@ -176,6 +182,7 @@ interface SalixService {
@Query("params") params: Any? = null, @Query("params") params: Any? = null,
@Query("schema") schema: String = "vn" @Query("schema") schema: String = "vn"
): Call<Any> ): Call<Any>
@POST("Applications/cmrPallet_add/execute-proc") @POST("Applications/cmrPallet_add/execute-proc")
fun cmrPalletAdd( fun cmrPalletAdd(
@Query("params") params: Any? = null, @Query("params") params: Any? = null,
@ -229,6 +236,103 @@ interface SalixService {
@Query("params") params: Any? = null, @Query("params") params: Any? = null,
@Query("schema") schema: String = "vn" @Query("schema") schema: String = "vn"
): Call<Unit> ): 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") @POST("Applications/itemPlacementSupplyAiming/execute-proc")
fun itemPlacementSupplyAiming( fun itemPlacementSupplyAiming(
@Query("params") params: Any? = null, @Query("params") params: Any? = null,
@ -277,6 +381,12 @@ interface SalixService {
@Query("schema") schema: String = "vn" @Query("schema") schema: String = "vn"
): Call<Unit> ): 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") @POST("Applications/itemShelvingSale_unpicked/execute-proc")
fun itemShelvingSaleUnpicked( fun itemShelvingSaleUnpicked(
@Query("params") params: Any? = null, @Query("params") params: Any? = null,
@ -597,10 +707,8 @@ interface SalixService {
): Call<Any> ): Call<Any>
//DE MOMENTO NO FUNCIONA, SE QUERÍA AÑADIR POR INSERTIGNORE //DE MOMENTO NO FUNCIONA, SE QUERÍA AÑADIR POR INSERTIGNORE
@POST("Operators/upsertWithWhere") @POST("Operators/add")
fun operatorAdd( fun operatorAdd(
@Query("where") where: String,
@Body params: Any
): Call<Any> ): Call<Any>
@POST("DeviceLogs") @POST("DeviceLogs")
@ -630,12 +738,13 @@ interface SalixService {
@PUT("ItemBarCodes")//REVISADA @PUT("ItemBarCodes")//REVISADA
fun barcodes_edit( fun barcodes_edit(
@Body params: itemBarCodeSalix @Body params: ItemBarCodeSalix
): Call<Any> ): Call<Any>
@DELETE("ItemBarCodes")//REVISADA @DELETE("ItemBarcodes/delete")//REVISADA
fun deleteItemBarCode( fun barcodesDelete(
@Body params: itemBarCodeSalix @Query("barcode") barcode: String,
@Query("itemFk") itemFk: Int,
): Call<Any> ): Call<Any>
@GET("ItemBarCodes/{barCodeValue}/toItem")//REVISADA @GET("ItemBarCodes/{barCodeValue}/toItem")//REVISADA
@ -731,7 +840,6 @@ interface SalixService {
@Body params: Any @Body params: Any
): Call<Any> ): Call<Any>
@PATCH("ItemShelvingSales/{id}") @PATCH("ItemShelvingSales/{id}")
fun itemShelvingsReservedUpdate( fun itemShelvingsReservedUpdate(
@Path("id") id: Number, @Path("id") id: Number,

View File

@ -1,10 +1,28 @@
package es.verdnatura.presentation.common package es.verdnatura.presentation.common
class ItemBarCodeSalix(
class itemBarCodeSalix(
var itemFk: Int, var itemFk: Int,
var code: String 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( class packingSiteSalix(
var ticketFk: Int, var ticketFk: Int,
@ -36,3 +54,11 @@ data class BackSalixCall(
var schema: String = "vn", var schema: String = "vn",
var params: ArrayList<Any?> var params: ArrayList<Any?>
) )
data class CollectionItemSalix(
var code: Int,
var quantity: Int,
var ticketFk: Int,
var warehouseFk: Int
)

View File

@ -261,6 +261,8 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
} }
fun printer_get() { fun printer_get() {
//Tarea 6276
//salix.getprinters().enqueue(object : SalixCallback<List<Printers>>(context) {
silex.printer_get().enqueue(object : SilexCallback<List<Printers>>(context) { silex.printer_get().enqueue(object : SilexCallback<List<Printers>>(context) {
override fun onSuccess(response: Response<List<Printers>>) { override fun onSuccess(response: Response<List<Printers>>) {
if (response.body() != null) { if (response.body() != null) {
@ -381,7 +383,7 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
}) })
}*/ }*/
fun operator_getItemPackingType() { /* fun operator_getItemPackingType() {
silex.operator_getItemPackingType() silex.operator_getItemPackingType()
.enqueue(object : SilexCallback<Any>(context) { .enqueue(object : SilexCallback<Any>(context) {
@ -403,7 +405,7 @@ class AjustesViewModel(val context: Context) : BaseViewModel(context) {
} }
}) })
} }*/
fun worker_isF11Allowed() { fun worker_isF11Allowed() {
salix.worker_isF11Allowed("""{"where":{"id":${(context as MobileApplication).userId}},"fields":{"isF11Allowed":true}}""") salix.worker_isF11Allowed("""{"where":{"id":${(context as MobileApplication).userId}},"fields":{"isF11Allowed":true}}""")

View File

@ -1565,11 +1565,11 @@ class CollectionFragment(
//binding.splashProgress.visibility=VISIBLE //binding.splashProgress.visibility=VISIBLE
viewModel.saleTrackingReplace( viewModel.saleTrackingReplace(
saleFk = sales[position].saleFk, 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", isChecked = 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!!, originalQuantity = sales[position].pickedQuantity!!,
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(), code = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
vBuyFk = originalItemScan!!, buyFk = originalItemScan!!,
vIsScanned = isScanned isScanned = isScanned
) )
@ -1582,13 +1582,13 @@ class CollectionFragment(
viewModel.run { viewModel.run {
saleTracking_mark( saleTracking_mark(
saleFk = sales[position].saleFk, 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", isChecked = 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!!, originalQuantity = sales[position].pickedQuantity!!,
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(), code = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
vBuyFk = originalItemScan!!, buyFk = originalItemScan!!,
vItemShelvingFk = itemShelvingTracking_mark, itemShelvingFk = itemShelvingTracking_mark,
vQuantity = customDialogList.getValue().toInt(), quantity = customDialogList.getValue().toInt(),
vIsScanned = isScanned isScanned = isScanned
) )
} }

View File

@ -1608,11 +1608,11 @@ class CollectionFragmentPicker(
//binding.splashProgress.visibility=VISIBLE //binding.splashProgress.visibility=VISIBLE
viewModel.saleTrackingReplace( viewModel.saleTrackingReplace(
saleFk = sales[position].saleFk, 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", isChecked = 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!!, originalQuantity = sales[position].pickedQuantity!!,
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(), code = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
vBuyFk = originalItemScan!!, buyFk = originalItemScan!!,
vIsScanned = isScanned isScanned = isScanned
) )
@ -1625,13 +1625,13 @@ class CollectionFragmentPicker(
viewModel.run { viewModel.run {
saleTracking_mark( saleTracking_mark(
saleFk = sales[position].saleFk, 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", isChecked = 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!!, originalQuantity = sales[position].pickedQuantity!!,
vStateFk = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(), code = if (type == CONTROLADOR) "CHECKED" else if (type == "PRECHECKER") "PREVIOUS_CONTROL" else type,//type.toString(),
vBuyFk = originalItemScan!!, buyFk = originalItemScan!!,
vItemShelvingFk = itemShelvingTracking_mark, itemShelvingFk = itemShelvingTracking_mark,
vQuantity = customDialogList.getValue().toInt(), quantity = customDialogList.getValue().toInt(),
vIsScanned = isScanned isScanned = isScanned
) )
} }

View File

@ -13,6 +13,7 @@ import es.verdnatura.presentation.base.getMessageFromAllResponse
import es.verdnatura.presentation.base.nameofFunction import es.verdnatura.presentation.base.nameofFunction
import es.verdnatura.presentation.common.Event import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.common.ResponseItemVO 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.ItemVO
import es.verdnatura.presentation.view.feature.collection.SalesModifiedList import es.verdnatura.presentation.view.feature.collection.SalesModifiedList
import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity import es.verdnatura.presentation.view.feature.collection.SalixSaleQuantity
@ -87,7 +88,6 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
val responseItemShelvingSale: LiveData<ResponseItemVO> val responseItemShelvingSale: LiveData<ResponseItemVO>
get() = _responseItemShelvingSale get() = _responseItemShelvingSale
private val _responseItemShelvingSaleUnPicked by lazy { MutableLiveData<ResponseItemVO>() } private val _responseItemShelvingSaleUnPicked by lazy { MutableLiveData<ResponseItemVO>() }
val responseItemShelvingSaleUnPicked: LiveData<ResponseItemVO> val responseItemShelvingSaleUnPicked: LiveData<ResponseItemVO>
get() = _responseItemShelvingSaleUnPicked get() = _responseItemShelvingSaleUnPicked
@ -132,6 +132,10 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
val responseSaleGroup: LiveData<ResponseItemVO> val responseSaleGroup: LiveData<ResponseItemVO>
get() = _responseSaleGroup get() = _responseSaleGroup
private val _responseItemShelvingSaleGroup by lazy { MutableLiveData<ResponseItemVO>() }
val responseItemShelvingSaleGroup: LiveData<ResponseItemVO>
get() = _responseItemShelvingSaleGroup
private val _responsecheckfully by lazy { MutableLiveData<ResponseItemVO>() } private val _responsecheckfully by lazy { MutableLiveData<ResponseItemVO>() }
val responsecheckfully: LiveData<ResponseItemVO> val responsecheckfully: LiveData<ResponseItemVO>
get() = _responsecheckfully get() = _responsecheckfully
@ -274,7 +278,8 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
collectionFk, collectionFk,
sectorFk, sectorFk,
print, print,
type) type
)
.enqueue(object : .enqueue(object :
SalixCallback<CollectionVO>(context) { SalixCallback<CollectionVO>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
@ -305,20 +310,24 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
fun saleTrackingReplace( fun saleTrackingReplace(
saleFk: Int, saleFk: Int,
vOriginalQuantity: Int, originalQuantity: Int,
vStateFk: String, code: String,
vIsChecked: String, isChecked: String,
vBuyFk: Long, buyFk: Long,
vIsScanned: Boolean? isScanned: Boolean?
) { ) {
silex.saleTrackingReplace( salix.saleTrackingUpdate(SaleTrackingReplaceSalix(
saleFk,originalQuantity,code, isChecked != "0",buyFk,isScanned!!
))
/*silex.saleTrackingReplace(
saleFk, saleFk,
vOriginalQuantity, originalQuantity,
vStateFk, code,
vIsChecked != "0", isChecked != "0",
vBuyFk, buyFk,
vIsScanned!! isScanned!!
).enqueue(object : SilexCallback<Any>(context) { )*/
.enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
_responseSaleReplace.value = ResponseItemVO( _responseSaleReplace.value = ResponseItemVO(
isError = true, isError = true,
@ -334,23 +343,34 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
fun saleTracking_mark( fun saleTracking_mark(
saleFk: Int, saleFk: Int,
vOriginalQuantity: Int, originalQuantity: Int,
vStateFk: String, code: String,
vIsChecked: String, isChecked: String,
vBuyFk: Long, buyFk: Long,
vItemShelvingFk: Int, itemShelvingFk: Int,
vQuantity: Int, quantity: Int,
vIsScanned: Boolean? isScanned: Boolean?
) { ) {
//Tarea 6276 flata probar
/* salix.saleTrackingMark(
SaleTrackingSalix(saleFk,
originalQuantity,
code,
isChecked!="0",
buyFk,
itemShelvingFk = itemShelvingFk,
quantity = quantity,
isScanned = isScanned)
)*/
silex.saleTracking_mark( silex.saleTracking_mark(
saleFk, saleFk,
vOriginalQuantity, originalQuantity,
vStateFk, code,
vIsChecked != "0", isChecked != "0",
vBuyFk, buyFk,
vItemShelvingFk, itemShelvingFk,
vQuantity, quantity,
vIsScanned isScanned
).enqueue(object : SilexCallback<Any>(context) { ).enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
_responseSaleTracking_mark.value = ResponseItemVO( _responseSaleTracking_mark.value = ResponseItemVO(
@ -381,7 +401,8 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
quantity: Int, quantity: Int,
isItemShelvingSaleEmpty: Boolean? isItemShelvingSaleEmpty: Boolean?
) { ) {
salix.itemShelvingSaleSetquantitySalix(params = arrayListOf(itemShelvingSaleFk,quantity,isItemShelvingSaleEmpty) salix.itemShelvingSaleSetquantitySalix(
params = arrayListOf(itemShelvingSaleFk, quantity, isItemShelvingSaleEmpty)
//salix.itemShelvingSaleSetQuantity( //salix.itemShelvingSaleSetQuantity(
// params = ItemShelvingSaleSalix(itemShelvingSaleFk, quantity, isItemShelvingSaleEmpty) // params = ItemShelvingSaleSalix(itemShelvingSaleFk, quantity, isItemShelvingSaleEmpty)
).enqueue(object : SilexCallback<Any>(context) { ).enqueue(object : SilexCallback<Any>(context) {
@ -416,18 +437,18 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
) { ) {
salix.collectionAddWithReservation( salix.collectionAddWithReservation(
params = arrayListOf(item, quantity, ticketSelected) params = arrayListOf(item, quantity, ticketSelected)
).enqueue(object : SilexCallback<Any>(context) { ).enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) { override fun onSuccess(response: Response<Any>) {
_responseCollectionAddItem.value = _responseCollectionAddItem.value =
ResponseItemVO(isError = false, response = "") ResponseItemVO(isError = false, response = "")
} }
override fun onError(t: Throwable) { /* override fun onError(t: Throwable) {
_responseCollectionAddItem.value = ResponseItemVO( _responseCollectionAddItem.value = ResponseItemVO(
isError = true, isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!) 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( fun collectionAddItem(
itemFk: Int, itemFk: Int,
quantityFk: Int, quantityFk: Int,
ticketFk: Int, ticketFk: Int,
warehouseFk: Int warehouseFk: Int
) { ) {
//Tarea 6276
//salix.collectionAddItem(CollectionItemSalix(itemFk,quantityFk,ticketFk,warehouseFk))
silex.collectionAddItem( silex.collectionAddItem(
itemFk, itemFk,
quantityFk, quantityFk,
ticketFk, ticketFk,
warehouseFk warehouseFk
).enqueue(object : SilexCallback<Any>(context) { )
.enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
_responseNew.value = ResponseItemVO( _responseNew.value = ResponseItemVO(
@ -706,6 +751,7 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
} }
fun saleTrackingDel(saleFk: Int) { fun saleTrackingDel(saleFk: Int) {
//salix.saleTrackingDel(SaleTrackingDelSalix(saleFk = saleFk, stateCodes = listOf("CHECKED","OK","PREPARED")))
silex.saleTrackingDel(saleFk) silex.saleTrackingDel(saleFk)
.enqueue(object : SilexCallback<Any>(context) { .enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
@ -723,12 +769,11 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
} }
fun itemShelving_updateFromSale( fun itemShelving_updateFromSale(
itemShelvingFk: Int saleFk: Int
) { ) {
silex.itemShelving_updateFromSale( //Tarea 6276
itemShelvingFk //salix.itemShelvingUpdateFromSale(hashMapOf("saleFk" to saleFk))
silex.itemShelving_updateFromSale(saleFk)
)
.enqueue(object : SilexCallback<Any>(context) { .enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
_responseItemShelvingUpdate.value = ResponseItemVO( _responseItemShelvingUpdate.value = ResponseItemVO(

View File

@ -42,6 +42,8 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
fun machineWorker_add( fun machineWorker_add(
PlateNumber: String PlateNumber: String
) { ) {
//tarea 6276
// salix.machineWorkerUpdateInTime()
silex.machineWorker_add(PlateNumber) silex.machineWorker_add(PlateNumber)
.enqueue(object : SilexCallback<Any>(context) { .enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
@ -79,10 +81,11 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
} }
fun machineWorker_update( fun machineWorker_update(
plate: String
PlateNumber: String
) { ) {
silex.machineWorker_update(PlateNumber) //Tarea 6276
//salix.machineWorkerUpdateInTime(plate)
silex.machineWorker_update(plate)
.enqueue(object : SilexCallback<Any>(context) { .enqueue(object : SilexCallback<Any>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
_responseinsert.value = ResponseItemVO( _responseinsert.value = ResponseItemVO(
@ -106,7 +109,7 @@ class ControlVehiculoViewModel(val context: Context) : BaseViewModel(context) {
} else { } else {
_responseinsert.value = _responseinsert.value =
ResponseItemVO(isError = false, response = response.body()!!.toString()) ResponseItemVO(isError = false, response = "")
} }

View File

@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.paletizador.fragment
import android.content.Context import android.content.Context
import androidx.lifecycle.LiveData import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.SalixCallback
import es.verdnatura.domain.SilexCallback import es.verdnatura.domain.SilexCallback
import es.verdnatura.domain.formatWithQuotes import es.verdnatura.domain.formatWithQuotes
import es.verdnatura.presentation.base.BaseViewModel import es.verdnatura.presentation.base.BaseViewModel
@ -52,8 +53,10 @@ class PalletScanViewModel(val context: Context) : BaseViewModel(context) {
} }
fun expeditionPallet_get(vPalletId: Int) { fun expeditionPallet_get(vPalletId: Int) {
//Tarea 6276
//salix.expeditionPalletGetPallet(vPalletId)
silex.expeditionPallet_get(vPalletId) silex.expeditionPallet_get(vPalletId)
.enqueue(object : SilexCallback<ItemExpeditionTruckVO>(context) { .enqueue(object : SalixCallback<ItemExpeditionTruckVO>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
_responsePalletGet.value = ItemExpeditionTruckVO( _responsePalletGet.value = ItemExpeditionTruckVO(

View File

@ -461,7 +461,7 @@ class EndSacadorFragment(
binding.splashProgress.visibility = VISIBLE binding.splashProgress.visibility = VISIBLE
viewModel.sectorCollection_getSale( viewModel.sectorCollection_getSale(
collection.collectionFk, collection.collectionFk,
vSectorFk = getDataInt(SECTORFK) sectorFk = getDataInt(SECTORFK)
) )
} }

View File

@ -384,11 +384,13 @@ class PreSacadorViewModel(val context: Context) : BaseViewModel(context) {
fun sectorCollection_getSale( fun sectorCollection_getSale(
sectorCollectionFK: Int, sectorCollectionFK: Int,
vSectorFk: Int sectorFk: Int
) { ) {
//Tarea 6276
//salix.sectorCollectionGetSale(sectorCollectionFK, sectorFk)
silex.sectorCollection_getSale( silex.sectorCollection_getSale(
sectorCollectionFK, sectorCollectionFK,
vSectorFk.toString() sectorFk.toString()
) )
.enqueue(object : .enqueue(object :
SilexCallback<List<PreSacadorItemVO>>(context) { SilexCallback<List<PreSacadorItemVO>>(context) {

View File

@ -135,7 +135,10 @@ class SacadorViewModel(val context: Context) : BaseViewModel(context) {
} }
fun collection_assign() { fun collection_assign() {
silex.collection_assign().enqueue( //Tarea 6276
//salix.collectionAssign()
silex.collection_assign()
.enqueue(
object : object :
SilexCallback<Int>(context) { SilexCallback<Int>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {

View File

@ -18,7 +18,10 @@ class ShowTicketViewModel(val context: Context) : BaseViewModel(context) {
get() = _collectionTicketList get() = _collectionTicketList
fun collectionTicketGet(collectionFk: Int, sectorFk: Int, print: String, type: String) { 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) { SilexCallback<CollectionVO>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {
_collectionTicketList.value = CollectionVO( _collectionTicketList.value = CollectionVO(

View File

@ -117,7 +117,7 @@ class AutomaticAddItemFragment(
getDataInt(WAREHOUSEFK) getDataInt(WAREHOUSEFK)
) )
} else { } else {
viewModel.itemShelvingMake_multi( viewModel.itemShelvingMakeMulti(
shelvingFk, shelvingFk,
listString, listString,
getDataInt(WAREHOUSEFK) getDataInt(WAREHOUSEFK)

View File

@ -120,7 +120,7 @@ class AutomaticAddItemFragmentTEST(
) )
} else { } else {
viewModel.itemShelvingMake_multi( viewModel.itemShelvingMakeMulti(
shelvingFk, shelvingFk,
listString, listString,
getDataInt(WAREHOUSEFK) getDataInt(WAREHOUSEFK)

View File

@ -18,12 +18,14 @@ class AutomaticAddItemViewModel(val context: Context) : BaseViewModel(context) {
val response: LiveData<ResponseItemVO> val response: LiveData<ResponseItemVO>
get() = _response get() = _response
fun itemShelvingMake_multi( fun itemShelvingMakeMulti(
shelving: String, shelvingFk: String,
items: List<Long>, 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 : .enqueue(object :
SilexCallback<Any>(context) { SilexCallback<Any>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {

View File

@ -630,13 +630,8 @@ class UbicadorFragment(
}) })
responseLog.observe(viewLifecycleOwner, Observer { responseLog.observe(viewLifecycleOwner, Observer {
if (it.isError) { if (!it.isError) {
ma.messageWithSound(it.errorMessage, it.isError, false)
} else {
isShelvinLogfromMainScreen = false isShelvinLogfromMainScreen = false
} }
}) })
loadResponseCode.observe(viewLifecycleOwner) { event -> loadResponseCode.observe(viewLifecycleOwner) { event ->

View File

@ -280,14 +280,10 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
fun shelvinLog_add( fun shelvinLog_add(
code: String code: String
) { ) {
//Tarea 6276
// salix.shelvingLogAdd(hashMapOf("code" to code))
silex.shelvingLog_add(code) silex.shelvingLog_add(code)
.enqueue(object : SilexCallback<Any>(context) { .enqueue(object : SalixCallback<Any>(context) {
override fun onError(t: Throwable) {
_responseLog.value = ResponseItemVO(
isError = true,
errorMessage = getMessageFromAllResponse(nameofFunction(this), t.message!!)
)
}
override fun onSuccess(response: Response<Any>) { override fun onSuccess(response: Response<Any>) {
_responseLog.value = _responseLog.value =
@ -301,6 +297,8 @@ class UbicadorViewModel(val context: Context) : BaseViewModel(context) {
shelvingFk: String, shelvingFk: String,
) { ) {
//Tarea 6273
// salix.itemShelvingReturn(shelvingFk)
silex.itemShelving_return(shelvingFk) silex.itemShelving_return(shelvingFk)
.enqueue(object : SilexCallback<ArrayList<Reubication>>(context) { .enqueue(object : SilexCallback<ArrayList<Reubication>>(context) {
override fun onError(t: Throwable) { override fun onError(t: Throwable) {