fix: 国际进港仓库接口路径修复及操作逻辑优化

- API路径从 IntImpStorageUse 修正为 IntImpStorage
- 清仓/入库接口参数改为 Query + Body 分离传递
- 清仓/出库/入库支持勾选运单号全选所有库位
- 出库确认弹框改为自定义 ConfirmDialogModel
- 搜索增加清仓综合结果筛选参数

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-13 14:06:07 +08:00
parent d31e78ff49
commit a4095d6e72
4 changed files with 66 additions and 53 deletions

View File

@@ -912,45 +912,45 @@ interface Api {
/**
* 国际进港仓库-分页查询
* 接口路径: /IntImpStorageUse/pageQuery
* 接口路径: /IntImpStorage/pageQuery
*/
@POST("IntImpStorageUse/pageQuery")
@POST("IntImpStorage/pageQuery")
suspend fun getIntImpStorageUseList(@Body data: RequestBody): PageInfo<GjcMaWb>
/**
* 国际进港仓库-分页合计
* 接口路径: /IntImpStorageUse/pageQueryTotal
* 接口路径: /IntImpStorage/pageQueryTotal
*/
@POST("IntImpStorageUse/pageQueryTotal")
@POST("IntImpStorage/pageQueryTotal")
suspend fun getIntImpStorageUseTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
/**
* 国际进港库位操作-清仓
* 接口路径: /IntImpStorageUse/updateClear
* 接口路径: /IntImpStorage/updateClear
*/
@POST("IntImpStorageUse/updateClear")
suspend fun clearIntImpStorage(@Body data: RequestBody): BaseResultBean<Boolean>
@POST("IntImpStorage/updateClear")
suspend fun clearIntImpStorage(@Query("clearNormal") clearNormal: String, @Body data: RequestBody): BaseResultBean<Boolean>
/**
* 国际进港库位操作-修改库位
* 接口路径: /IntImpStorageUse/modifyStorage
* 接口路径: /IntImpStorage/modifyStorage
*/
@POST("IntImpStorageUse/modifyStorage")
@POST("IntImpStorage/modifyStorage")
suspend fun modifyIntImpStorage(@Body data: RequestBody): BaseResultBean<Boolean>
/**
* 国际进港库位操作-出库
* 接口路径: /IntImpStorageUse/outStorage
* 接口路径: /IntImpStorage/outStorage
*/
@POST("IntImpStorageUse/outStorage")
@POST("IntImpStorage/outStorage")
suspend fun outIntImpStorage(@Body data: RequestBody): BaseResultBean<Boolean>
/**
* 国际进港库位操作-入库
* 接口路径: /IntImpStorageUse/inStorage
* 接口路径: /IntImpStorage/inStorage
*/
@POST("IntImpStorageUse/inStorage")
suspend fun inIntImpStorage(@Body data: RequestBody): BaseResultBean<Boolean>
@POST("IntImpStorage/inStorage")
suspend fun inIntImpStorage(@Query("location") location: String, @Body data: RequestBody): BaseResultBean<Boolean>
/**
* 国际进港提取记录-分页查询

View File

@@ -3,7 +3,7 @@ package com.lukouguoji.gjj.activity
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AlertDialog
import com.lukouguoji.module_base.model.ConfirmDialogModel
import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityIntImpStorageUseBinding
@@ -60,12 +60,17 @@ class IntImpStorageUseActivity :
val allItems = list.filterIsInstance<com.lukouguoji.module_base.bean.GjcMaWb>()
val maWbListForClear = allItems.mapNotNull { maWb ->
val selectedStorageList = maWb.storageUseList?.filter { it.isSelected } ?: emptyList()
if (selectedStorageList.isNotEmpty() || maWb.isSelected) {
maWb.copy(storageUseList = selectedStorageList)
if (maWb.isSelected) {
// 勾选运单号 → 默认全选该运单号下的所有库位
maWb.copy(storageUseList = maWb.storageUseList ?: emptyList())
} else {
null
// 勾选库位号 → 只对选择的库位进行操作
val selectedStorageList = maWb.storageUseList?.filter { it.isSelected } ?: emptyList()
if (selectedStorageList.isNotEmpty()) {
maWb.copy(storageUseList = selectedStorageList)
} else {
null
}
}
}
@@ -105,6 +110,7 @@ class IntImpStorageUseActivity :
val selectedStorage = selectedStorageUseList[0]
// 弹出库位选择弹框,选择后再调用接口
IntImpModifyStorageDialogModel { dialog ->
val locationName = dialog.locationName
val locationId = dialog.locationId
@@ -119,24 +125,32 @@ class IntImpStorageUseActivity :
val list = viewModel.pageModel.rv?.commonAdapter()?.items as? List<*> ?: return
val allItems = list.filterIsInstance<com.lukouguoji.module_base.bean.GjcMaWb>()
val selectedStorageUseList = mutableListOf<com.lukouguoji.module_base.bean.GjcStorageUse>()
allItems.forEach { maWb ->
maWb.storageUseList?.filter { it.isSelected }?.let { selectedStorageUseList.addAll(it) }
val maWbListForOutStorage = allItems.mapNotNull { maWb ->
if (maWb.isSelected) {
// 勾选运单号 → 默认全选该运单号下的所有库位
maWb.copy(storageUseList = maWb.storageUseList ?: emptyList())
} else {
// 勾选库位号 → 只对选择的库位进行操作
val selectedStorageList = maWb.storageUseList?.filter { it.isSelected } ?: emptyList()
if (selectedStorageList.isNotEmpty()) {
maWb.copy(storageUseList = selectedStorageList)
} else {
null
}
}
}
if (selectedStorageUseList.isEmpty()) {
if (maWbListForOutStorage.isEmpty()) {
showToast("请选择要出库的库位")
return
}
AlertDialog.Builder(this)
.setTitle("出库确认")
.setMessage("确定要将选中的 ${selectedStorageUseList.size} 个库位执行出库操作吗?")
.setPositiveButton("确定") { _, _ ->
viewModel.performOutStorage(selectedStorageUseList)
}
.setNegativeButton("取消", null)
.show()
ConfirmDialogModel(
message = "是否确认出库?",
title = "出库确认"
) {
viewModel.performOutStorage(maWbListForOutStorage)
}.show(this)
}
/**
@@ -147,12 +161,17 @@ class IntImpStorageUseActivity :
val allItems = list.filterIsInstance<com.lukouguoji.module_base.bean.GjcMaWb>()
val maWbListForInStorage = allItems.mapNotNull { maWb ->
val selectedStorageList = maWb.storageUseList?.filter { it.isSelected } ?: emptyList()
if (selectedStorageList.isNotEmpty() || maWb.isSelected) {
maWb.copy(storageUseList = selectedStorageList)
if (maWb.isSelected) {
// 勾选运单号 → 默认全选该运单号下的所有库位
maWb.copy(storageUseList = maWb.storageUseList ?: emptyList())
} else {
null
// 勾选库位号 → 只对选择的库位进行操作
val selectedStorageList = maWb.storageUseList?.filter { it.isSelected } ?: emptyList()
if (selectedStorageList.isNotEmpty()) {
maWb.copy(storageUseList = selectedStorageList)
} else {
null
}
}
}

View File

@@ -124,12 +124,9 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
return
}
val params = mapOf(
"clearNormal" to clearNormal,
"maWbList" to maWbListForClear
).toRequestBody()
val body = maWbListForClear.toRequestBody()
launchLoadingCollect({ NetApply.api.clearIntImpStorage(params) }) {
launchLoadingCollect({ NetApply.api.clearIntImpStorage(clearNormal, body) }) {
onSuccess = {
showToast("清仓成功")
viewModelScope.launch {
@@ -188,13 +185,13 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
/**
* 执行出库操作
*/
fun performOutStorage(selectedStorageList: List<com.lukouguoji.module_base.bean.GjcStorageUse>) {
if (selectedStorageList.isEmpty()) {
fun performOutStorage(maWbListForOutStorage: List<GjcMaWb>) {
if (maWbListForOutStorage.isEmpty()) {
showToast("请选择要出库的库位")
return
}
val params = selectedStorageList.toRequestBody()
val params = maWbListForOutStorage.toRequestBody()
launchLoadingCollect({ NetApply.api.outIntImpStorage(params) }) {
onSuccess = {
@@ -232,13 +229,9 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
return
}
val params = mapOf(
"location" to locationName,
"locationId" to locationId.toLongOrNull(),
"maWbList" to maWbListForInStorage
).toRequestBody()
val body = maWbListForInStorage.toRequestBody()
launchLoadingCollect({ NetApply.api.inIntImpStorage(params) }) {
launchLoadingCollect({ NetApply.api.inIntImpStorage(locationName, body) }) {
onSuccess = {
showToast("入库成功")
viewModelScope.launch {
@@ -257,7 +250,8 @@ class IntImpStorageUseViewModel : BasePageViewModel() {
"fdate" to flightDate.value?.ifEmpty { null },
"fno" to flightNo.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 }
)
val listParams = (filterParams + mapOf(

View File

@@ -72,7 +72,7 @@
autoQueryMinLength="@{4}"
autoQueryParamKey="@{`wbNo`}"
autoQueryTitle="@{`选择运单号`}"
autoQueryUrl="@{`/IntImpStorageUse/queryWbNoList`}"
autoQueryUrl="@{`/IntImpStorage/queryWbNoList`}"
hint='@{"请输入运单号"}'
icon="@{@drawable/img_scan}"
setOnIconClickListener="@{(v)-> viewModel.scanWbNo()}"