|
|
@@ -1,6 +1,9 @@
|
|
1
|
1
|
package api.controller.call;
|
|
2
|
2
|
|
|
|
3
|
+import api.entity.view.call.CallLogView;
|
|
3
|
4
|
import api.service.system.IConfigService;
|
|
|
5
|
+import api.util.annotation.Anonymous;
|
|
|
6
|
+import com.alibaba.fastjson2.JSON;
|
|
4
|
7
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
5
|
8
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
6
|
9
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
@@ -17,6 +20,10 @@ import io.swagger.annotations.Api;
|
|
17
|
20
|
import io.swagger.annotations.ApiOperation;
|
|
18
|
21
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
19
|
22
|
import org.springframework.web.bind.annotation.*;
|
|
|
23
|
+
|
|
|
24
|
+import java.time.Duration;
|
|
|
25
|
+import java.time.temporal.ChronoUnit;
|
|
|
26
|
+import java.time.temporal.Temporal;
|
|
20
|
27
|
import java.util.Arrays;
|
|
21
|
28
|
import java.util.List;
|
|
22
|
29
|
|
|
|
@@ -54,20 +61,26 @@ public class CallLogController extends BaseController {
|
|
54
|
61
|
Page<CallLog> page = GetPage(pageInput);
|
|
55
|
62
|
IPage<CallLog> iPage = calllogService.getListPage(page, qw);
|
|
56
|
63
|
List<CallLog> list=iPage.getRecords();
|
|
|
64
|
+ List<CallLogView> callLogView= JSON.parseArray(JSON.toJSONString(list),CallLogView.class);
|
|
57
|
65
|
//添加录音路径
|
|
58
|
|
- if (list!=null && list.size()>0)
|
|
|
66
|
+ if (callLogView!=null && callLogView.size()>0)
|
|
59
|
67
|
{
|
|
60
|
|
- String[] FileUrls = configService.selectCaptchaEnabled("FileUrl").split("|");
|
|
61
|
|
- for (CallLog callLog : list) {
|
|
|
68
|
+ String[] FileUrls = configService.selectCaptchaEnabled("FileUrl").split("\\|");
|
|
|
69
|
+ for (CallLogView callLog : callLogView) {
|
|
62
|
70
|
if (!StringHelper.isEmpty(callLog.getRecordPath())) {
|
|
63
|
71
|
callLog.setRecordPath(FileUrls[0] + callLog.getRecordPath().replace(FileUrls[1],""));
|
|
64
|
72
|
}
|
|
65
|
73
|
if (!StringHelper.isEmpty(callLog.getLeavePath())) {
|
|
66
|
74
|
callLog.setLeavePath(FileUrls[0] + callLog.getLeavePath().replace(FileUrls[1],""));
|
|
67
|
75
|
}
|
|
|
76
|
+ if (callLog.getEndTime()!=null&& callLog.getCreateTime()!=null)
|
|
|
77
|
+ {
|
|
|
78
|
+ long SECONDSDiff = ChronoUnit.SECONDS.between(callLog.getCreateTime().toInstant(), callLog.getEndTime().toInstant());
|
|
|
79
|
+ callLog.setLongTime(SECONDSDiff);
|
|
|
80
|
+ }
|
|
68
|
81
|
}
|
|
69
|
82
|
}
|
|
70
|
|
- return Success("成功", list, iPage.getTotal());
|
|
|
83
|
+ return Success("成功", callLogView, iPage.getTotal());
|
|
71
|
84
|
}
|
|
72
|
85
|
|
|
73
|
86
|
@ApiOperation("详情")
|