feat(出港仓库): 筛选对齐平板查询参数,三格统计改取 notClearNumber/clearNumber(问题清单 #23/#24)

- #23 后端不新增入参:筛选弹层改为平板同款 航班日期/航班号/库位/清仓结果,
  移除代理/特码/目的站/运单类型/业务类型/品名(内网实测 agentCode/spCode/dest/awbType/goodsCn 均被忽略)
- #24 未清仓/已清仓直接取 pageQueryTotal 出参 notClearNumber/clearNumber,
  手机端统计请求由 3 次降为 1 次(与平板相同)
- 内网实测:全量 7/7/0;fno=MU2222 时 3/3/0 且列表同步过滤

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
YANG JIANKUAN
2026-10-09 03:47:41 -07:00
parent b522efa6b9
commit a431c09bd0
2 changed files with 23 additions and 116 deletions

View File

@@ -17,7 +17,6 @@ import com.lukouguoji.module_base.ktx.noNull
import com.lukouguoji.module_base.ktx.showToast import com.lukouguoji.module_base.ktx.showToast
import com.lukouguoji.module_base.ktx.toRequestBody import com.lukouguoji.module_base.ktx.toRequestBody
import com.lukouguoji.module_base.model.ScanModel import com.lukouguoji.module_base.model.ScanModel
import com.lukouguoji.module_base.util.DictUtils
import dev.utils.app.info.KeyValue import dev.utils.app.info.KeyValue
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@@ -43,28 +42,11 @@ class IntExpStorageUseViewModel : BasePageViewModel() {
// 筛选弹层显隐 // 筛选弹层显隐
val filterVisible = MutableLiveData(false) val filterVisible = MutableLiveData(false)
// 筛选条件(设计稿弹层 8 项中平板没有的 6 项;平板布局无对应控件 → 恒为空 → 不进请求) // 筛选弹层与平板端查询参数保持一致(后端确认):航班日期 / 航班号 / 库位 / 清仓结果,运单号走顶部搜索框。
val agentId = MutableLiveData("") // 代理(agentCode) // 代理/特码/目的站/运单类型/业务类型/品名 后端均不支持(内网实测 agentCode/spCode/dest 亦被忽略),已移除
val spCode = MutableLiveData("") // 特码
val dest = MutableLiveData("") // 目的站
val awbType = MutableLiveData("") // 运单类型(pageQuery 无此入参,预留,见接口问题清单)
val businessType = MutableLiveData("") // 业务类型(同上预留)
val goodsCn = MutableLiveData("") // 品名(中)(同上预留)
// 筛选下拉字典(initPhoneExtras 加载,平板不请求) // 三格统计:未清仓 / 已清仓(总票数复用 totalWbNumber),直接取 pageQueryTotal 出参
val agentList = MutableLiveData(listOf(KeyValue("全部", ""))) // notClearNumber / clearNumber(与总票数同一次请求、同条件)
val specialCodeList = MutableLiveData<List<KeyValue>>(emptyList())
val awbTypeList = MutableLiveData<List<KeyValue>>(emptyList())
val businessTypeList = MutableLiveData(
listOf(
KeyValue("全部", ""),
KeyValue("普货", "1"),
KeyValue("特货", "2")
)
)
// 三格统计:未清仓 / 已清仓(总票数复用 totalWbNumber,服务端全量口径)。
// 复用 pageQueryTotal 按 clearNormal=0/1 各查一次(入参 schema 含 clearNormal)。
val unclearedCount = MutableLiveData("0") val unclearedCount = MutableLiveData("0")
val clearedCount = MutableLiveData("0") val clearedCount = MutableLiveData("0")
@@ -76,22 +58,6 @@ class IntExpStorageUseViewModel : BasePageViewModel() {
*/ */
fun initPhoneExtras() { fun initPhoneExtras() {
phoneExtrasEnabled = true phoneExtrasEnabled = true
// 代理(与 06 出港查询同源接口)
launchCollect({ NetApply.api.getIntExpAgentList() }) {
onSuccess = { result ->
val list = mutableListOf(KeyValue("全部", ""))
result.data?.forEach { list.add(KeyValue(it.name ?: "", it.code ?: "")) }
agentList.value = list
}
}
// 特码:flag=1 国际;ieFlag 必须留空——传 "E" 后端返回空数组
DictUtils.getSpecialCodeList(addAll = false, flag = 1, ieFlag = "") { list ->
specialCodeList.postValue(listOf(KeyValue("全部", "")) + list)
}
// 运单类型(type=IO 国际出港)
DictUtils.getWaybillTypeList(type = Constant.businessType.IO, addAll = true) {
awbTypeList.postValue(it)
}
} }
/** 筛选按钮点击 - 打开筛选面板 */ /** 筛选按钮点击 - 打开筛选面板 */
@@ -108,12 +74,8 @@ class IntExpStorageUseViewModel : BasePageViewModel() {
fun resetFilter() { fun resetFilter() {
flightDate.value = "" flightDate.value = ""
flightNo.value = "" flightNo.value = ""
agentId.value = "" location.value = ""
spCode.value = "" clearResult.value = ""
dest.value = ""
awbType.value = ""
businessType.value = ""
goodsCn.value = ""
} }
/** 确认筛选 - 关闭面板并刷新 */ /** 确认筛选 - 关闭面板并刷新 */
@@ -385,20 +347,13 @@ class IntExpStorageUseViewModel : BasePageViewModel() {
* 获取数据 (重写BasePageViewModel) * 获取数据 (重写BasePageViewModel)
*/ */
override fun getData() { override fun getData() {
// 构建搜索条件(手机专属 6 项平板恒为空,不进请求;awbType/businessType/goodsCn // 构建搜索条件(与平板端一致)
// 为 pageQuery 未定义入参,后端静默忽略,补齐后自动生效,见接口问题清单)
val filterParams = mapOf( val filterParams = mapOf(
"fdate" to flightDate.value?.ifEmpty { null }, "fdate" to flightDate.value?.ifEmpty { null },
"fno" to flightNo.value?.ifEmpty { null }, "fno" to flightNo.value?.ifEmpty { null },
"wbNo" to wbNo.value?.ifEmpty { null }, "wbNo" to wbNo.value?.ifEmpty { null },
"location" to location.value?.ifEmpty { null }, "location" to location.value?.ifEmpty { null },
"clearNormal" to clearResult.value?.ifEmpty { null }, "clearNormal" to clearResult.value?.ifEmpty { null }
"agentCode" to agentId.value?.ifEmpty { null },
"spCode" to spCode.value?.ifEmpty { null },
"dest" to dest.value?.ifEmpty { null },
"awbType" to awbType.value?.ifEmpty { null },
"businessType" to businessType.value?.ifEmpty { null },
"goodsCn" to goodsCn.value?.ifEmpty { null }
) )
// 列表参数 (含分页) // 列表参数 (含分页)
@@ -428,18 +383,9 @@ class IntExpStorageUseViewModel : BasePageViewModel() {
totalWbNumber.value = (data?.wbNumber ?: 0).toString() totalWbNumber.value = (data?.wbNumber ?: 0).toString()
totalPc.value = (data?.totalPc ?: 0).toString() totalPc.value = (data?.totalPc ?: 0).toString()
totalWeight.value = (data?.totalWeight ?: 0.0).toString() totalWeight.value = (data?.totalWeight ?: 0.0).toString()
} // 手机三格统计分项(平板布局不绑定,无影响)
} unclearedCount.value = (data?.notClearNumber ?: 0).toString()
clearedCount.value = (data?.clearNumber ?: 0).toString()
// 手机专属:未清仓/已清仓分项统计(同条件 + clearNormal=0/1 各查一次,平板不发)
if (phoneExtrasEnabled) {
val unclearedParams = (filterParams + mapOf("clearNormal" to "0")).toRequestBody()
launchCollect({ NetApply.api.getIntExpStorageUseTotal(unclearedParams) }) {
onSuccess = { unclearedCount.value = (it.data?.wbNumber ?: 0).toString() }
}
val clearedParams = (filterParams + mapOf("clearNormal" to "1")).toRequestBody()
launchCollect({ NetApply.api.getIntExpStorageUseTotal(clearedParams) }) {
onSuccess = { clearedCount.value = (it.data?.wbNumber ?: 0).toString() }
} }
} }
} }

View File

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