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> 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> suspend fun getIntImpStorageUseTotal(@Body data: RequestBody): BaseResultBean<ManifestTotalDto>
/** /**
* 国际进港库位操作-清仓 * 国际进港库位操作-清仓
* 接口路径: /IntImpStorageUse/updateClear * 接口路径: /IntImpStorage/updateClear
*/ */
@POST("IntImpStorageUse/updateClear") @POST("IntImpStorage/updateClear")
suspend fun clearIntImpStorage(@Body data: RequestBody): BaseResultBean<Boolean> 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> 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> suspend fun outIntImpStorage(@Body data: RequestBody): BaseResultBean<Boolean>
/** /**
* 国际进港库位操作-入库 * 国际进港库位操作-入库
* 接口路径: /IntImpStorageUse/inStorage * 接口路径: /IntImpStorage/inStorage
*/ */
@POST("IntImpStorageUse/inStorage") @POST("IntImpStorage/inStorage")
suspend fun inIntImpStorage(@Body data: RequestBody): BaseResultBean<Boolean> 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.app.Activity
import android.content.Intent import android.content.Intent
import android.os.Bundle 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.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjj.R import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityIntImpStorageUseBinding import com.lukouguoji.gjj.databinding.ActivityIntImpStorageUseBinding
@@ -60,14 +60,19 @@ class IntImpStorageUseActivity :
val allItems = list.filterIsInstance<com.lukouguoji.module_base.bean.GjcMaWb>() val allItems = list.filterIsInstance<com.lukouguoji.module_base.bean.GjcMaWb>()
val maWbListForClear = allItems.mapNotNull { maWb -> val maWbListForClear = allItems.mapNotNull { maWb ->
if (maWb.isSelected) {
// 勾选运单号 → 默认全选该运单号下的所有库位
maWb.copy(storageUseList = maWb.storageUseList ?: emptyList())
} else {
// 勾选库位号 → 只对选择的库位进行操作
val selectedStorageList = maWb.storageUseList?.filter { it.isSelected } ?: emptyList() val selectedStorageList = maWb.storageUseList?.filter { it.isSelected } ?: emptyList()
if (selectedStorageList.isNotEmpty()) {
if (selectedStorageList.isNotEmpty() || maWb.isSelected) {
maWb.copy(storageUseList = selectedStorageList) maWb.copy(storageUseList = selectedStorageList)
} else { } else {
null null
} }
} }
}
if (maWbListForClear.isEmpty()) { if (maWbListForClear.isEmpty()) {
showToast("请至少选择一个库位") showToast("请至少选择一个库位")
@@ -105,6 +110,7 @@ class IntImpStorageUseActivity :
val selectedStorage = selectedStorageUseList[0] val selectedStorage = selectedStorageUseList[0]
// 弹出库位选择弹框,选择后再调用接口
IntImpModifyStorageDialogModel { dialog -> IntImpModifyStorageDialogModel { dialog ->
val locationName = dialog.locationName val locationName = dialog.locationName
val locationId = dialog.locationId val locationId = dialog.locationId
@@ -119,24 +125,32 @@ class IntImpStorageUseActivity :
val list = viewModel.pageModel.rv?.commonAdapter()?.items as? List<*> ?: return val list = viewModel.pageModel.rv?.commonAdapter()?.items as? List<*> ?: return
val allItems = list.filterIsInstance<com.lukouguoji.module_base.bean.GjcMaWb>() val allItems = list.filterIsInstance<com.lukouguoji.module_base.bean.GjcMaWb>()
val selectedStorageUseList = mutableListOf<com.lukouguoji.module_base.bean.GjcStorageUse>() val maWbListForOutStorage = allItems.mapNotNull { maWb ->
allItems.forEach { maWb -> if (maWb.isSelected) {
maWb.storageUseList?.filter { it.isSelected }?.let { selectedStorageUseList.addAll(it) } // 勾选运单号 → 默认全选该运单号下的所有库位
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("请选择要出库的库位") showToast("请选择要出库的库位")
return return
} }
AlertDialog.Builder(this) ConfirmDialogModel(
.setTitle("出库确认") message = "是否确认出库?",
.setMessage("确定要将选中的 ${selectedStorageUseList.size} 个库位执行出库操作吗?") title = "出库确认"
.setPositiveButton("确定") { _, _ -> ) {
viewModel.performOutStorage(selectedStorageUseList) viewModel.performOutStorage(maWbListForOutStorage)
} }.show(this)
.setNegativeButton("取消", null)
.show()
} }
/** /**
@@ -147,14 +161,19 @@ class IntImpStorageUseActivity :
val allItems = list.filterIsInstance<com.lukouguoji.module_base.bean.GjcMaWb>() val allItems = list.filterIsInstance<com.lukouguoji.module_base.bean.GjcMaWb>()
val maWbListForInStorage = allItems.mapNotNull { maWb -> val maWbListForInStorage = allItems.mapNotNull { maWb ->
if (maWb.isSelected) {
// 勾选运单号 → 默认全选该运单号下的所有库位
maWb.copy(storageUseList = maWb.storageUseList ?: emptyList())
} else {
// 勾选库位号 → 只对选择的库位进行操作
val selectedStorageList = maWb.storageUseList?.filter { it.isSelected } ?: emptyList() val selectedStorageList = maWb.storageUseList?.filter { it.isSelected } ?: emptyList()
if (selectedStorageList.isNotEmpty()) {
if (selectedStorageList.isNotEmpty() || maWb.isSelected) {
maWb.copy(storageUseList = selectedStorageList) maWb.copy(storageUseList = selectedStorageList)
} else { } else {
null null
} }
} }
}
if (maWbListForInStorage.isEmpty()) { if (maWbListForInStorage.isEmpty()) {
showToast("请至少选择一个单据") showToast("请至少选择一个单据")

View File

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

View File

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