feat: 对接国际进港电报解析生成接口
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1714,10 +1714,10 @@ interface Api {
|
||||
suspend fun getIntImpMsgList(@Body data: RequestBody): PageInfo<MsgReceivePool>
|
||||
|
||||
/**
|
||||
* 批量生成电报
|
||||
* 解析电报(电报生成)
|
||||
*/
|
||||
@POST("IntImpMsg/batchGenerate")
|
||||
suspend fun batchGenerateMsg(@Body data: RequestBody): BaseResultBean<SimpleResultBean>
|
||||
@POST("IntImpMsg/analyseMsg")
|
||||
suspend fun analyseMsg(@Body data: RequestBody): BaseResultBean<Boolean>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 国际进港-原始舱单
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user