|
|
@@ -1,8 +1,11 @@
|
|
1
|
1
|
package api.controller.call;
|
|
2
|
2
|
|
|
|
3
|
+import api.entity.database.system.User;
|
|
|
4
|
+import api.entity.view.call.CallLogExportView;
|
|
3
|
5
|
import api.entity.view.call.CallLogView;
|
|
4
|
6
|
import api.service.system.IConfigService;
|
|
5
|
7
|
import api.util.annotation.Anonymous;
|
|
|
8
|
+import api.util.helper.ExcelHelper;
|
|
6
|
9
|
import com.alibaba.fastjson2.JSON;
|
|
7
|
10
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
8
|
11
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
@@ -18,6 +21,7 @@ import api.util.enums.BusinessType;
|
|
18
|
21
|
import api.util.helper.StringHelper;
|
|
19
|
22
|
import io.swagger.annotations.Api;
|
|
20
|
23
|
import io.swagger.annotations.ApiOperation;
|
|
|
24
|
+import lombok.var;
|
|
21
|
25
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
22
|
26
|
import org.springframework.web.bind.annotation.*;
|
|
23
|
27
|
|
|
|
@@ -26,6 +30,7 @@ import java.time.temporal.ChronoUnit;
|
|
26
|
30
|
import java.time.temporal.Temporal;
|
|
27
|
31
|
import java.util.Arrays;
|
|
28
|
32
|
import java.util.List;
|
|
|
33
|
+import java.util.stream.Collectors;
|
|
29
|
34
|
|
|
30
|
35
|
@Api(value = "通话记录表",tags = "通话记录表")
|
|
31
|
36
|
@RestController
|
|
|
@@ -40,7 +45,7 @@ public class CallLogController extends BaseController {
|
|
40
|
45
|
@Log(title = "查询通话记录表列表",businessType = BusinessType.QUERY)
|
|
41
|
46
|
@GetMapping
|
|
42
|
47
|
public AjaxResult getList(CallLog input, PageInput pageInput) {
|
|
43
|
|
- LambdaQueryWrapper<CallLog> qw = new LambdaQueryWrapper();
|
|
|
48
|
+ LambdaQueryWrapper<CallLog> qw = new LambdaQueryWrapper<>();
|
|
44
|
49
|
qw.eq(input.getActionId() != null && input.getActionId() > 0, CallLog::getActionId, input.getActionId());
|
|
45
|
50
|
qw.eq(!StringHelper.isEmpty(input.getCallerAgent()), CallLog::getCallerAgent, input.getCallerAgent());
|
|
46
|
51
|
qw.eq(!StringHelper.isEmpty(input.getCaller()), CallLog::getCaller, input.getCaller());
|
|
|
@@ -56,6 +61,7 @@ public class CallLogController extends BaseController {
|
|
56
|
61
|
qw.eq(input.getMyd() != null && input.getMyd() > 0, CallLog::getMyd, input.getMyd());
|
|
57
|
62
|
qw.eq(!StringHelper.isEmpty(input.getWorkordercode()), CallLog::getWorkordercode, input.getWorkordercode());
|
|
58
|
63
|
qw.orderByDesc(CallLog::getId);
|
|
|
64
|
+
|
|
59
|
65
|
if (pageInput.getPageNum()==null){pageInput.setPageNum(1);}
|
|
60
|
66
|
if (pageInput.getPageSize()==null){pageInput.setPageSize(10);}
|
|
61
|
67
|
Page<CallLog> page = GetPage(pageInput);
|
|
|
@@ -81,8 +87,75 @@ public class CallLogController extends BaseController {
|
|
81
|
87
|
}
|
|
82
|
88
|
}
|
|
83
|
89
|
return Success("成功", callLogView, iPage.getTotal());
|
|
|
90
|
+
|
|
84
|
91
|
}
|
|
85
|
92
|
|
|
|
93
|
+
|
|
|
94
|
+ @ApiOperation("导出Excel")
|
|
|
95
|
+ @Log(title = "导出excel", businessType = BusinessType.EXPORT)
|
|
|
96
|
+ @PostMapping("/exportExcel")
|
|
|
97
|
+ public void ExportExcel(CallLog input) {
|
|
|
98
|
+ LambdaQueryWrapper<CallLog> qw = new LambdaQueryWrapper<>();
|
|
|
99
|
+ qw.eq(input.getActionId() != null && input.getActionId() > 0, CallLog::getActionId, input.getActionId());
|
|
|
100
|
+ qw.eq(!StringHelper.isEmpty(input.getCallerAgent()), CallLog::getCallerAgent, input.getCallerAgent());
|
|
|
101
|
+ qw.eq(!StringHelper.isEmpty(input.getCaller()), CallLog::getCaller, input.getCaller());
|
|
|
102
|
+ qw.eq(!StringHelper.isEmpty(input.getTrunkNum()), CallLog::getTrunkNum, input.getTrunkNum());
|
|
|
103
|
+ qw.eq(!StringHelper.isEmpty(input.getCalleeAgent()), CallLog::getCalleeAgent, input.getCalleeAgent());
|
|
|
104
|
+ qw.eq(!StringHelper.isEmpty(input.getCallee()), CallLog::getCallee, input.getCallee());
|
|
|
105
|
+ qw.eq(!StringHelper.isEmpty(input.getGroupNo()), CallLog::getGroupNo, input.getGroupNo());
|
|
|
106
|
+ qw.eq(input.getCallType() != null && input.getCallType() > 0, CallLog::getCallType, input.getCallType());
|
|
|
107
|
+ qw.ge(input.getCreateTime() != null , CallLog::getCreateTime, input.getCreateTime());
|
|
|
108
|
+ qw.le(input.getEndTime() != null , CallLog::getCreateTime, input.getEndTime());
|
|
|
109
|
+ qw.eq(input.getIsAnswer() != null && input.getIsAnswer() > 0, CallLog::getIsAnswer, input.getIsAnswer());
|
|
|
110
|
+ qw.eq(input.getOpType() != null && input.getOpType() > 0, CallLog::getOpType, input.getOpType());
|
|
|
111
|
+ qw.eq(input.getMyd() != null && input.getMyd() > 0, CallLog::getMyd, input.getMyd());
|
|
|
112
|
+ qw.eq(!StringHelper.isEmpty(input.getWorkordercode()), CallLog::getWorkordercode, input.getWorkordercode());
|
|
|
113
|
+ qw.orderByDesc(CallLog::getId);
|
|
|
114
|
+
|
|
|
115
|
+ var list=calllogService.getList(qw);
|
|
|
116
|
+
|
|
|
117
|
+ List<CallLogExportView> callLogView= JSON.parseArray(JSON.toJSONString(list),CallLogExportView.class);
|
|
|
118
|
+ int i=0;
|
|
|
119
|
+ if (callLogView!=null && callLogView.size()>0)
|
|
|
120
|
+ {
|
|
|
121
|
+ for (CallLogExportView callLog : callLogView) {
|
|
|
122
|
+ if (callLog.getEndTime()!=null&& callLog.getCreateTime()!=null)
|
|
|
123
|
+ {
|
|
|
124
|
+ long SECONDSDiff = ChronoUnit.SECONDS.between(callLog.getCreateTime().toInstant(), callLog.getEndTime().toInstant());
|
|
|
125
|
+ callLog.setLongTime(SECONDSDiff);
|
|
|
126
|
+ }
|
|
|
127
|
+ if (list.get(i ).getCallType()==0)
|
|
|
128
|
+ {
|
|
|
129
|
+ callLog.setCallTypeName("呼入");
|
|
|
130
|
+ }
|
|
|
131
|
+ else
|
|
|
132
|
+ {
|
|
|
133
|
+ callLog.setCallTypeName("呼出");
|
|
|
134
|
+ }
|
|
|
135
|
+ if(list.get(i ).getMyd()!=null&&list.get(i ).getMyd()>0)
|
|
|
136
|
+ {
|
|
|
137
|
+ if (list.get(i ).getMyd()==1)
|
|
|
138
|
+ {
|
|
|
139
|
+ callLog.setMyd("满意");
|
|
|
140
|
+ }
|
|
|
141
|
+ else if (list.get(i ).getMyd()==2)
|
|
|
142
|
+ {
|
|
|
143
|
+ callLog.setMyd("基本满意");
|
|
|
144
|
+ }
|
|
|
145
|
+ else
|
|
|
146
|
+ {
|
|
|
147
|
+ callLog.setMyd("不满意");
|
|
|
148
|
+ }
|
|
|
149
|
+ }
|
|
|
150
|
+
|
|
|
151
|
+ i++;
|
|
|
152
|
+ }
|
|
|
153
|
+ }
|
|
|
154
|
+ ExcelHelper<CallLogExportView> excel = new ExcelHelper<>(CallLogExportView.class);
|
|
|
155
|
+ excel.exportExcel("xlsx", callLogView);
|
|
|
156
|
+ }
|
|
|
157
|
+
|
|
|
158
|
+
|
|
86
|
159
|
@ApiOperation("详情")
|
|
87
|
160
|
@Log(title = "查询通话记录表详情",businessType = BusinessType.QUERY)
|
|
88
|
161
|
@GetMapping("/{id}")
|