feat: 国际进港舱单货物发放、装机单查询参数对齐及运单号自动查询
- 实现货物发放功能,对接 /IntImpManifest/putUpCargo 接口 - 装机单列表查询参数改为与父页面一致(fid + fdep) - 修复装机单列表接口返回类型(PageInfo 无需 BaseResultBean 包装) - 舱单和装机单页面运单号输入框支持4位以上自动查询 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1838,7 +1838,7 @@ interface Api {
|
||||
* 国际进港舱单-分拣理货(装机单)-分页查询
|
||||
*/
|
||||
@POST("IntImpManifest/pageQueryAir")
|
||||
suspend fun getIntImpLoadingList(@Body data: RequestBody): BaseResultBean<PageInfo<GjjManifest>>
|
||||
suspend fun getIntImpLoadingList(@Body data: RequestBody): PageInfo<GjjManifest>
|
||||
|
||||
/**
|
||||
* 国际进港舱单-分拣理货(装机单)-分页合计
|
||||
@@ -1858,6 +1858,12 @@ interface Api {
|
||||
@POST("IntImpTally/pageQueryTotal")
|
||||
suspend fun getIntImpTallyTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
|
||||
|
||||
/**
|
||||
* 国际进港舱单-货物发放
|
||||
*/
|
||||
@POST("IntImpManifest/putUpCargo")
|
||||
suspend fun intImpManifestPutUpCargo(@Body data: RequestBody): BaseResultBean<String>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 国际进港-事故签证
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -51,10 +51,19 @@ class IntImpLoadingListActivity :
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
// 接收从进港舱单传递的参数
|
||||
// 设置运单号自动查询的额外参数(FID、FDGP)
|
||||
binding.pslWaybillNo.autoQueryConfig.extraParamsProvider = {
|
||||
mapOf(
|
||||
"fid" to viewModel.fid,
|
||||
"fdep" to viewModel.fdep
|
||||
)
|
||||
}
|
||||
|
||||
// 接收从进港舱单传递的参数(FID和FDGP用于查询,fdate/fno/fdest用于界面显示)
|
||||
intent.getStringExtra("fid")?.let { if (it.isNotEmpty()) viewModel.fid = it }
|
||||
intent.getStringExtra("fdep")?.let { if (it.isNotEmpty()) viewModel.fdep = it }
|
||||
intent.getStringExtra("fdate")?.let { if (it.isNotEmpty()) viewModel.flightDate.value = it }
|
||||
intent.getStringExtra("fno")?.let { if (it.isNotEmpty()) viewModel.flightNo.value = it }
|
||||
intent.getStringExtra("sendAddress")?.let { if (it.isNotEmpty()) viewModel.sendAddress.value = it }
|
||||
intent.getStringExtra("fdest")?.let { if (it.isNotEmpty()) viewModel.fdest.value = it }
|
||||
|
||||
// 如果收到了航班号和日期参数,触发航班查询来构建始发站下拉列表
|
||||
|
||||
@@ -44,6 +44,14 @@ class IntImpManifestActivity :
|
||||
FlowBus.with<String>(ConstantEvent.EVENT_REFRESH).observe(this) {
|
||||
viewModel.refresh()
|
||||
}
|
||||
|
||||
// 设置运单号自动查询的额外参数(FID、FDGP)
|
||||
binding.pslWaybillNo.autoQueryConfig.extraParamsProvider = {
|
||||
mapOf(
|
||||
"fid" to viewModel.fid,
|
||||
"fdep" to viewModel.fdep
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
|
||||
@@ -35,7 +35,8 @@ class IntImpLoadingListViewModel : BasePageViewModel() {
|
||||
|
||||
// ========== 航班级联查询 ==========
|
||||
private var lastQueriedFlight = ""
|
||||
private var fid = ""
|
||||
var fid = ""
|
||||
var fdep = ""
|
||||
|
||||
fun onFlightDateInputComplete() {
|
||||
lastQueriedFlight = ""
|
||||
@@ -68,6 +69,7 @@ class IntImpLoadingListViewModel : BasePageViewModel() {
|
||||
if (it.verifySuccess() && it.data != null) {
|
||||
val flight = it.data!!
|
||||
fid = flight.fid.noNull()
|
||||
fdep = flight.fdep.noNull()
|
||||
fdest.value = flight.fdest.noNull()
|
||||
|
||||
// 构建始发站下拉列表:fdep + jtz(经停港)
|
||||
@@ -81,6 +83,7 @@ class IntImpLoadingListViewModel : BasePageViewModel() {
|
||||
sendAddress.value = flight.fdep.noNull()
|
||||
} else {
|
||||
fid = ""
|
||||
fdep = ""
|
||||
fdest.value = ""
|
||||
sendAddressList.value = emptyList()
|
||||
sendAddress.value = ""
|
||||
@@ -90,6 +93,7 @@ class IntImpLoadingListViewModel : BasePageViewModel() {
|
||||
|
||||
onFailed = { _, _ ->
|
||||
fid = ""
|
||||
fdep = ""
|
||||
fdest.value = ""
|
||||
sendAddressList.value = emptyList()
|
||||
sendAddress.value = ""
|
||||
@@ -120,9 +124,66 @@ class IntImpLoadingListViewModel : BasePageViewModel() {
|
||||
|
||||
/**
|
||||
* 搜索按钮点击
|
||||
* 先查询航班信息获取FID,再刷新列表(与父页面逻辑保持一致)
|
||||
*/
|
||||
fun searchClick() {
|
||||
refresh()
|
||||
val fdate = flightDate.value
|
||||
val fno = flightNo.value
|
||||
if (!fdate.isNullOrEmpty() && !fno.isNullOrEmpty()) {
|
||||
val key = "$fdate-$fno"
|
||||
if (key != lastQueriedFlight || fid.isEmpty()) {
|
||||
// 先查询航班信息获取FID
|
||||
lastQueriedFlight = key
|
||||
launchLoadingCollect({
|
||||
NetApply.api.getGjFlightBean(
|
||||
mapOf(
|
||||
"fdate" to fdate,
|
||||
"fno" to fno,
|
||||
"ieFlag" to "I",
|
||||
).toRequestBody()
|
||||
)
|
||||
}) {
|
||||
onSuccess = {
|
||||
if (it.verifySuccess() && it.data != null) {
|
||||
val flight = it.data!!
|
||||
fid = flight.fid.noNull()
|
||||
fdep = flight.fdep.noNull()
|
||||
fdest.value = flight.fdest.noNull()
|
||||
val list = mutableListOf(
|
||||
KeyValue(flight.fdep.noNull(), flight.fdep.noNull()),
|
||||
)
|
||||
if (!flight.jtz.isNullOrEmpty()) {
|
||||
list.add(KeyValue(flight.jtz.noNull(), flight.jtz.noNull()))
|
||||
}
|
||||
sendAddressList.value = list
|
||||
sendAddress.value = flight.fdep.noNull()
|
||||
} else {
|
||||
fid = ""
|
||||
fdep = ""
|
||||
fdest.value = ""
|
||||
sendAddressList.value = emptyList()
|
||||
sendAddress.value = ""
|
||||
showToast(it.msg.noNull("获取航班信息失败"))
|
||||
}
|
||||
refresh()
|
||||
}
|
||||
onFailed = { _, _ ->
|
||||
fid = ""
|
||||
fdep = ""
|
||||
fdest.value = ""
|
||||
sendAddressList.value = emptyList()
|
||||
sendAddress.value = ""
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
refresh()
|
||||
}
|
||||
} else {
|
||||
fid = ""
|
||||
fdep = ""
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,14 +280,13 @@ class IntImpLoadingListViewModel : BasePageViewModel() {
|
||||
|
||||
/**
|
||||
* 获取数据(重写BasePageViewModel)
|
||||
* 查询参数与父页面(国际进港舱单)保持一致:使用FID和FDGP
|
||||
*/
|
||||
override fun getData() {
|
||||
// 构建搜索条件
|
||||
// 构建搜索条件(与父页面一致:fid + fdep + wbNo)
|
||||
val filterParams = mapOf(
|
||||
"fdate" to flightDate.value?.ifEmpty { null },
|
||||
"fno" to flightNo.value?.ifEmpty { null },
|
||||
"sendAddress" to sendAddress.value?.ifEmpty { null },
|
||||
"fdest" to fdest.value?.ifEmpty { null },
|
||||
"fid" to fid.ifEmpty { null },
|
||||
"fdep" to fdep.ifEmpty { null },
|
||||
"wbNo" to waybillNo.value?.ifEmpty { null }
|
||||
)
|
||||
|
||||
@@ -242,19 +302,7 @@ class IntImpLoadingListViewModel : BasePageViewModel() {
|
||||
// 获取列表(带Loading)
|
||||
launchLoadingCollect({ NetApply.api.getIntImpLoadingList(listParams) }) {
|
||||
onSuccess = { result ->
|
||||
// 处理PageInfo结构
|
||||
val pageInfo = result.data
|
||||
if (pageInfo != null) {
|
||||
val list = pageInfo.list ?: emptyList()
|
||||
val pages = pageInfo.pages ?: 1
|
||||
|
||||
// 处理分页数据
|
||||
pageModel.handleDataList(list)
|
||||
pageModel.haveMore.postValue(pages > pageModel.page)
|
||||
} else {
|
||||
pageModel.handleDataList(emptyList())
|
||||
pageModel.haveMore.postValue(false)
|
||||
}
|
||||
pageModel.handleListBean(result.toBaseListBean())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
||||
|
||||
// ========== 航班级联查询 ==========
|
||||
private var lastQueriedFlight = ""
|
||||
private var fid = ""
|
||||
private var fdep = "" // 航班始发港(用于列表查询参数)
|
||||
var fid = ""
|
||||
var fdep = "" // 航班始发港(用于列表查询参数)
|
||||
|
||||
fun onFlightDateInputComplete() {
|
||||
lastQueriedFlight = ""
|
||||
@@ -332,18 +332,45 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
||||
fun sortingTallyClick() {
|
||||
com.alibaba.android.arouter.launcher.ARouter.getInstance()
|
||||
.build(com.lukouguoji.module_base.router.ARouterConstants.ACTIVITY_URL_INT_IMP_LOADING_LIST)
|
||||
.withString("fid", fid)
|
||||
.withString("fdep", fdep)
|
||||
.withString("fdate", flightDate.value ?: "")
|
||||
.withString("fno", flightNo.value ?: "")
|
||||
.withString("sendAddress", sendAddress.value ?: "")
|
||||
.withString("fdest", fdest.value ?: "")
|
||||
.navigation()
|
||||
}
|
||||
|
||||
/**
|
||||
* 货物发放(暂不实现)
|
||||
* 货物发放
|
||||
*/
|
||||
fun cargoReleaseClick() {
|
||||
showToast("货物发放功能开发中")
|
||||
val list = pageModel.rv?.commonAdapter()?.items as? List<GjjManifest> ?: return
|
||||
val selectedItems = list.filter { it.isSelected }
|
||||
|
||||
if (selectedItems.isEmpty()) {
|
||||
showToast("请选择要发放的运单")
|
||||
return
|
||||
}
|
||||
|
||||
ConfirmDialogModel(
|
||||
message = "确定要发放选中的 ${selectedItems.size} 票运单吗?",
|
||||
title = "货物发放确认"
|
||||
) {
|
||||
val params = mapOf(
|
||||
"manifestList" to selectedItems
|
||||
).toRequestBody()
|
||||
|
||||
launchLoadingCollect({ NetApply.api.intImpManifestPutUpCargo(params) }) {
|
||||
onSuccess = {
|
||||
if (it.verifySuccess()) {
|
||||
showToast(it.msg.noNull("货物发放成功"))
|
||||
refresh()
|
||||
} else {
|
||||
showToast(it.msg.noNull("货物发放失败"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}.show()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -77,11 +77,18 @@
|
||||
|
||||
<!-- 运单号 -->
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
android:id="@+id/psl_waybill_no"
|
||||
hint='@{"请输入运单号"}'
|
||||
icon="@{@drawable/img_scan}"
|
||||
setOnIconClickListener="@{(v)-> viewModel.scanWaybill()}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.waybillNo}"
|
||||
autoQueryEnabled="@{true}"
|
||||
autoQueryUrl="@{`/IntImpManifest/pageQueryAirWbNoList`}"
|
||||
autoQueryParamKey="@{`wbNo`}"
|
||||
autoQueryMinLength="@{4}"
|
||||
autoQueryMaxLength="@{8}"
|
||||
autoQueryTitle="@{`选择运单号`}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
@@ -73,11 +73,18 @@
|
||||
|
||||
<!-- 运单号 -->
|
||||
<com.lukouguoji.module_base.ui.weight.search.layout.PadSearchLayout
|
||||
android:id="@+id/psl_waybill_no"
|
||||
hint='@{"请输入运单号"}'
|
||||
icon="@{@drawable/img_scan}"
|
||||
setOnIconClickListener="@{(v)-> viewModel.scanWaybill()}"
|
||||
type="@{SearchLayoutType.INPUT}"
|
||||
value="@={viewModel.waybillNo}"
|
||||
autoQueryEnabled="@{true}"
|
||||
autoQueryUrl="@{`/IntImpManifest/pageQueryWbNoList`}"
|
||||
autoQueryParamKey="@{`wbNo`}"
|
||||
autoQueryMinLength="@{4}"
|
||||
autoQueryMaxLength="@{8}"
|
||||
autoQueryTitle="@{`选择运单号`}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
Reference in New Issue
Block a user