refs #6028 silex→salix

This commit is contained in:
Sergio De la torre 2023-12-05 12:34:21 +01:00
parent e1f3eafcaf
commit 642ed4c283
5 changed files with 17 additions and 15 deletions

View File

@ -11,7 +11,7 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 238,
"versionCode": 239,
"versionName": "23.48Beta",
"outputFile": "app-beta-release.apk"
}

View File

@ -124,6 +124,10 @@ interface SalixService {
@Query("filter") filter: Any,
): Call<MutableList<ClientTicket>>
@GET("Routes/getByWorker")
fun getRoutes(
): Call<MutableList<RouteInfo>>
@POST("Applications/{routine}/execute-proc")
fun executeProc(

View File

@ -33,7 +33,6 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.util.Date
class RoutesFragment(
var title: String = ""
) : BaseFragment<FragmentRouteBinding, DeliveryViewModel>(
@ -64,7 +63,6 @@ class RoutesFragment(
}
private fun pendingOperations() {
db = database(requireContext().applicationContext)
if (mobileApplication.hasNetwork) {
@ -129,13 +127,11 @@ class RoutesFragment(
}
}
private fun callBack(callBackEndPoint: Unit) {
binding.splashProgress.visibility = View.VISIBLE
return callBackEndPoint
}
@RequiresApi(Build.VERSION_CODES.O)
private fun setToolBar() {
ma.hideBottomNavigation(View.GONE)
@ -229,10 +225,8 @@ class RoutesFragment(
getString(R.string.deliveryApp).toast(context)
}
}
private fun setEvents() {
binding.mainToolbar.backButton.setOnClickListener {
requireActivity().onBackPressed()
@ -265,7 +259,6 @@ class RoutesFragment(
adapter!!.updateList(filteredList)
}
@RequiresApi(Build.VERSION_CODES.O)
override fun observeViewModel() {
with(viewModel) {
@ -319,10 +312,8 @@ class RoutesFragment(
}
private fun createListRoutes(list: MutableList<RouteInfo>, getSaved: Boolean = false) {
lifecycleScope.launch {
withContext(Dispatchers.IO) {
@ -353,8 +344,6 @@ class RoutesFragment(
}
"showTickets" -> {
//println("La ruta de los tickets es: " + item.id)
//openAppDelivery(item)
ma.onPasillerosItemClickListener(
PasillerosItemVO(title = getString(R.string.tickets)),
Gson().toJson(item)
@ -364,7 +353,11 @@ class RoutesFragment(
}
}, myListRouteLoaded
}, if (::myListRouteLoaded.isInitialized) {
myListRouteLoaded
} else {
listOf()
}
)
binding.routeRecyclerview.addItemDecoration(
@ -385,7 +378,6 @@ class RoutesFragment(
}
}
private fun setListPosition(list: MutableList<ExpeditionInfoLoadUnload>) {
for (i in list.indices) {
binding.routeRecyclerview.scrollToPosition(i)

View File

@ -3,6 +3,7 @@ package es.verdnatura.presentation.view.feature.delivery.model
import androidx.room.Entity
import androidx.room.PrimaryKey
import androidx.room.TypeConverters
import com.google.gson.annotations.SerializedName
import es.verdnatura.db.MapTypeConverter
import java.io.Serializable
import java.text.SimpleDateFormat
@ -142,11 +143,14 @@ class RouteLoaded(
@Entity(tableName = "routes")
class RouteInfo(
@PrimaryKey var id: Long,
@SerializedName(value = "driver", alternate = ["workerUserName"])
var driver: String,
var hour: String?,
@TypeConverters(MapTypeConverter::class) var created: Date,
var m3: Double,
@SerializedName(value = "numberPlate", alternate = ["vehiclePlateNumber"])
var numberPlate: String?,
@SerializedName(value = "name", alternate = ["agencyName"])
var name: String,
var kmStart: Long,
var kmEnd: Long,

View File

@ -328,6 +328,8 @@ class DeliveryViewModel(val context: Context) : BaseViewModel(context) {
fun getRoutes(
workerFk: Int
) {
//Redmine 6028 falta que le pongan el email y PR
//salix.getRoutes()
silex.getRoutes(workerFk)
.enqueue(object : SilexCallback<MutableList<RouteInfo>>(context) {