feat: 对接国际进港电报解析生成接口

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 15:39:28 +08:00
parent e12e0db7be
commit 3f56614df8
2 changed files with 14 additions and 8 deletions

View File

@@ -1714,10 +1714,10 @@ interface Api {
suspend fun getIntImpMsgList(@Body data: RequestBody): PageInfo<MsgReceivePool> suspend fun getIntImpMsgList(@Body data: RequestBody): PageInfo<MsgReceivePool>
/** /**
* 批量生成电报 * 解析电报(电报生成)
*/ */
@POST("IntImpMsg/batchGenerate") @POST("IntImpMsg/analyseMsg")
suspend fun batchGenerateMsg(@Body data: RequestBody): BaseResultBean<SimpleResultBean> suspend fun analyseMsg(@Body data: RequestBody): BaseResultBean<Boolean>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// 国际进港-原始舱单 // 国际进港-原始舱单

View File

@@ -152,7 +152,7 @@ class IntImpMsgParseViewModel : BasePageViewModel() {
} }
/** /**
* 电报生成(批量操作 * 电报生成(解析电报
*/ */
fun generateMsg() { fun generateMsg() {
val list = pageModel.rv?.commonAdapter()?.items as? List<MsgReceivePool> ?: return val list = pageModel.rv?.commonAdapter()?.items as? List<MsgReceivePool> ?: return
@@ -163,11 +163,17 @@ class IntImpMsgParseViewModel : BasePageViewModel() {
return return
} }
// 提取选中项的ID列表 if (fid.isEmpty()) {
val ids = selectedItems.mapNotNull { it.id } showToast("请先查询航班信息")
val requestData = mapOf("ids" to ids).toRequestBody() return
}
launchLoadingCollect({ NetApply.api.batchGenerateMsg(requestData) }) { val requestData = mapOf(
"fid" to fid.toLongOrNull(),
"msgList" to selectedItems
).toRequestBody()
launchLoadingCollect({ NetApply.api.analyseMsg(requestData) }) {
onSuccess = { onSuccess = {
showToast("电报生成成功") showToast("电报生成成功")
viewModelScope.launch { viewModelScope.launch {