feat: 开始组装 opt
This commit is contained in:
@@ -36,7 +36,8 @@
|
|||||||
"Bash(sort:*)",
|
"Bash(sort:*)",
|
||||||
"Bash(ls:*)",
|
"Bash(ls:*)",
|
||||||
"Bash(xargs rm:*)",
|
"Bash(xargs rm:*)",
|
||||||
"Bash(git -C /Users/kid/Development/Fusion/Projects/aerologic-app stash)"
|
"Bash(git -C /Users/kid/Development/Fusion/Projects/aerologic-app stash)",
|
||||||
|
"WebFetch(domain:api.apifox.cn)"
|
||||||
],
|
],
|
||||||
"deny": [],
|
"deny": [],
|
||||||
"ask": []
|
"ask": []
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class GjcUldUseBean {
|
|||||||
var netWeight: Double = 0.0 // 装机重量
|
var netWeight: Double = 0.0 // 装机重量
|
||||||
var totalWeight: Double = 0.0 // 总重
|
var totalWeight: Double = 0.0 // 总重
|
||||||
var uldWeight: Double = 0.0 // uld重量
|
var uldWeight: Double = 0.0 // uld重量
|
||||||
|
var consumeWeight: Double = 0.0 // 耗材重量
|
||||||
var volume: Double = 0.0 // 体积
|
var volume: Double = 0.0 // 体积
|
||||||
var maxVolume: Double = 0.0 // uld最大容积
|
var maxVolume: Double = 0.0 // uld最大容积
|
||||||
var maxWeight: Double = 0.0 // uld最大载重
|
var maxWeight: Double = 0.0 // uld最大载重
|
||||||
|
|||||||
@@ -601,6 +601,15 @@ interface Api {
|
|||||||
@GET("IntExpAssemble/queryWaitingAssemble")
|
@GET("IntExpAssemble/queryWaitingAssemble")
|
||||||
suspend fun queryWaitingAssemble(@Query("wbNo") wbNo: String): BaseResultBean<MutableList<GjcWarehouse>>
|
suspend fun queryWaitingAssemble(@Query("wbNo") wbNo: String): BaseResultBean<MutableList<GjcWarehouse>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际出港组装 - 根据全ULD查询ULD状态和耗材重量
|
||||||
|
* 接口路径: /IntExpAssemble/getUld
|
||||||
|
* @param uld ULD编号
|
||||||
|
* @return ULD信息,包含status(0:正常,1:故障)和consumeWeight(耗材重量)
|
||||||
|
*/
|
||||||
|
@GET("IntExpAssemble/getUld")
|
||||||
|
suspend fun getUldWithConsumeWeight(@Query("uld") uld: String): BaseResultBean<GjcUldUseBean>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际出港出库交接-分页查询
|
* 国际出港出库交接-分页查询
|
||||||
* 接口路径: /IntExpOutHandover/pageQuery
|
* 接口路径: /IntExpOutHandover/pageQuery
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.lukouguoji.module_base.base.CommonAdapter
|
|||||||
import com.lukouguoji.module_base.common.Constant
|
import com.lukouguoji.module_base.common.Constant
|
||||||
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
|
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
|
||||||
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
import com.lukouguoji.module_base.ktx.addOnItemClickListener
|
||||||
|
import com.lukouguoji.module_base.ktx.setUpperCaseAlphanumericFilter
|
||||||
import com.lukouguoji.module_base.router.ARouterConstants
|
import com.lukouguoji.module_base.router.ARouterConstants
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,6 +45,9 @@ class IntExpAssembleStartActivity :
|
|||||||
setBackArrow("开始组装")
|
setBackArrow("开始组装")
|
||||||
binding.viewModel = viewModel
|
binding.viewModel = viewModel
|
||||||
|
|
||||||
|
// 为ULD编号添加大写字母和数字的输入限制
|
||||||
|
binding.uldNoInput.et.setUpperCaseAlphanumericFilter()
|
||||||
|
|
||||||
// 初始化列表
|
// 初始化列表
|
||||||
initRecyclerViews()
|
initRecyclerViews()
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
|
|||||||
// ========== 组装人列表 ==========
|
// ========== 组装人列表 ==========
|
||||||
val assemblerList = MutableLiveData<List<KeyValue>>(emptyList())
|
val assemblerList = MutableLiveData<List<KeyValue>>(emptyList())
|
||||||
|
|
||||||
|
// ========== 标记位,避免重复查询 ==========
|
||||||
|
private var lastQueriedUldNo = ""
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化模拟数据(已废弃)
|
* 初始化模拟数据(已废弃)
|
||||||
*/
|
*/
|
||||||
@@ -192,7 +195,7 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
|
|||||||
val warehouseList = result.data ?: mutableListOf()
|
val warehouseList = result.data ?: mutableListOf()
|
||||||
val waybillBeanList = warehouseList.map { warehouse ->
|
val waybillBeanList = warehouseList.map { warehouse ->
|
||||||
AssembleWaybillBean().apply {
|
AssembleWaybillBean().apply {
|
||||||
waybillNo = warehouse.no
|
waybillNo = warehouse.wbNo
|
||||||
pieces = warehouse.pc.toString()
|
pieces = warehouse.pc.toString()
|
||||||
weight = String.format("%.1f", warehouse.weight)
|
weight = String.format("%.1f", warehouse.weight)
|
||||||
flight = warehouse.flight
|
flight = warehouse.flight
|
||||||
@@ -244,6 +247,46 @@ class IntExpAssembleStartViewModel : BaseViewModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ULD编号输入完成时调用
|
||||||
|
*/
|
||||||
|
fun onUldNoInputComplete() {
|
||||||
|
val uld = uldInfo.value?.uldNo?.trim() ?: ""
|
||||||
|
if (uld.isNotEmpty() && uld != lastQueriedUldNo) {
|
||||||
|
lastQueriedUldNo = uld
|
||||||
|
queryUldInfo(uld)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询ULD信息(状态和耗材重量)
|
||||||
|
*/
|
||||||
|
private fun queryUldInfo(uldNo: String) {
|
||||||
|
launchCollect({ NetApply.api.getUldWithConsumeWeight(uldNo) }) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
val uldBean = result.data
|
||||||
|
if (uldBean != null) {
|
||||||
|
// 更新ULD状态和耗材重量
|
||||||
|
uldInfo.value = uldInfo.value?.apply {
|
||||||
|
// status: 0-正常, 1-故障
|
||||||
|
uldStatus = when (uldBean.status) {
|
||||||
|
"0" -> "正常"
|
||||||
|
"1" -> "故障"
|
||||||
|
else -> uldBean.status ?: ""
|
||||||
|
}
|
||||||
|
// 耗材重量保持可编辑,仅在为空时填充
|
||||||
|
if (materialWeight.isEmpty()) {
|
||||||
|
materialWeight = uldBean.consumeWeight?.toString() ?: ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onFailed = { code, message ->
|
||||||
|
showToast("查询ULD信息失败: $message")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 卸货按钮点击
|
* 卸货按钮点击
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<!-- 搜索框 -->
|
<!-- 搜索框 -->
|
||||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayoutNew
|
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayoutNew
|
||||||
hint='@{"请输入搜索内容"}'
|
hint='@{"请输入ULD编码"}'
|
||||||
type="@{SearchLayoutType.INPUT}"
|
type="@{SearchLayoutType.INPUT}"
|
||||||
value="@={viewModel.searchText}"
|
value="@={viewModel.searchText}"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
<!-- 搜索框 -->
|
<!-- 搜索框 -->
|
||||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayoutNew
|
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayoutNew
|
||||||
android:id="@+id/tvWbSearch"
|
android:id="@+id/tvWbSearch"
|
||||||
hint='@{"请输入搜索内容"}'
|
hint='@{"请输入原单号"}'
|
||||||
icon="@{@drawable/img_search}"
|
icon="@{@drawable/img_search}"
|
||||||
setOnSearchListener="@{viewModel::loadWaitingAssembleWaybills}"
|
setOnSearchListener="@{viewModel::loadWaitingAssembleWaybills}"
|
||||||
setSearchIconClickListener="@{viewModel::loadWaitingAssembleWaybills}"
|
setSearchIconClickListener="@{viewModel::loadWaitingAssembleWaybills}"
|
||||||
@@ -248,7 +248,9 @@
|
|||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||||
|
android:id="@+id/uldNoInput"
|
||||||
required="@{false}"
|
required="@{false}"
|
||||||
|
setRefreshCallBack="@{viewModel::onUldNoInputComplete}"
|
||||||
title='@{"ULD编号:"}'
|
title='@{"ULD编号:"}'
|
||||||
titleLength="@{5}"
|
titleLength="@{5}"
|
||||||
type="@{DataLayoutType.INPUT}"
|
type="@{DataLayoutType.INPUT}"
|
||||||
|
|||||||
@@ -18,11 +18,13 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="36dp"
|
android:layout_height="36dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
android:background="@color/white"
|
android:background="@color/white"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
|||||||
Reference in New Issue
Block a user