feat: 板箱过磅
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
package com.lukouguoji.gjc.activity
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.lukouguoji.gjc.R
|
||||
import com.lukouguoji.gjc.databinding.ActivityGjcBoxWeighingBinding
|
||||
import com.lukouguoji.gjc.viewModel.GjcBoxWeighingViewModel
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.common.ConstantEvent
|
||||
import com.lukouguoji.module_base.impl.FlowBus
|
||||
import com.lukouguoji.module_base.impl.observe
|
||||
import com.lukouguoji.module_base.ktx.getLifecycleOwner
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
|
||||
/**
|
||||
* 国际出港板箱过磅列表页
|
||||
*/
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_BOX_WEIGHING)
|
||||
class GjcBoxWeighingActivity :
|
||||
BaseBindingActivity<ActivityGjcBoxWeighingBinding, GjcBoxWeighingViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_gjc_box_weighing
|
||||
|
||||
override fun viewModelClass() = GjcBoxWeighingViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("板箱过磅")
|
||||
|
||||
binding.viewModel = viewModel
|
||||
|
||||
// 绑定分页逻辑
|
||||
viewModel.pageModel
|
||||
.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, getLifecycleOwner())
|
||||
|
||||
// 监听刷新事件
|
||||
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH)
|
||||
.observe(this) {
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
// 初始加载
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
val starter = Intent(context, GjcBoxWeighingActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.lukouguoji.gjc.activity
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.gjc.R
|
||||
import com.lukouguoji.gjc.databinding.ActivityGjcBoxWeighingAddBinding
|
||||
import com.lukouguoji.gjc.viewModel.GjcBoxWeighingAddViewModel
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
|
||||
/**
|
||||
* 国际出港板箱过磅添加页面
|
||||
*/
|
||||
class GjcBoxWeighingAddActivity :
|
||||
BaseBindingActivity<ActivityGjcBoxWeighingAddBinding, GjcBoxWeighingAddViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_gjc_box_weighing_add
|
||||
|
||||
override fun viewModelClass() = GjcBoxWeighingAddViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("板箱过磅")
|
||||
binding.viewModel = viewModel
|
||||
viewModel.initOnCreated(this)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun startForAdd(context: Context) {
|
||||
val starter = Intent(context, GjcBoxWeighingAddActivity::class.java)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.lukouguoji.gjc.activity
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.lukouguoji.gjc.R
|
||||
import com.lukouguoji.gjc.databinding.ActivityGjcBoxWeighingDetailsBinding
|
||||
import com.lukouguoji.gjc.viewModel.GjcBoxWeighingDetailsViewModel
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
|
||||
/**
|
||||
* 国际出港板箱过磅详情页
|
||||
*/
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_GJC_BOX_WEIGHING_DETAILS)
|
||||
class GjcBoxWeighingDetailsActivity :
|
||||
BaseBindingActivity<ActivityGjcBoxWeighingDetailsBinding, GjcBoxWeighingDetailsViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_gjc_box_weighing_details
|
||||
|
||||
override fun viewModelClass() = GjcBoxWeighingDetailsViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("板箱过磅详情")
|
||||
|
||||
binding.viewModel = viewModel
|
||||
|
||||
// 初始化数据(从Intent获取参数)
|
||||
viewModel.initOnCreated(intent)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, useId: Long) {
|
||||
val starter = Intent(context, GjcBoxWeighingDetailsActivity::class.java)
|
||||
.putExtra(Constant.Key.ID, useId)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.lukouguoji.gjc.holder
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.gjc.activity.GjcBoxWeighingDetailsActivity
|
||||
import com.lukouguoji.gjc.databinding.ItemGjcBoxWeighingBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.GjcUldUseBean
|
||||
|
||||
/**
|
||||
* 国际出港板箱过磅列表 ViewHolder
|
||||
*/
|
||||
class GjcBoxWeighingViewHolder(view: View) :
|
||||
BaseViewHolder<GjcUldUseBean, ItemGjcBoxWeighingBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val bean = getItemBean(item)!!
|
||||
binding.bean = bean
|
||||
|
||||
// 整行点击跳转到详情页
|
||||
binding.ll.setOnClickListener {
|
||||
GjcBoxWeighingDetailsActivity.start(it.context, bean.useId)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
package com.lukouguoji.gjc.viewModel
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.GjcUldUseBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.common.ConstantEvent
|
||||
import com.lukouguoji.module_base.http.net.DiBangWeightModel
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.impl.FlowBus
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
import com.lukouguoji.module_base.ktx.getActivity
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.noNull
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
|
||||
import com.lukouguoji.module_base.model.ScanModel
|
||||
import com.lukouguoji.module_base.util.Common
|
||||
import com.lukouguoji.module_base.util.DictUtils
|
||||
import dev.utils.app.info.KeyValue
|
||||
import kotlinx.coroutines.launch
|
||||
import java.util.Calendar
|
||||
import java.util.Date
|
||||
|
||||
/**
|
||||
* 国际出港板箱过磅添加 ViewModel
|
||||
*/
|
||||
class GjcBoxWeighingAddViewModel : BaseViewModel() {
|
||||
|
||||
// 数据Bean
|
||||
val dataBean = MutableLiveData(GjcUldUseBean())
|
||||
|
||||
// 地磅集成 - 暂时注释
|
||||
// val diBangModel = DiBangWeightModel()
|
||||
val channel = MutableLiveData("") // 通道号(用于控制地磅key)
|
||||
|
||||
// 计算字段显示
|
||||
val totalWeight = MutableLiveData("0") // 总重(红色)
|
||||
val netWeight = MutableLiveData("0") // 装机重(蓝色)
|
||||
val cargoWeight = MutableLiveData("0") // 货重(绿色)
|
||||
|
||||
// 下拉选择数据源
|
||||
val passagewayList = MutableLiveData<List<KeyValue>>() // 通道号列表
|
||||
val piCloseList = MutableLiveData<List<KeyValue>>() // 探板收口列表
|
||||
|
||||
// 打印挂签
|
||||
val printTag = MutableLiveData(false)
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
fun initOnCreated(activity: Activity) {
|
||||
// 监听地磅重量变化 - 暂时注释
|
||||
// diBangModel.weight.observe(activity as LifecycleOwner) { weight ->
|
||||
// val w = weight?.toDoubleOrNull() ?: 0.0
|
||||
// totalWeight.value = w.toString()
|
||||
// dataBean.value?.totalWeight = w
|
||||
// // 实时计算装机重和货重
|
||||
// calculateWeights()
|
||||
// }
|
||||
|
||||
// 监听通道号变化,设置地磅的key - 暂时注释
|
||||
// channel.observe(activity as LifecycleOwner) {
|
||||
// diBangModel.key = it ?: ""
|
||||
// }
|
||||
|
||||
// 加载下拉列表数据
|
||||
loadPassagewayList()
|
||||
loadPiCloseList()
|
||||
|
||||
// 初始化航班日期为今天
|
||||
dataBean.value?.fdate = Date().formatDate()
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载通道号列表
|
||||
*/
|
||||
private fun loadPassagewayList() {
|
||||
DictUtils.getChannelList {
|
||||
passagewayList.value = it
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载探板收口列表
|
||||
*/
|
||||
private fun loadPiCloseList() {
|
||||
// 探板收口选项(是/否)
|
||||
piCloseList.value = listOf(
|
||||
KeyValue("1", "是"),
|
||||
KeyValue("0", "否")
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算重量字段
|
||||
* 装机重 = 总重 - 架子车自重
|
||||
* 货重 = 装机重 - ULD自重
|
||||
*/
|
||||
private fun calculateWeights() {
|
||||
val total = totalWeight.value?.toDoubleOrNull() ?: 0.0
|
||||
val carW = dataBean.value?.carWeight ?: 0.0
|
||||
val uldW = dataBean.value?.uldWeight ?: 0.0
|
||||
|
||||
val net = total - carW
|
||||
val cargo = net - uldW
|
||||
|
||||
netWeight.value = if (net > 0) net.toString() else "0"
|
||||
cargoWeight.value = if (cargo > 0) cargo.toString() else "0"
|
||||
|
||||
dataBean.value?.netWeight = if (net > 0) net else 0.0
|
||||
dataBean.value?.cargoWeight = if (cargo > 0) cargo else 0.0
|
||||
}
|
||||
|
||||
/**
|
||||
* 航班日期点击
|
||||
*/
|
||||
fun flightDateClick(view: View) {
|
||||
Common.onYearMonthDay(view.context.getActivity(), dataBean.value?.fdate) { year, month, day ->
|
||||
val calendar = Calendar.getInstance()
|
||||
calendar.set(year, month - 1, day)
|
||||
val date = calendar.time.formatDate()
|
||||
dataBean.value = dataBean.value?.apply { fdate = date }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ULD编号扫码
|
||||
*/
|
||||
fun uldScanClick() {
|
||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.ULD)
|
||||
}
|
||||
|
||||
/**
|
||||
* 架子车号扫码
|
||||
*/
|
||||
fun carIdScanClick() {
|
||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.CAR)
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置按钮点击
|
||||
*/
|
||||
fun resetClick() {
|
||||
dataBean.value = GjcUldUseBean().apply {
|
||||
fdate = Date().formatDate()
|
||||
}
|
||||
totalWeight.value = "0"
|
||||
netWeight.value = "0"
|
||||
cargoWeight.value = "0"
|
||||
channel.value = ""
|
||||
printTag.value = false
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击
|
||||
*/
|
||||
fun confirmClick() {
|
||||
val bean = dataBean.value ?: return
|
||||
|
||||
// 验证必填字段
|
||||
if (bean.carId.verifyNullOrEmpty("请输入架子车号")) return
|
||||
if (bean.uld.verifyNullOrEmpty("请输入ULD编号")) return
|
||||
|
||||
// 提交数据
|
||||
val params = mapOf(
|
||||
"carId" to bean.carId,
|
||||
"passageway" to bean.passageway,
|
||||
"uld" to bean.uld,
|
||||
"dgrCode" to bean.dgrCode,
|
||||
"boardType" to bean.boardType,
|
||||
"height" to bean.height,
|
||||
"piClose" to bean.piClose,
|
||||
"piCloseSize" to bean.piCloseSize,
|
||||
"carWeight" to bean.carWeight,
|
||||
"uldWeight" to bean.uldWeight,
|
||||
"fdate" to bean.fdate,
|
||||
"fno" to bean.fno,
|
||||
"fdest" to bean.fdest,
|
||||
"remark" to bean.remark,
|
||||
"totalWeight" to bean.totalWeight,
|
||||
"netWeight" to bean.netWeight,
|
||||
"cargoWeight" to bean.cargoWeight,
|
||||
"printTag" to printTag.value
|
||||
).toRequestBody(removeEmptyOrNull = true)
|
||||
|
||||
launchLoadingCollect({
|
||||
NetApply.api.submitGjcBoxWeighing(params)
|
||||
}) {
|
||||
onSuccess = { result ->
|
||||
if (result.verifySuccess()) {
|
||||
showToast("添加成功")
|
||||
// 发送刷新事件
|
||||
viewModelScope.launch {
|
||||
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).emit("refresh")
|
||||
}
|
||||
getTopActivity().finish()
|
||||
} else {
|
||||
showToast(result.msg.noNull("添加失败"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理扫码结果
|
||||
*/
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||
val content = data.getStringExtra(Constant.Result.CODED_CONTENT).noNull()
|
||||
when (requestCode) {
|
||||
Constant.RequestCode.ULD -> {
|
||||
dataBean.value = dataBean.value?.apply { uld = content }
|
||||
}
|
||||
Constant.RequestCode.CAR -> {
|
||||
dataBean.value = dataBean.value?.apply { carId = content }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理资源
|
||||
*/
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
// diBangModel.cancelLooperGet() // 暂时注释
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.lukouguoji.gjc.viewModel
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.GjcUldUseBean
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.showToast
|
||||
|
||||
/**
|
||||
* 国际出港板箱过磅详情 ViewModel
|
||||
*/
|
||||
class GjcBoxWeighingDetailsViewModel : BaseViewModel() {
|
||||
|
||||
// 主键ID(从Intent接收)
|
||||
var useId: Long = 0
|
||||
|
||||
// 详情数据
|
||||
val dataBean = MutableLiveData(GjcUldUseBean())
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
fun initOnCreated(intent: Intent) {
|
||||
useId = intent.getLongExtra(Constant.Key.ID, 0)
|
||||
if (useId > 0) {
|
||||
getData()
|
||||
} else {
|
||||
showToast("参数错误")
|
||||
getTopActivity().finish()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取详情数据
|
||||
*/
|
||||
private fun getData() {
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGjcBoxWeighingDetails(useId)
|
||||
}) {
|
||||
onSuccess = {
|
||||
dataBean.value = it.data ?: GjcUldUseBean()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package com.lukouguoji.gjc.viewModel
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.gjc.R
|
||||
import com.lukouguoji.gjc.holder.GjcBoxWeighingViewHolder
|
||||
import com.lukouguoji.module_base.base.BasePageViewModel
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.ktx.launchCollect
|
||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||
import com.lukouguoji.module_base.model.ScanModel
|
||||
|
||||
/**
|
||||
* 国际出港板箱过磅 ViewModel
|
||||
*/
|
||||
class GjcBoxWeighingViewModel : BasePageViewModel() {
|
||||
|
||||
// 搜索条件
|
||||
val flightDate = MutableLiveData("") // 航班日期
|
||||
val flightNo = MutableLiveData("") // 航班号
|
||||
val dest = MutableLiveData("") // 目的站
|
||||
val carId = MutableLiveData("") // 架子车号
|
||||
val uld = MutableLiveData("") // ULD编号
|
||||
|
||||
// 适配器配置
|
||||
val itemViewHolder = GjcBoxWeighingViewHolder::class.java
|
||||
val itemLayoutId = R.layout.item_gjc_box_weighing
|
||||
|
||||
// 统计数据
|
||||
val totalCount = MutableLiveData("0") // 合计票数
|
||||
val totalPc = MutableLiveData("0") // 总件数
|
||||
val totalWeight = MutableLiveData("0") // 总重量
|
||||
val cargoWeight = MutableLiveData("0") // 总货重
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 方法区
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* 扫码输入航班号
|
||||
*/
|
||||
fun flightNoScanClick() {
|
||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.FLIGHT_NO)
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫码输入架子车号
|
||||
*/
|
||||
fun carIdScanClick() {
|
||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.CAR)
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫码输入ULD编号
|
||||
*/
|
||||
fun uldScanClick() {
|
||||
ScanModel.startScan(getTopActivity(), Constant.RequestCode.ULD)
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索按钮点击
|
||||
*/
|
||||
fun searchClick() {
|
||||
refresh()
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加按钮点击
|
||||
*/
|
||||
fun addClick() {
|
||||
com.lukouguoji.gjc.activity.GjcBoxWeighingAddActivity.startForAdd(getTopActivity())
|
||||
}
|
||||
|
||||
/**
|
||||
* 挂签打印按钮点击
|
||||
*/
|
||||
fun printClick() {
|
||||
// TODO: 实现挂签打印功能
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表数据
|
||||
*/
|
||||
override fun getData() {
|
||||
// 构建查询参数(列表接口)
|
||||
val listParams = mapOf(
|
||||
"pageNum" to pageModel.page,
|
||||
"pageSize" to pageModel.limit,
|
||||
"fdate" to flightDate.value!!.ifEmpty { null },
|
||||
"fno" to flightNo.value!!.ifEmpty { null },
|
||||
"fdest" to dest.value!!.ifEmpty { null },
|
||||
"carId" to carId.value!!.ifEmpty { null },
|
||||
"uld" to uld.value!!.ifEmpty { null },
|
||||
).toRequestBody()
|
||||
|
||||
// 构建查询参数(统计接口 - 使用相同的搜索条件)
|
||||
val totalParams = mapOf(
|
||||
"fdate" to flightDate.value!!.ifEmpty { null },
|
||||
"fno" to flightNo.value!!.ifEmpty { null },
|
||||
"fdest" to dest.value!!.ifEmpty { null },
|
||||
"carId" to carId.value!!.ifEmpty { null },
|
||||
"uld" to uld.value!!.ifEmpty { null },
|
||||
).toRequestBody()
|
||||
|
||||
// 获取列表数据(显示loading)
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGjcBoxWeighingList(listParams)
|
||||
}) {
|
||||
onSuccess = {
|
||||
pageModel.handleListBean(it)
|
||||
}
|
||||
}
|
||||
|
||||
// 获取统计数据(后台调用,不显示loading)
|
||||
launchCollect({
|
||||
NetApply.api.getGjcBoxWeighingStatistics(totalParams)
|
||||
}) {
|
||||
onSuccess = { result ->
|
||||
val data = result.data
|
||||
totalCount.value = (data?.wbNumber ?: 0).toString()
|
||||
totalPc.value = (data?.totalPc ?: 0).toString()
|
||||
totalWeight.value = (data?.totalWeight ?: 0.0).toString()
|
||||
cargoWeight.value = (data?.cargoWeight ?: 0.0).toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理扫码结果
|
||||
*/
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||
when (requestCode) {
|
||||
Constant.RequestCode.FLIGHT_NO -> {
|
||||
flightNo.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
|
||||
refresh()
|
||||
}
|
||||
Constant.RequestCode.CAR -> {
|
||||
carId.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
|
||||
refresh()
|
||||
}
|
||||
Constant.RequestCode.ULD -> {
|
||||
uld.value = data.getStringExtra(Constant.Result.CODED_CONTENT)
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user