|
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.text.CharSequenceUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import cn.hutool.core.util.RandomUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.baiye.constant.DefaultNumberConstants;
|
|
|
|
|
import com.baiye.exception.BadRequestException;
|
|
|
|
|
import com.baiye.feign.SourceClueClient;
|
|
|
|
@ -249,11 +250,13 @@ public class TelephoneCallServiceImpl implements TelephoneCallService {
|
|
|
|
|
String otherLeg = rollCallBackDTO.getOtherLeg();
|
|
|
|
|
|
|
|
|
|
AllCallInfo allCallInfo = allCallInfoRepository.findBySessionId(otherLeg);
|
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(allCallInfo)) {
|
|
|
|
|
//相同说明是分机号的回调
|
|
|
|
|
if (sessionId.equals(otherLeg) && StrUtil.isNotBlank(rollCallBackDTO.getRecord_file_url())) {
|
|
|
|
|
allCallInfo.setRecordFlag(DefaultNumberConstants.ONE_NUMBER);
|
|
|
|
|
allCallInfo.setRecordFileDownloadUrl(rollCallBackDTO.getRecord_file_url());
|
|
|
|
|
allCallInfoRepository.updateByRecord(DefaultNumberConstants.ONE_NUMBER, rollCallBackDTO.getRecord_file_url(), allCallInfo.getId());
|
|
|
|
|
} else {
|
|
|
|
|
//拨打线索号的回调
|
|
|
|
|
if (StrUtil.isNotBlank(rollCallBackDTO.getCallee_answer_time())) {
|
|
|
|
@ -261,6 +264,7 @@ public class TelephoneCallServiceImpl implements TelephoneCallService {
|
|
|
|
|
callClueRepository.updateByStatus(DefaultNumberConstants.TWO_NUMBER, allCallInfo.getClueId());
|
|
|
|
|
allCallInfo.setStatus(DefaultNumberConstants.TWO_NUMBER);
|
|
|
|
|
allCallInfo.setDuration(Integer.valueOf(rollCallBackDTO.getDuration()));
|
|
|
|
|
allCallInfoRepository.updateByDurationAndStatus(DefaultNumberConstants.TWO_NUMBER, Integer.valueOf(rollCallBackDTO.getDuration()), allCallInfo.getId());
|
|
|
|
|
//更新资源通话状态
|
|
|
|
|
CompletableFuture.runAsync(() -> {
|
|
|
|
|
updateSourceCallStatus(allCallInfo.getClueId(), DefaultNumberConstants.TWO_NUMBER);
|
|
|
|
@ -272,7 +276,6 @@ public class TelephoneCallServiceImpl implements TelephoneCallService {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
allCallInfoRepository.save(allCallInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|