fix: 开始组装

This commit is contained in:
2026-02-05 17:23:56 +08:00
parent b84dc9a816
commit d26f164736
3 changed files with 7 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ package com.lukouguoji.module_base.bean
* 组装位置Bean
*/
class AssemblePositionBean {
var positionCode: String = "" // 位置编码/ID
var positionName: String = "" // 位置名称
var isSelected: Boolean = false // 是否选中
}

View File

@@ -145,6 +145,7 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
onSuccess = { result ->
val list = result.data?.mapIndexed { index, dictBean ->
AssemblePositionBean().apply {
positionCode = dictBean.code // 保存位置编码/ID
positionName = dictBean.name
isSelected = (index == 0) // 默认选中第一项
}
@@ -569,6 +570,8 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
return
}
val loadAreaId = selectedPosition.value?.positionCode?.trim() ?: ""
// 2. 构建useInfoULD信息
val useInfo = mapOf(
"uld" to uldNo,
@@ -579,6 +582,7 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
else -> ""
},
"loadArea" to loadArea,
"loadAreaId" to loadAreaId.ifEmpty { null }, // 组装位置ID
"useId" to if (uldInfo.value?.useId == 0L) null else uldInfo.value?.useId // 添加useId来自getUld接口
)
@@ -644,6 +648,7 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
"consumeWeight" to materialWeight.toDoubleOrNull(),
"ldId" to operatorValue,
"loadArea" to loadArea,
"loadAreaId" to loadAreaId.ifEmpty { null }, // 组装位置ID
"useInfo" to useInfo,
"wbInfo" to wbInfo,
"userId" to SharedPreferenceUtil.getString(Constant.Share.account)

View File

@@ -170,7 +170,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text='@{bean.agentName}'
android:text='@{bean.agentCode}'
tools:text="顺丰" />
</androidx.appcompat.widget.LinearLayoutCompat>