| | |
| | | package cn.gistack.sm.intelligentCall.controller; |
| | | |
| | | import cn.gistack.sm.intelligentCall.entity.CallTaskResult; |
| | | import cn.gistack.sm.intelligentCall.entity.Scene; |
| | | import cn.gistack.sm.intelligentCall.service.CallService; |
| | | import cn.gistack.sm.intelligentCall.service.ICallSmsNoticeTaskService; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskResultVO; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskStatistic; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | private final CallService callService; |
| | | |
| | | private final ICallSmsNoticeTaskService callSmsNoticeTaskService; |
| | | |
| | | /** |
| | | * 创建任务 |
| | | * @return |
| | | */ |
| | | @PostMapping("/createCall") |
| | | public R createCall(@RequestBody Map<String,Object> map){ |
| | | List<String> task = callService.createTask(map); |
| | | // 创建外呼短信发送任务记录 |
| | | createCallSmsNoticeTask(task); |
| | | // 返回 |
| | | return R.data(callService.createTask(map)); |
| | | return R.data(task); |
| | | } |
| | | |
| | | /** |
| | | * 创建外呼短信发送任务记录 |
| | | * @param result |
| | | */ |
| | | private Boolean createCallSmsNoticeTask(List<String> result) { |
| | | Boolean flag = false; |
| | | if (null != result && result.size() > 0) { |
| | | if (result.get(2).equals("true")) { |
| | | // 获取任务id |
| | | String taskId = result.get(1); |
| | | flag = callSmsNoticeTaskService.createCallSmsNoticeTask(taskId); |
| | | } |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.data(callService.getCallTaskResultList(callTaskResult)); |
| | | } |
| | | |
| | | /** |
| | | * 查询智能外呼统计数据-按日期-行政区统计 |
| | | * @param callTaskStatistic |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @GetMapping("/getOutgoingStatisticList") |
| | | public R getOutgoingStatisticList(CallTaskStatistic callTaskStatistic, Query query){ |
| | | // 返回 |
| | | return R.data(callService.getOutgoingStatisticList(Condition.getPage(query),callTaskStatistic)); |
| | | } |
| | | |
| | | /** |
| | | * 查询智能外呼统计数据-行政区统计 |
| | | * @param callTaskStatistic |
| | | * @return |
| | | */ |
| | | @GetMapping("/getOutgoingStatisticByArea") |
| | | public R getOutgoingStatisticByArea(CallTaskStatistic callTaskStatistic){ |
| | | // 返回 |
| | | return R.data(callService.getOutgoingStatisticByArea(callTaskStatistic)); |
| | | } |
| | | |
| | | /** |
| | | * 根据条件自动创建外呼任务 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @PostMapping("/createCallTaskByParams") |
| | | public R createCallTaskByParam(@RequestBody Map<String, Object> params){ |
| | | // 返回 |
| | | return R.data(callService.createCallTaskByParam(params)); |
| | | } |
| | | |
| | | /** |
| | | * 查询未接通,拒接的呼叫结果详情列表信息 |
| | | * @param callTaskStatistic |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @GetMapping("/getCallNotConnectResultList") |
| | | public R getCallNotConnectResultList(CallTaskStatistic callTaskStatistic, Query query){ |
| | | // 返回 |
| | | return R.data(callService.getCallNotConnectResultList(Condition.getPage(query),callTaskStatistic)); |
| | | } |
| | | |
| | | /** |
| | | * 按日期行政区呼叫结果详情列表信息 |
| | | * @param callTaskStatistic |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @GetMapping("/getCallResultList") |
| | | public R getCallResultList(CallTaskStatistic callTaskStatistic, Query query){ |
| | | // 返回 |
| | | return R.data(callService.getCallResultList(Condition.getPage(query),callTaskStatistic)); |
| | | } |
| | | } |