| | |
| | | package cn.gistack.sm.intelligentCall.service.impl; |
| | | |
| | | import cn.gistack.sm.intelligentCall.constant.CallConstant; |
| | | import cn.gistack.sm.intelligentCall.mapper.CallTaskMapper; |
| | | import cn.gistack.sm.intelligentCall.service.CallService; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskStatistic; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskVO; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.RandomUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.DigestUtils; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | |
| | | |
| | | @Slf4j |
| | | @Service |
| | | @DS("ztznwh") |
| | | public class CallServiceImpl implements CallService { |
| | | |
| | | @Autowired |
| | | private CallTaskMapper callTaskMapper; |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | |
| | | private final static String CREATE_TASK_URL = "/api/task/createTask.json"; |
| | | private final static String CALL_DETAIL_URL = "/api/task/callDetail.json"; |
| | | |
| | | /** |
| | | * 创建任务 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void createTask(List<Map<String, String>> params) { |
| | | public Object createTask(List<Map<String, String>> params) { |
| | | String requestUrl = url + CREATE_TASK_URL; |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | String timestamp = now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss SSS")); |
| | |
| | | if (response.getStatusCode() != HttpStatus.OK) { |
| | | log.error("创建智能外呼任务失败:{}", response.getStatusCode()); |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | /** |
| | | * 获取通话详情 |
| | | * @param taskId |
| | | * @param calleeNumber |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object getCallDetail(String taskId, String calleeNumber) { |
| | | String requestUrl = url + CALL_DETAIL_URL; |
| | |
| | | }); |
| | | return arr; |
| | | } |
| | | |
| | | /** |
| | | * 查詢任务列表数据 |
| | | * @param page |
| | | * @param callTask |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<CallTaskStatistic> getCallListPage(IPage<CallTaskStatistic> page, CallTaskStatistic callTask) { |
| | | return page.setRecords(callTaskMapper.getCallListPage(page,callTask)); |
| | | } |
| | | } |