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

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