feat(进港仓库): 筛选对齐平板、统计取 notClearNumber/clearNumber、详情按平板字段(问题清单 #25~#27)

- #25 后端不新增入参:筛选弹层改为平板同款 航班日期/航班号/库位/清仓结果,
  移除始发站/代理/特码/运单类型/业务类型/品名
- #26 未清仓/已清仓取 pageQueryTotal 出参 notClearNumber/clearNumber,统计请求 3 次 → 1 次
- #27 进港详情按平板:航程 range 替代 始发站/中转站/目的站(无经停站),入库时间(opDate 恒空)
  改为平板同款 出库时间 dlvTime
- 内网实测:48/42/5;详情 航程 LAX-HFE / UN编号 / 锁定状态 正常显示
- 注意:IntImpStorage/pageQuery 当前对所有过滤条件(含平板自用的 wbNo/fno/fdate/location/clearNormal)
  均不生效,属后端缺陷,已登记问题清单

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
YANG JIANKUAN
2026-10-09 07:32:47 -07:00
parent d2340d46fb
commit 1229ecc920
3 changed files with 29 additions and 141 deletions

View File

@@ -18,7 +18,6 @@ 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.model.ScanModel
import com.lukouguoji.module_base.util.DictUtils
import dev.utils.app.info.KeyValue
import kotlinx.coroutines.launch
@@ -47,27 +46,10 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
// 筛选弹层显隐
val filterVisible = MutableLiveData(false)
// 筛选条件(fdep 为接口入参;其余 5 项为后端未定义入参,预留传参,见接口问题清单 #25)
val fdep = MutableLiveData("") // 始发站
val agentId = MutableLiveData("") // 代理(agentCode,预留)
val spCode = MutableLiveData("") // 特码(预留)
val awbType = MutableLiveData("") // 运单类型(预留)
val businessType = MutableLiveData("") // 业务类型(预留)
val goodsCn = MutableLiveData("") // 品名(中)(预留)
// 筛选弹层与平板端查询参数保持一致(后端确认):航班日期 / 航班号 / 库位 / 清仓结果,运单号/航班号走顶部搜索框。
// 始发站/代理/特码/运单类型/业务类型/品名 后端不支持(内网实测 fdep/agentCode 被忽略),已移除
// 筛选下拉字典(initPhoneExtras 加载,平板不请求)
val agentList = MutableLiveData(listOf(KeyValue("全部", "")))
val specialCodeList = MutableLiveData<List<KeyValue>>(emptyList())
val awbTypeList = MutableLiveData<List<KeyValue>>(emptyList())
val businessTypeList = MutableLiveData(
listOf(
KeyValue("全部", ""),
KeyValue("普货", "1"),
KeyValue("特货", "2")
)
)
// 三格统计:未清仓 / 已清仓(复用 pageQueryTotal 按 clearNormal=0/1 各查一次)
// 三格统计:未清仓 / 已清仓,直接取 pageQueryTotal 出参 notClearNumber / clearNumber
val unclearedCount = MutableLiveData("0")
val clearedCount = MutableLiveData("0")
@@ -79,18 +61,6 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
*/
fun initPhoneExtras() {
phoneExtrasEnabled = true
// 代理(国际进港口径)
DictUtils.getIntImpAgentList(addAll = false) { list ->
agentList.postValue(listOf(KeyValue("全部", "")) + list)
}
// 特码:flag=1 国际;ieFlag 必须留空
DictUtils.getSpecialCodeList(addAll = false, flag = 1, ieFlag = "") { list ->
specialCodeList.postValue(listOf(KeyValue("全部", "")) + list)
}
// 运单类型(type=II 国际进港)
DictUtils.getWaybillTypeList(type = Constant.businessType.II, addAll = true) {
awbTypeList.postValue(it)
}
}
/**
@@ -129,12 +99,8 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
fun resetFilter() {
flightDate.value = ""
flightNo.value = ""
fdep.value = ""
agentId.value = ""
spCode.value = ""
awbType.value = ""
businessType.value = ""
goodsCn.value = ""
location.value = ""
clearResult.value = ""
}
/** 确认筛选 - 关闭面板并刷新 */
@@ -354,20 +320,13 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
}
override fun getData() {
// 手机专属 6 项平板恒为空,不进请求;agentCode/spCode/awbType/businessType/goodsCn
// 为 pageQuery 未定义入参(后端静默忽略,补齐后自动生效,见接口问题清单 #25)
// 查询条件与平板端一致
val filterParams = mapOf(
"fdate" to flightDate.value?.ifEmpty { null },
"fno" to flightNo.value?.ifEmpty { null },
"wbNo" to wbNo.value?.ifEmpty { null },
"location" to location.value?.ifEmpty { null },
"clearNormal" to clearResult.value?.ifEmpty { null },
"fdep" to fdep.value?.ifEmpty { null },
"agentCode" to agentId.value?.ifEmpty { null },
"spCode" to spCode.value?.ifEmpty { null },
"awbType" to awbType.value?.ifEmpty { null },
"businessType" to businessType.value?.ifEmpty { null },
"goodsCn" to goodsCn.value?.ifEmpty { null }
"clearNormal" to clearResult.value?.ifEmpty { null }
)
val listParams = (filterParams + mapOf(
@@ -391,18 +350,9 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
totalWbNumber.value = (data?.wbNumber ?: 0).toString()
totalPc.value = (data?.totalPc ?: 0).toString()
totalWeight.value = (data?.totalWeight ?: 0.0).toString()
}
}
// 手机专属:未清仓/已清仓分项统计(同条件 + clearNormal=0/1 各查一次,平板不发)
if (phoneExtrasEnabled) {
val unclearedParams = (filterParams + mapOf("clearNormal" to "0")).toRequestBody()
launchCollect({ NetApply.api.getIntImpStorageUseTotal(unclearedParams) }) {
onSuccess = { unclearedCount.value = (it.data?.wbNumber ?: 0).toString() }
}
val clearedParams = (filterParams + mapOf("clearNormal" to "1")).toRequestBody()
launchCollect({ NetApply.api.getIntImpStorageUseTotal(clearedParams) }) {
onSuccess = { clearedCount.value = (it.data?.wbNumber ?: 0).toString() }
// 手机三格统计分项(平板布局不绑定,无影响)
unclearedCount.value = (data?.notClearNumber ?: 0).toString()
clearedCount.value = (data?.clearNumber ?: 0).toString()
}
}
}

View File

@@ -11,7 +11,7 @@
· 平板独有的 checkIcon(底部全选)手机版不提供,Binding 基类中自动变 @Nullable
交互差异(均复用既有 IntExpStorageUseViewModel 字段与接口):
· 平板 5 个横排搜索条 → 手机顶部搜索框(运单号)+ 底部筛选弹层 8 项
· 平板 5 个横排搜索条 → 手机顶部搜索框(运单号)+ 底部筛选弹层 4 项(航班日期/航班号/库位/清仓结果,与平板查询参数一致)
(设计稿弹层无「库位号/清仓结果」两项,对应平板字段保持空值不参与请求)
· 三格统计(总票数/未清仓/已清仓),后两格为手机专属统计请求(initPhoneExtras 开启,
复用 pageQueryTotal 按 clearNormal=0/1 各查一次)
@@ -235,7 +235,7 @@
</LinearLayout>
<!-- ==================== 筛选弹层(8 项,对应设计稿 filterSheet) ==================== -->
<!-- ==================== 筛选弹层(与平板端查询参数一致) ==================== -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneFilterPanel
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -264,63 +264,24 @@
type="@{PhoneDataLayoutType.INPUT}"
value="@={viewModel.flightNo}" />
<!-- 代理(手机专属筛选,字典由 initPhoneExtras 加载) -->
<!-- 库位(与平板端查询参数 location 一致) -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
hint='@{"请选择代理"}'
list="@{viewModel.agentList}"
title='@{"代理"}'
type="@{PhoneDataLayoutType.SPINNER}"
value="@={viewModel.agentId}" />
<!-- 特码 -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
hint='@{"请选择特码"}'
list="@{viewModel.specialCodeList}"
title='@{"特码"}'
type="@{PhoneDataLayoutType.SPINNER}"
value="@={viewModel.spCode}" />
<!-- 始发站(进港按始发站筛,入参 fdep) -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
hint='@{"请输入始发站"}'
title='@{"始发站"}'
hint='@{"请输入库位"}'
title='@{"库位"}'
type="@{PhoneDataLayoutType.INPUT}"
value="@={viewModel.fdep}" />
value="@={viewModel.location}" />
<!-- 运单类型(pageQuery 无此入参,后端补齐后自动生效,见接口问题清单) -->
<!-- 清仓结果(与平板端查询参数 clearNormal 一致) -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
hint='@{"请选择运单类型"}'
list="@{viewModel.awbTypeList}"
title='@{"运单类型"}'
hint='@{"请选择清仓结果"}'
list="@{viewModel.clearResultList}"
title='@{"清仓结果"}'
type="@{PhoneDataLayoutType.SPINNER}"
value="@={viewModel.awbType}" />
<!-- 业务类型(pageQuery 无此入参,同上) -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
hint='@{"请选择业务类型"}'
list="@{viewModel.businessTypeList}"
title='@{"业务类型"}'
type="@{PhoneDataLayoutType.SPINNER}"
value="@={viewModel.businessType}" />
<!-- 品名(中)(pageQuery 无此入参,同上) -->
<com.lukouguoji.module_base.ui.weight.phone.PhoneDataLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
hint='@{"请输入中文品名"}'
title='@{"品名(中)"}'
type="@{PhoneDataLayoutType.INPUT}"
value="@={viewModel.goodsCn}" />
value="@={viewModel.clearResult}" />
</com.lukouguoji.module_base.ui.weight.phone.PhoneFilterPanel>

View File

@@ -12,8 +12,8 @@
数据全部来自既有 viewModel.maWbData(IntImpSearch/detail 的 maWb Map),
取值统一走 viewModel.str()/dec() 帮助方法(空值兜底 "-")。
字段 key 以平板变体既有绑定为准(awbPc/awbWeight/cashWeight/inPc/inWeight/lockStateText/
mftStatus/tallyStatus/command);始发站/中转站/目的站/UN编号/入库时间为设计稿新增展示,
key(dep/dest1/dest/unNumber/opDate)按出港同名字段推断,实机核对后如缺失记入问题清单。
mftStatus/tallyStatus/command);后端确认按平板端展示(问题清单 #27):
航程 range(无经停站,替代始发站/中转站/目的站)、UN编号 unNumber、出库时间 dlvTime。
-->
<layout xmlns:android="http://schemas.android.com/apk/res/android">
@@ -121,7 +121,7 @@
</LinearLayout>
<!-- 始发站 | 中转站 -->
<!-- 航程 | UN编号(与平板端一致,无经停站) -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -132,31 +132,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
title='@{"始发站"}'
value='@{viewModel.str(viewModel.maWbData, "dep")}' />
<com.lukouguoji.module_base.ui.weight.phone.PhoneKvItem
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
title='@{"中转站"}'
value='@{viewModel.str(viewModel.maWbData, "dest1")}' />
</LinearLayout>
<!-- 目的站 | UN编号 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="horizontal">
<com.lukouguoji.module_base.ui.weight.phone.PhoneKvItem
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
title='@{"目的站"}'
value='@{viewModel.str(viewModel.maWbData, "dest")}' />
title='@{"航程"}'
value='@{viewModel.str(viewModel.maWbData, "range")}' />
<com.lukouguoji.module_base.ui.weight.phone.PhoneKvItem
android:layout_width="0dp"
@@ -190,7 +167,7 @@
</LinearLayout>
<!-- 业务类型 | 入库时间 -->
<!-- 业务类型 | 出库时间 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -208,8 +185,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
title='@{"入库时间"}'
value='@{viewModel.str(viewModel.maWbData, "opDate")}' />
title='@{"出库时间"}'
value='@{viewModel.str(viewModel.maWbData, "dlvTime")}' />
</LinearLayout>