feat: passageWay for api
This commit is contained in:
@@ -71,6 +71,7 @@ data class GjcMaWb(
|
|||||||
// ==================== 车辆信息 ====================
|
// ==================== 车辆信息 ====================
|
||||||
var carId: String? = null, // 平板车号
|
var carId: String? = null, // 平板车号
|
||||||
var carNumber: String? = null, // 车牌号
|
var carNumber: String? = null, // 车牌号
|
||||||
|
var passageWay: String? = null, // 通道号
|
||||||
|
|
||||||
// ==================== 状态信息 ====================
|
// ==================== 状态信息 ====================
|
||||||
var checkIn: String? = null, // 收运状态。0:待收运,1:已收运,2:收运中
|
var checkIn: String? = null, // 收运状态。0:待收运,1:已收运,2:收运中
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class GjcWeighingRecordDetailsViewModel : BaseViewModel() {
|
|||||||
waybillBean.value = it
|
waybillBean.value = it
|
||||||
|
|
||||||
// 提取运单信息字段
|
// 提取运单信息字段
|
||||||
waybillNo.value = "${it.prefix}-${it.no}"
|
waybillNo.value = it.wbNo
|
||||||
prePc.value = it.pc.toString()
|
prePc.value = it.pc.toString()
|
||||||
preWeight.value = it.weight.toString()
|
preWeight.value = it.weight.toString()
|
||||||
goodsName.value = it.goodsCn
|
goodsName.value = it.goodsCn
|
||||||
@@ -136,7 +136,7 @@ class GjcWeighingRecordDetailsViewModel : BaseViewModel() {
|
|||||||
|
|
||||||
// 计算重量误差百分比
|
// 计算重量误差百分比
|
||||||
val preWeightValue = preWeight.value?.toDoubleOrNull() ?: 0.0
|
val preWeightValue = preWeight.value?.toDoubleOrNull() ?: 0.0
|
||||||
val error = if (preWeightValue > 0) {
|
val error = if (sumWeight > 0 && preWeightValue > 0) {
|
||||||
((sumWeight - preWeightValue) / preWeightValue * 100)
|
((sumWeight - preWeightValue) / preWeightValue * 100)
|
||||||
} else {
|
} else {
|
||||||
0.0
|
0.0
|
||||||
|
|||||||
@@ -262,9 +262,11 @@ class GjcWeighingStartViewModel : BaseViewModel() {
|
|||||||
arrivePc = this@GjcWeighingStartViewModel.arrivePc.value?.toLongOrNull() ?: arrivePc
|
arrivePc = this@GjcWeighingStartViewModel.arrivePc.value?.toLongOrNull() ?: arrivePc
|
||||||
arriveWeight = this@GjcWeighingStartViewModel.arriveWeight.value?.toDoubleOrNull() ?: arriveWeight
|
arriveWeight = this@GjcWeighingStartViewModel.arriveWeight.value?.toDoubleOrNull() ?: arriveWeight
|
||||||
arriveVolume = this@GjcWeighingStartViewModel.arriveVolume.value?.toDoubleOrNull() ?: arriveVolume
|
arriveVolume = this@GjcWeighingStartViewModel.arriveVolume.value?.toDoubleOrNull() ?: arriveVolume
|
||||||
|
// 添加通道号
|
||||||
|
passageWay = this@GjcWeighingStartViewModel.channel.value
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. 构建请求数据(GjcMaWb转RequestBody)
|
// 3. 构建请求数据(GjcMaWb转RequestBody,包含通道号)
|
||||||
val params = bean.toRequestBody(removeEmptyOrNull = true)
|
val params = bean.toRequestBody(removeEmptyOrNull = true)
|
||||||
|
|
||||||
// 4. 调用接口
|
// 4. 调用接口
|
||||||
@@ -318,7 +320,7 @@ class GjcWeighingStartViewModel : BaseViewModel() {
|
|||||||
val arriveWeightVal = arriveWeight.value?.toDoubleOrNull() ?: bean.arriveWeight
|
val arriveWeightVal = arriveWeight.value?.toDoubleOrNull() ?: bean.arriveWeight
|
||||||
val arriveVolumeVal = arriveVolume.value?.toDoubleOrNull() ?: bean.arriveVolume
|
val arriveVolumeVal = arriveVolume.value?.toDoubleOrNull() ?: bean.arriveVolume
|
||||||
|
|
||||||
// 提交数据到接口
|
// 提交数据到接口(添加通道号参数)
|
||||||
val params = mapOf(
|
val params = mapOf(
|
||||||
"maWbId" to bean.maWbId,
|
"maWbId" to bean.maWbId,
|
||||||
"no" to bean.no,
|
"no" to bean.no,
|
||||||
@@ -347,7 +349,8 @@ class GjcWeighingStartViewModel : BaseViewModel() {
|
|||||||
"businessType" to bean.businessType,
|
"businessType" to bean.businessType,
|
||||||
"carId" to bean.carId,
|
"carId" to bean.carId,
|
||||||
"remark" to bean.remark,
|
"remark" to bean.remark,
|
||||||
"checkIn" to "1" // 收运状态设置为已收运
|
"checkIn" to "1", // 收运状态设置为已收运
|
||||||
|
"passageWay" to channel.value // 通道号参数
|
||||||
).toRequestBody(removeEmptyOrNull = true)
|
).toRequestBody(removeEmptyOrNull = true)
|
||||||
|
|
||||||
launchLoadingCollect({
|
launchLoadingCollect({
|
||||||
|
|||||||
Reference in New Issue
Block a user