百度外呼通话记录。
This commit is contained in:
parent
97d95ff976
commit
d11279872e
@ -9,6 +9,7 @@ import com.xinelu.manage.dto.signpatientmanageroutenode.PatientTaskDto;
|
||||
import com.xinelu.manage.dto.signpatientmanageroutenode.RouteNodeCheckDto;
|
||||
import com.xinelu.manage.dto.signpatientmanageroutenode.SignPatientManageRouteNodeDto;
|
||||
import com.xinelu.manage.service.signpatientmanageroutenode.ISignPatientManageRouteNodeService;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.AIDialRecordVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeInfoVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeListVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo;
|
||||
@ -131,11 +132,11 @@ public class SignPatientManageRouteNodeController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* AI通话获取录音
|
||||
* AI通话获取通话记录及录音
|
||||
*/
|
||||
@ApiOperation("AI通话获取录音")
|
||||
@ApiOperation("AI通话获取通话记录及录音")
|
||||
@GetMapping("/getPhoneDialVideo/{id}")
|
||||
public R<String> getPhoneDialVideo(@PathVariable("id") Long id) {
|
||||
public R<AIDialRecordVo> getPhoneDialVideo(@PathVariable("id") Long id) {
|
||||
return R.ok(signNodeService.getPhoneDialVideo(id));
|
||||
}
|
||||
|
||||
|
||||
@ -225,25 +225,6 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
if (insertBatchCount < 0) {
|
||||
return AjaxResult.error("新增签约患者管理任务路径失败!请联系管理员!");
|
||||
}
|
||||
//List<SignRouteTriggerCondition> signRouteTriggerConditions = new ArrayList<SignRouteTriggerCondition>();
|
||||
//for (SignRouteTriggerConditionVO signRouteTriggerCondition : signPatientManageRoute.getTriggerConditionList()) {
|
||||
// if (StringUtils.isBlank(signRouteTriggerCondition.getTriggerConditionCode()) || StringUtils.isBlank(signRouteTriggerCondition.getTriggerConditionOperator()) || StringUtils.isBlank(signRouteTriggerCondition.getTriggerConditionValue())) {
|
||||
// return AjaxResult.error("请选择完整的触发条件");
|
||||
// }
|
||||
// SignRouteTriggerCondition triggerCondition = new SignRouteTriggerCondition();
|
||||
// signRouteTriggerCondition.setPatientManageRouteId(signPatientManageRoute.getId());
|
||||
// signRouteTriggerCondition.setCreateTime(LocalDateTime.now());
|
||||
// signRouteTriggerCondition.setCreateBy(SecurityUtils.getUsername());
|
||||
// BeanUtils.copyBeanProp(triggerCondition, signRouteTriggerCondition);
|
||||
// signRouteTriggerConditions.add(triggerCondition);
|
||||
//}
|
||||
//if (CollectionUtils.isEmpty(signRouteTriggerConditions)) {
|
||||
// return AjaxResult.success();
|
||||
//}
|
||||
//int insertTriggerCondition = signRouteTriggerConditionMapper.insertBatch(signRouteTriggerConditions);
|
||||
//if (insertTriggerCondition < 0) {
|
||||
// return AjaxResult.error("新增签约患者管理任务路径失败!请联系管理员!");
|
||||
//}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ -1129,4 +1110,19 @@ public class SignPatientManageRouteServiceImpl implements ISignPatientManageRout
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 专病路径修改时修改任务,已经执行的任务不修改,未执行的任务进行删除或修改
|
||||
* @Param routeId 专病路径主键
|
||||
* @return null
|
||||
* @Author haown
|
||||
* @Date 2024-11-15 10:52
|
||||
*/
|
||||
private void updateBySpecialDiseaseRoute(Long routeId) {
|
||||
// 查询签约专病路径的sign_patientmanage_route
|
||||
SignPatientManageRoute manageRouteQuery = new SignPatientManageRoute();
|
||||
manageRouteQuery.setRouteId(routeId);
|
||||
List<SignPatientManageRoute> manageRouteList = signPatientManageRouteMapper.selectSignPatientManageRouteList(manageRouteQuery);
|
||||
// 查询未执行任务
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ import com.xinelu.manage.vo.signpatientmanageroutenode.AppletRouteNodeListVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeInfoVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeListVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientTaskVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.AIDialRecordVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageNodeAuditVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientManageRouteNodeVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.SignPatientTaskVo;
|
||||
@ -130,7 +131,14 @@ public interface ISignPatientManageRouteNodeService {
|
||||
|
||||
List<PatientSpecialDiseaseNodeVo> getSpecialDiseaseNode(PatientTaskDto patientTaskDto);
|
||||
|
||||
String getPhoneDialVideo(Long id);
|
||||
/**
|
||||
* @description 根据任务主键获取最新一次的电话拨打录音及通话记录
|
||||
* @Param id 任务主键
|
||||
* @return 电话拨打录音及通话记录
|
||||
* @Author haown
|
||||
* @Date 2024-11-8 14:43
|
||||
*/
|
||||
AIDialRecordVo getPhoneDialVideo(Long id);
|
||||
|
||||
/**
|
||||
* 根据参数列表修改任务
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.xinelu.manage.service.signpatientmanageroutenode.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.common.annotation.DataScope;
|
||||
import com.xinelu.common.constant.ApplyRangeContant;
|
||||
@ -74,6 +75,7 @@ import com.xinelu.manage.vo.patientinfo.PatientNextTaskVo;
|
||||
import com.xinelu.manage.vo.patientquestionsubmitresult.PatientQuestionSubmitResultVO;
|
||||
import com.xinelu.manage.vo.propagandainfo.PropagandaMaterialsVo;
|
||||
import com.xinelu.manage.vo.questionInfo.QuestionVO;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.AIDialRecordVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.AppletRouteNodeListVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeInfoVo;
|
||||
import com.xinelu.manage.vo.signpatientmanageroutenode.PatientManageNodeListVo;
|
||||
@ -586,19 +588,47 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
|
||||
return specialDiseaseNodeMapper.selectRouteNodeByRouteId(manageRouteList.get(0).getRouteId());
|
||||
}
|
||||
|
||||
@Override public String getPhoneDialVideo(Long id) {
|
||||
/**
|
||||
* @description 根据任务主键获取最新一次的电话拨打录音及通话记录
|
||||
* @Param id 任务主键
|
||||
* @return 电话拨打录音及通话记录
|
||||
* @Author haown
|
||||
* @Date 2024-11-8 14:43
|
||||
*/
|
||||
@Override public AIDialRecordVo getPhoneDialVideo(Long id) {
|
||||
AIDialRecordVo recordVo = new AIDialRecordVo();
|
||||
// 查询通话记录
|
||||
SignPatientManageRouteNode signPatientManageRouteNode = signPatientManageRouteNodeMapper.selectSignPatientManageRouteNodeById(id);
|
||||
|
||||
PhoneDialRecord phoneDialRecord = phoneDialRecordMapper.getLastRecord(id);
|
||||
if(ObjectUtils.isEmpty(phoneDialRecord) || StringUtils.isBlank(phoneDialRecord.getCtUuid())) {
|
||||
throw new ServiceException("暂未获取到录音,请稍后再试");
|
||||
|
||||
String phoneResultJson = signPatientManageRouteNode.getPhoneResultJson();
|
||||
if (StringUtils.isNotBlank(phoneResultJson)) {
|
||||
JSONObject resultJson = JSONObject.parseObject(phoneResultJson);
|
||||
JSONArray record = resultJson.getJSONArray("record");
|
||||
recordVo.setRecord(record);
|
||||
|
||||
if(ObjectUtils.isEmpty(phoneDialRecord) || StringUtils.isBlank(phoneDialRecord.getCtUuid())) {
|
||||
// 从任务中解析ctuuid
|
||||
String ctuuid = resultJson.getString("contactUUID");
|
||||
if (StringUtils.isNotBlank(ctuuid)) {
|
||||
String videoUrl = aiobService.getPhoneDialRecord(ctuuid);
|
||||
recordVo.setPhoneDialRecordVideo(videoUrl);
|
||||
}
|
||||
return recordVo;
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(phoneDialRecord.getPhoneDialRecordVideo())) {
|
||||
String videoUrl = aiobService.getPhoneDialRecord(phoneDialRecord.getCtUuid());
|
||||
phoneDialRecord.setPhoneDialRecordVideo(videoUrl);
|
||||
phoneDialRecordMapper.updatePhoneDialRecord(phoneDialRecord);
|
||||
return videoUrl;
|
||||
recordVo.setPhoneDialRecordVideo(videoUrl);
|
||||
} else {
|
||||
return phoneDialRecord.getPhoneDialRecordVideo();
|
||||
recordVo.setPhoneDialRecordVideo(phoneDialRecord.getPhoneDialRecordVideo());
|
||||
}
|
||||
|
||||
return recordVo;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -21,6 +21,15 @@ import com.xinelu.manage.service.specialdiseasenode.ISpecialDiseaseNodeService;
|
||||
import com.xinelu.manage.vo.specialdiseasenode.RouteTaskAuditVo;
|
||||
import com.xinelu.manage.vo.specialdiseasenode.SpecialDiseaseNodeVO;
|
||||
import com.xinelu.manage.vo.specialdiseaseroute.SpecialDiseaseRouteVO;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.TreeSet;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
@ -32,11 +41,6 @@ import org.jsoup.select.Elements;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 专病路径-管理节点信息Service业务层处理
|
||||
*
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
package com.xinelu.manage.vo.signpatientmanageroutenode;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @description: 获取AI通话记录返回视图类
|
||||
* @author: haown
|
||||
* @create: 2024-11-15 13:27
|
||||
**/
|
||||
@ApiModel("获取AI通话记录返回视图类")
|
||||
@Data
|
||||
public class AIDialRecordVo {
|
||||
|
||||
/**
|
||||
* 通话录音存储路径
|
||||
*/
|
||||
@ApiModelProperty(value = "通话录音存储路径")
|
||||
private String phoneDialRecordVideo;
|
||||
|
||||
@ApiModelProperty("通话记录")
|
||||
private JSONArray record;
|
||||
}
|
||||
@ -167,6 +167,9 @@
|
||||
<if test="parentRouteId != null ">
|
||||
and parent_route_id = #{parentRouteId}
|
||||
</if>
|
||||
<if test="routeId != null">
|
||||
and route_id = #{routeId}
|
||||
</if>
|
||||
<if test="routeName != null and routeName != ''">
|
||||
and route_name like concat('%', #{routeName}, '%')
|
||||
</if>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user