feat: refs #7926 parkingSaleGroup

This commit is contained in:
Sergio De la torre 2024-09-18 13:06:46 +02:00
parent 3e25daa75c
commit 2246c21986
3 changed files with 28 additions and 9 deletions

View File

@ -44,7 +44,6 @@ import es.verdnatura.presentation.view.feature.login.model.NameWorker
import es.verdnatura.presentation.view.feature.login.model.OperatorAdd import es.verdnatura.presentation.view.feature.login.model.OperatorAdd
import es.verdnatura.presentation.view.feature.login.model.OperatorSalix 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.VersionApp 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
@ -67,6 +66,7 @@ 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
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
import es.verdnatura.presentation.view.feature.sacador.model.TicketStateSalix import es.verdnatura.presentation.view.feature.sacador.model.TicketStateSalix
import es.verdnatura.presentation.view.feature.ubicador.model.ItemBuy
import es.verdnatura.presentation.view.feature.ubicador.model.ItemShelvingNewer import es.verdnatura.presentation.view.feature.ubicador.model.ItemShelvingNewer
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
@ -931,6 +931,11 @@ interface SalixService {
@Path("id") id: Number, @Body params: Any @Path("id") id: Number, @Body params: Any
): Call<ItemUbicador?> ): Call<ItemUbicador?>
@GET("Buys/{id}")
fun getInfoFromBuyId(
@Path("id") id: Number
): Call<ItemBuy>
@POST("ItemShelvings/update") @POST("ItemShelvings/update")
fun itemShelvingsUpdate( fun itemShelvingsUpdate(
@Query("where") where: Any, @Body params: Any @Query("where") where: Any, @Body params: Any
@ -1013,14 +1018,12 @@ interface SalixService {
@GET("Trains") @GET("Trains")
fun getTrain( fun getTrain(
): Call<List<Train>> ): Call<List<Train>>
@PATCH("SaleGroups/{id}")
fun saleGroupUpdate(
@Path("id") id: Number,
@Body params: Any
): Call<Any>
} }
interface SalixServiceSend {
@POST("chats/send")
fun sendGroup(
@Body params: SalixGrupo
): Call<Boolean>
}

View File

@ -546,6 +546,7 @@ class CollectionFragmentPicker(
ma.messageWithSound(it.errorMessage, true, true) ma.messageWithSound(it.errorMessage, true, true)
} else { } else {
ma.messageWithSound(getString(R.string.previousCollected), false, true) ma.messageWithSound(getString(R.string.previousCollected), false, true)
viewModel.collectionTicketGet( viewModel.collectionTicketGet(
collection.collectionFk, collection.collectionFk,
mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK), mobileApplication.dataStoreApp.readDataStoreKey(SECTORFK),

View File

@ -591,11 +591,26 @@ class CollectionViewModel(val context: Context) : BaseViewModel(context) {
} }
override fun onSuccess(response: Response<Unit>) { override fun onSuccess(response: Response<Unit>) {
//Tarea 7926
updateParkingFromSaleGroup(saleGroupFk)
_responseSaleGroup.value = ResponseItemVO(isError = false) _responseSaleGroup.value = ResponseItemVO(isError = false)
} }
}) })
} }
fun updateParkingFromSaleGroup(
saleGroupFk: Number
) {
salix.saleGroupUpdate(
id = saleGroupFk,
params = hashMapOf("parkingFk" to null)
)
.enqueue(object : SalixCallback<Any>(context) {
override fun onSuccess(response: Response<Any>) {
}
})
}
fun itemShelvingSaleSetSaleGroup( fun itemShelvingSaleSetSaleGroup(
saleGroupFk: Int saleGroupFk: Int
) { ) {