From 1368e2edfa28957788e54263d3c8c92677691509 Mon Sep 17 00:00:00 2001 From: lyf66 Date: Sat, 9 Aug 2025 19:12:42 +0800 Subject: [PATCH] add isComplete --- .../java/com/whdc/component/AutoCallTaskScheduled.java | 10 +++++----- .../java/com/whdc/model/autocall/AutoCallPerson.java | 2 ++ .../whdc/model/autocall/aicc/AICCCallRespDetail.java | 1 + .../whdc/service/autocall/AutoCallTaskService2.java | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/whdc/component/AutoCallTaskScheduled.java b/src/main/java/com/whdc/component/AutoCallTaskScheduled.java index 245a228..00474c6 100644 --- a/src/main/java/com/whdc/component/AutoCallTaskScheduled.java +++ b/src/main/java/com/whdc/component/AutoCallTaskScheduled.java @@ -133,7 +133,7 @@ public class AutoCallTaskScheduled { //fetch status int pendingDuration = 60 * 1000 * 2; int loopGap = 1000; - boolean resultFetched = false; + boolean isComplete = false; AutoCallPerson _person = null; while (pendingDuration > 0) { try { @@ -146,15 +146,15 @@ public class AutoCallTaskScheduled { //联通确保tag和remark同时返回 _person = autoCallTaskService.step4QueryAICCTaskResult(person); - if (_person != null && _person.getDetailRemark() != null) { - resultFetched = true; + if (_person != null && _person.getIsComplete() == 1) { + isComplete = true; } - if (resultFetched) break; + if (isComplete) break; } if (_person != null) person = _person; - if (resultFetched) { + if (isComplete) { //获取到任务详情且有话术标签为已知晓,中断循环 if (AutoCallPerson.TAG_DONE.equals(person.getTag())) break; } else { diff --git a/src/main/java/com/whdc/model/autocall/AutoCallPerson.java b/src/main/java/com/whdc/model/autocall/AutoCallPerson.java index 499856f..ec6d75b 100644 --- a/src/main/java/com/whdc/model/autocall/AutoCallPerson.java +++ b/src/main/java/com/whdc/model/autocall/AutoCallPerson.java @@ -71,6 +71,8 @@ public class AutoCallPerson { private String detailSipTermCause; //例如”对方挂机“ @TableField(value = "__tag") private String tag; //话术识别:未识别,已知晓 + @TableField("__is_complete") + private Integer isComplete; //default 0 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @TableField(value = "__startring_at") diff --git a/src/main/java/com/whdc/model/autocall/aicc/AICCCallRespDetail.java b/src/main/java/com/whdc/model/autocall/aicc/AICCCallRespDetail.java index 213e217..ca3bb50 100644 --- a/src/main/java/com/whdc/model/autocall/aicc/AICCCallRespDetail.java +++ b/src/main/java/com/whdc/model/autocall/aicc/AICCCallRespDetail.java @@ -36,6 +36,7 @@ public class AICCCallRespDetail { private Integer status; //0进行中 2结束 4暂停 private Integer totalCount; private Integer sendCount; + private boolean isComplete; private RawVarListMap rawVarListMap; private List tags; diff --git a/src/main/java/com/whdc/service/autocall/AutoCallTaskService2.java b/src/main/java/com/whdc/service/autocall/AutoCallTaskService2.java index e977b84..9b886dd 100644 --- a/src/main/java/com/whdc/service/autocall/AutoCallTaskService2.java +++ b/src/main/java/com/whdc/service/autocall/AutoCallTaskService2.java @@ -620,8 +620,7 @@ public class AutoCallTaskService2 { detail.getResult().getData() == null || detail.getResult().getData().getRecords() == null || detail.getResult().getData().getRecords().isEmpty() || - detail.getResult().getData().getRecords().get(0).getTags() == null || - detail.getResult().getData().getRecords().get(0).getTags().isEmpty() + !detail.getResult().getData().getRecords().get(0).isComplete() ) { return null; //tags为空代表联通平台还未或正在呼叫,还没有结果信息,应继续刷接口 } @@ -631,6 +630,7 @@ public class AutoCallTaskService2 { String dialRemark = record.getRemark(); AICCCallRespDetail.RawVarListMap rawVarListMap = record.getRawVarListMap(); //已产生结果信息 + person.setIsComplete(record.isComplete() ? 1 : 0); person.setDetailRemark(dialRemark); person.setDetailTalkTimes(record.getTalkTimes()); person.setDetailSipTermCause(rawVarListMap.getSipTermCause());