OutboundCallController.java
17.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
package cn.com.glsx.entmicro.controller;
import cn.com.glsx.entmicro.dto.TaskExecuteStatus;
import cn.com.glsx.entmicro.model.response.outbound.OutBoundTaskCustomerExportResponse;
import cn.com.glsx.entmicro.model.response.outbound.OutBoundTaskCustomerRpcResponse;
import cn.com.glsx.entmicro.request.outbound.*;
import cn.com.glsx.entmicro.response.outbound.*;
import cn.com.glsx.entmicro.service.outbound.OutboundCallService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.enums.DefaultErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @Author yelq
* @Version 1.0
* @Description: 智能外呼
* @Date 2022/8/4 17:11
*/
@Slf4j
@Api("智能机器人外呼任务")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class OutboundCallController {
@Autowired
private OutboundCallService outboundCallService;
@ServiceMethod(method = "entmicro.api.outbound.call.phone.check")
@ApiOperation("创建外呼任务校验客户手机号接口")
public RopResponse<PhoneCheckRopResponse> checkOutboundCallPhone(PhoneCheckRopRequest request) {
try {
return RopResponse.success(outboundCallService.checkOutboundCallPhone(request));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_checkOutboundCallPhone_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.call.merchant.check.task.name")
@ApiOperation("校验外呼任务名称重复(true-已存在,false-不存在)")
public RopResponse<Boolean> merchantCheckOutboundCallTaskName(MerchantCheckTaskNameRopRequest request) {
try {
return RopResponse.success(outboundCallService.merchantCheckOutboundCallTaskName(request));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_merchantCheckOutboundCallTaskName_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.call.merchant.create.task")
@ApiOperation("门店创建外呼任务")
public RopResponse<Boolean> merchantCreateOutboundCallTask(MerchantCreateTaskRopRequest request) {
try {
return RopResponse.success(outboundCallService.merchantCreateOutboundCallTask(request));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_merchantCreateOutboundCallTask_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.call.merchant.task.delete")
@ApiOperation("门店删除外呼任务")
public RopResponse<Boolean> merchantDeleteOutboundCallTask(MerchantDeleteTaskRopRequest request) {
try {
return RopResponse.success(outboundCallService.merchantDeleteOutboundCallTask(request));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_merchantDeleteOutboundCallTask_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.call.merchant.task.page")
@ApiOperation("门店外呼任务分页")
public RopResponse<Pagination<OutboundCallTaskRopResponse>> merchantOutboundCallTaskPage(MerchantTaskPageRopRequest request) {
try {
return RopResponse.success(outboundCallService.merchantOutboundCallTaskPage(request));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_merchantOutboundCallTaskPage_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.call.caller.numbers.query")
@ApiOperation("获取呼叫电话列表")
public RopResponse<List<String>> getOutboundCallDidList(DidListRopRequest request) {
try {
return RopResponse.success(outboundCallService.getOutboundCallDidList(request));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_getOutboundCallDidList_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.call.robot.list.query")
@ApiOperation("获取机器人列表")
public RopResponse<List<RobotDetailRopResponse>> getOutboundCallRobotList(RobotListRopRequest request) {
try {
return RopResponse.success(outboundCallService.getOutboundCallRobotList(request));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_getOutboundCallRobotList_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.call.execute.task.status.update")
@ApiOperation("执行任务状态变更")
public RopResponse<String> outboundExecuteTaskStatusUpdate(ExecuteTaskStatusUpdateRopRequest request) {
try {
return RopResponse.success(outboundCallService.outboundExecuteTaskStatusUpdate(request));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_outboundExecuteTaskStatusUpdate_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.call.create.execute.task")
@ApiOperation("创建外呼执行任务")
public RopResponse<Boolean> outboundCallCreateExecuteTask(CreateTaskRopReuqst request) {
try {
return RopResponse.success(outboundCallService.outboundCallCreateExecuteTask(request));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_outbountCallCreateExecuteTask_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.call.import.update.phone.status")
@ApiOperation("导入手机号更新添加状态接口")
public RopResponse<Boolean> importPhoneAddStatus(ImportRopRequest request) {
try {
return RopResponse.success(outboundCallService.importPhoneAddStatus(request));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_importPhoneAddStatus_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.task.page")
@ApiOperation("智能外呼任务分页")
public RopResponse<Pagination<OutBoundTaskRopResponse>> findOutBoundTaskListPageByCondition(OutBoundTaskRopRequest ropRequest) {
try {
return RopResponse.success(outboundCallService.findOutBoundTaskListByCondition(ropRequest));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_findOutBoundTaskListPageByCondition_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.task.detail")
@ApiOperation("智能外呼任务详情-基本信息")
public RopResponse<OutBoundTaskDetailRopResponse> findOutBoundTaskDetail(TaskDetailRopRequest ropRequest) {
try {
return RopResponse.success(outboundCallService.findOutBoundTaskDetail(ropRequest));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_findOutBoundTaskDetail_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.task.phoneStatus.page")
@ApiOperation("智能外呼任务详情-手机号状态列表分页")
public RopResponse<Pagination<OutBoundTaskCustomerRpcResponse>> findCustomersPageByTaskId(OutBoundTaskRopRequest ropRequest) {
try {
return RopResponse.success(outboundCallService.findCustomersPageByTaskId(ropRequest));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_findCustomersPageByTaskId_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.task.phoneStatus.download")
@ApiOperation("下载手机号状态列表")
public RopResponse<String> downLoadPhoneStatusByTaskId(PhoneStatusDownLoadRopRequest ropRequest) {
try {
return RopResponse.success(outboundCallService.downLoadPhoneStatusByTaskId(ropRequest));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_downLoadPhoneStatusByTaskId_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.task.status")
@ApiOperation("统计:所有任务的执行状态")
public RopResponse<TaskExecuteStatus> findTaskExecuteStatus(OutBoundTaskRopRequest ropRequest) {
try {
return RopResponse.success(outboundCallService.findTaskExecuteStatus(ropRequest));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_findTaskExecuteStatus_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.task.getOutBoundNum")
@ApiOperation("获取外呼数量")
public RopResponse<Integer> getOutBoundNum(FindOutBoundTaskNumRopRequest ropRequest) {
try {
return RopResponse.success(outboundCallService.getOutBoundNum(ropRequest));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_getOutBoundNum_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.task.outBoundNum")
@ApiOperation("设置外呼数量")
public RopResponse<Boolean> setOutBoundNum(OutBoundConfigureRopRequest ropRequest) {
try {
return RopResponse.success(outboundCallService.setOutBoundNum(ropRequest));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_outBoundNum_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.task.message.detail.query")
@ApiOperation("查看外呼任务短信内容")
public RopResponse<TaskMessageDetailRopResponse> queryTaskMessageDetail(QueryTaskMessageDetailRopRequest ropRequest) {
try {
return RopResponse.success(outboundCallService.queryTaskMessageDetail(ropRequest));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_queryTaskMessageDetail_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.task.message.detail.update")
@ApiOperation("修改外呼任务短信内容")
public RopResponse<Boolean> updateTaskMessageDetail(UpdateTaskMessageDetailRopRequest ropRequest) {
try {
return RopResponse.success(outboundCallService.updateTaskMessageDetail(ropRequest));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_updateTaskMessageDetail_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.call.merchant.task.create.content.echo")
@ApiOperation("门店任务创建内容回显")
public RopResponse<OutboundCallTaskEchoRopResponse> echoMerchantTask(TaskDetailRopRequest ropRequest) {
try {
return RopResponse.success(outboundCallService.echoMerchantTask(ropRequest));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_echoMerchantTask_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.call.merchant.task.create.content.update")
@ApiOperation("更改门店外呼任务")
public RopResponse<Boolean> updateMerchantTask(MerchantTaskUpdateRopRequest ropRequest) {
try {
return RopResponse.success(outboundCallService.updateMerchantTask(ropRequest));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_updateMerchantTask_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.task.customer.condition.page")
@ApiOperation("AI外呼任务详情-客户列表多条件分页")
public RopResponse<Pagination<OutBoundTaskCustomerRopResponse>> findCustomersPageByCondition(TaskCustomerPageRopRequest ropRequest) {
try {
return RopResponse.success(outboundCallService.findCustomersPageByCondition(ropRequest));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_findCustomersPageByCondition_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
@ServiceMethod(method = "entmicro.api.outbound.task.customer.condition.export")
@ApiOperation("AI外呼任务详情-客户列表多条件分页导出")
public RopResponse<String> exportCustomersPageByCondition(TaskCustomerPageRopRequest ropRequest) {
try {
return RopResponse.success(outboundCallService.exportCustomersPageByCondition(ropRequest));
} catch (RpcServiceException e) {
log.info("=======OutboundCallController_exportCustomersPageByCondition_invoke__exception:{}", e.getMessage());
return RopResponse.error(e.getErrId(), e.getMessage());
} catch (Exception e) {
log.info(e.getMessage(), e);
return RopResponse.error(e.getMessage());
}
}
}