| | |
| | | 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")); |
| | |
| | | String taskName = now.format(DateTimeFormatter.ofPattern("yyyy年MM月dd日HH:mm")) + "智能外呼"; |
| | | String[] numbers = StringUtils.split(callingNumbers,","); |
| | | String taskScheduleTime = LocalDateTime.now().plusHours(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | System.out.println("taskScheduleTime = " + taskScheduleTime); |
| | | JSONArray arr = getCalleeInfo(params); |
| | | HttpHeaders httpHeaders = new HttpHeaders(); |
| | | httpHeaders.add("Content-Type", CONTENT_TYPE); |
| | |
| | | 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; |