zhoufan лет назад: 2
Родитель
Сommit
05bce9cb7a

+ 107 - 0
zxkf-api/src/main/java/api/controller/call/CallLogController.java

@@ -0,0 +1,107 @@
1
+package api.controller.call;
2
+
3
+import api.entity.database.call.Record;
4
+import api.service.system.IConfigService;
5
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
6
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
7
+import com.baomidou.mybatisplus.core.metadata.IPage;
8
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
9
+import api.controller.BaseController;
10
+import api.entity.database.call.CallLog;
11
+import api.entity.input.PageInput;
12
+import api.model.AjaxResult;
13
+import api.service.call.ICallLogService;
14
+import api.util.annotation.Log;
15
+import api.util.enums.BusinessType;
16
+import api.util.helper.StringHelper;
17
+import io.swagger.annotations.Api;
18
+import io.swagger.annotations.ApiOperation;
19
+import org.springframework.beans.factory.annotation.Autowired;
20
+import org.springframework.web.bind.annotation.*;
21
+import java.util.Arrays;
22
+import java.util.List;
23
+
24
+@Api(value = "通话记录表",tags = "通话记录表")
25
+@RestController
26
+@RequestMapping("/call/calllog")
27
+public class CallLogController extends BaseController {
28
+    @Autowired
29
+    private ICallLogService calllogService;
30
+    @Autowired
31
+    private IConfigService configService;
32
+
33
+    @ApiOperation("列表")
34
+    @Log(title = "查询通话记录表列表",businessType = BusinessType.QUERY)
35
+    @GetMapping
36
+    public AjaxResult getList(CallLog input, PageInput pageInput) {
37
+        LambdaQueryWrapper<CallLog> qw = new LambdaQueryWrapper();
38
+        qw.eq(input.getActionId() != null && input.getActionId() > 0, CallLog::getActionId, input.getActionId());
39
+        qw.eq(!StringHelper.isEmpty(input.getCallerAgent()), CallLog::getCallerAgent, input.getCallerAgent());
40
+        qw.eq(!StringHelper.isEmpty(input.getCaller()), CallLog::getCaller, input.getCaller());
41
+        qw.eq(!StringHelper.isEmpty(input.getTrunkNum()), CallLog::getTrunkNum, input.getTrunkNum());
42
+        qw.eq(!StringHelper.isEmpty(input.getCalleeAgent()), CallLog::getCalleeAgent, input.getCalleeAgent());
43
+        qw.eq(!StringHelper.isEmpty(input.getCallee()), CallLog::getCallee, input.getCallee());
44
+        qw.eq(!StringHelper.isEmpty(input.getGroupNo()), CallLog::getGroupNo, input.getGroupNo());
45
+        qw.eq(input.getCallType() != null && input.getCallType() > 0, CallLog::getCallType, input.getCallType());
46
+        qw.eq(input.getCreateTime() != null , CallLog::getCreateTime, input.getCreateTime());
47
+        qw.eq(input.getIsAnswer() != null && input.getIsAnswer() > 0, CallLog::getIsAnswer, input.getIsAnswer());
48
+        qw.eq(input.getOpType() != null && input.getOpType() > 0, CallLog::getOpType, input.getOpType());
49
+        qw.eq(input.getMyd() != null && input.getMyd() > 0, CallLog::getMyd, input.getMyd());
50
+        qw.eq(!StringHelper.isEmpty(input.getWorkordercode()), CallLog::getWorkordercode, input.getWorkordercode());
51
+        qw.orderByDesc(CallLog::getId);
52
+        if (pageInput.getPageNum()==null){pageInput.setPageNum(1);}
53
+        if (pageInput.getPageSize()==null){pageInput.setPageSize(10);}
54
+        Page<CallLog> page = GetPage(pageInput);
55
+        IPage<CallLog> iPage = calllogService.getListPage(page, qw);
56
+        List<CallLog> list=iPage.getRecords();
57
+        //添加录音路径
58
+        if (list!=null && list.size()>0)
59
+        {
60
+            String[] FileUrls = configService.selectCaptchaEnabled("FileUrl").split("|");
61
+            for (CallLog callLog : list) {
62
+                if (!StringHelper.isEmpty(callLog.getRecordPath())) {
63
+                    callLog.setRecordPath(FileUrls[0] + callLog.getRecordPath().replace(FileUrls[1],""));
64
+                }
65
+                if (!StringHelper.isEmpty(callLog.getLeavePath())) {
66
+                    callLog.setLeavePath(FileUrls[0] + callLog.getLeavePath().replace(FileUrls[1],""));
67
+                }
68
+            }
69
+        }
70
+        return Success("成功", list, iPage.getTotal());
71
+    }
72
+
73
+    @ApiOperation("详情")
74
+    @Log(title = "查询通话记录表详情",businessType = BusinessType.QUERY)
75
+    @GetMapping("/{id}")
76
+    public AjaxResult getInfo(@PathVariable long id) {
77
+        return Success("成功", calllogService.getEntity(id));
78
+    }
79
+
80
+    @ApiOperation("删除")
81
+    @Log(title = "删除通话记录表",businessType = BusinessType.DELETE)
82
+    @DeleteMapping("/{ids}")
83
+    public AjaxResult delete(@PathVariable Long[] ids)  {
84
+        boolean result = calllogService.delete(Arrays.asList(ids));
85
+        if (result) {
86
+            return Success("成功");
87
+        } else {
88
+            return Error("删除失败");
89
+        }
90
+    }
91
+
92
+    @ApiOperation("更新工单号")
93
+    @Log(title = "更新工单号", businessType = BusinessType.UPDATE)
94
+    @PostMapping("/{uuid}")
95
+    public AjaxResult updateWorkOrderCode(@PathVariable String uuid,@RequestBody String input) {
96
+        LambdaUpdateWrapper<CallLog> qw = new LambdaUpdateWrapper<>();
97
+        qw.eq(CallLog::getUuid, uuid);
98
+        qw.set(CallLog::getWorkordercode,input);
99
+        boolean result = calllogService.updateBatch(qw);
100
+        if (result) {
101
+            return Success("成功");
102
+        } else {
103
+            return Error("保存失败");
104
+        }
105
+    }
106
+
107
+}

+ 26 - 25
zxkf-api/src/main/java/api/controller/call/RecordController.java

@@ -28,7 +28,7 @@ public class RecordController extends BaseController {
28 28
     private IConfigService configService;
29 29
 
30 30
     @ApiOperation("列表")
31
-    @Log(title = "查询通话记录表列表",businessType = BusinessType.QUERY)
31
+    @Log(title = "查询通话记录表列表", businessType = BusinessType.QUERY)
32 32
     @GetMapping
33 33
     public AjaxResult getList(Record input, PageInput pageInput) {
34 34
         LambdaQueryWrapper<Record> qw = new LambdaQueryWrapper<>();
@@ -40,20 +40,20 @@ public class RecordController extends BaseController {
40 40
         qw.eq(input.getCallType() != null && input.getCallType() > 0, Record::getCallType, input.getCallType());
41 41
         qw.eq(input.getCallState() != null && input.getCallState() > 0, Record::getCallState, input.getCallState());
42 42
         qw.eq(input.getDealType() != null && input.getDealType() > 0, Record::getDealType, input.getDealType());
43
-        qw.ge(input.getBeginTime() != null , Record::getBeginTime, input.getBeginTime());
44
-        qw.ge (input.getIvrStartTime() != null , Record::getIvrStartTime, input.getIvrStartTime());
45
-        qw.le(input.getIvrEndTime() != null , Record::getIvrEndTime, input.getIvrEndTime());
43
+        qw.ge(input.getBeginTime() != null, Record::getBeginTime, input.getBeginTime());
44
+        qw.ge(input.getIvrStartTime() != null, Record::getIvrStartTime, input.getIvrStartTime());
45
+        qw.le(input.getIvrEndTime() != null, Record::getIvrEndTime, input.getIvrEndTime());
46 46
         qw.eq(input.getIvrLongTime() != null && input.getIvrLongTime() > 0, Record::getIvrLongTime, input.getIvrLongTime());
47
-        qw.ge(input.getWaitStartTime() != null , Record::getWaitStartTime, input.getWaitStartTime());
48
-        qw.le(input.getWaitEndTime() != null , Record::getWaitEndTime, input.getWaitEndTime());
47
+        qw.ge(input.getWaitStartTime() != null, Record::getWaitStartTime, input.getWaitStartTime());
48
+        qw.le(input.getWaitEndTime() != null, Record::getWaitEndTime, input.getWaitEndTime());
49 49
         qw.eq(input.getWaitLongTime() != null && input.getWaitLongTime() > 0, Record::getWaitLongTime, input.getWaitLongTime());
50
-        qw.ge(input.getRingStartTime() != null , Record::getRingStartTime, input.getRingStartTime());
51
-        qw.le(input.getRingEndTime() != null , Record::getRingEndTime, input.getRingEndTime());
50
+        qw.ge(input.getRingStartTime() != null, Record::getRingStartTime, input.getRingStartTime());
51
+        qw.le(input.getRingEndTime() != null, Record::getRingEndTime, input.getRingEndTime());
52 52
         qw.eq(input.getRingLongTime() != null && input.getRingLongTime() > 0, Record::getRingLongTime, input.getRingLongTime());
53
-        qw.ge(input.getTalkStartTime() != null , Record::getTalkStartTime, input.getTalkStartTime());
54
-        qw.le(input.getTalkEndTime() != null , Record::getTalkEndTime, input.getTalkEndTime());
53
+        qw.ge(input.getTalkStartTime() != null, Record::getTalkStartTime, input.getTalkStartTime());
54
+        qw.le(input.getTalkEndTime() != null, Record::getTalkEndTime, input.getTalkEndTime());
55 55
         qw.eq(input.getTalkLongTime() != null && input.getTalkLongTime() > 0, Record::getTalkLongTime, input.getTalkLongTime());
56
-        qw.le(input.getEndTime() != null , Record::getEndTime, input.getEndTime());
56
+        qw.le(input.getEndTime() != null, Record::getEndTime, input.getEndTime());
57 57
         qw.eq(input.getLongTime() != null && input.getLongTime() > 0, Record::getLongTime, input.getLongTime());
58 58
         qw.eq(input.getGroupId() != null && input.getGroupId() > 0, Record::getGroupId, input.getGroupId());
59 59
         qw.eq(input.getUserId() != null && input.getUserId() > 0, Record::getUserId, input.getUserId());
@@ -66,36 +66,39 @@ public class RecordController extends BaseController {
66 66
         qw.eq(input.getActionType() != null && input.getActionType() > 0, Record::getActionType, input.getActionType());
67 67
         qw.like(!StringHelper.isEmpty(input.getWorkorderId()), Record::getWorkorderId, input.getWorkorderId());
68 68
         qw.orderByDesc(Record::getRecordId);
69
-        if (pageInput.getPageNum()==null){pageInput.setPageNum(1);}
70
-        if (pageInput.getPageSize()==null){pageInput.setPageNum(10);}
69
+        if (pageInput.getPageNum() == null) {
70
+            pageInput.setPageNum(1);
71
+        }
72
+        if (pageInput.getPageSize() == null) {
73
+            pageInput.setPageNum(10);
74
+        }
71 75
         Page<Record> page = GetPage(pageInput);
72 76
         String captchaEnabled = configService.selectCaptchaEnabled("FileUrl");
73 77
         List<Record> Records;
74 78
         IPage<Record> iPage = recordService.getListPage(page, qw);
75 79
         Records = iPage.getRecords();
76 80
         //添加录音路径
77
-        if (Records!=null && Records.size()>0)
78
-        {
81
+        if (Records != null && Records.size() > 0) {
79 82
             for (Record record : Records) {
80 83
                 if (!StringHelper.isEmpty(record.getFilePath())) {
81 84
                     record.setFilePath(captchaEnabled + record.getFilePath());
82 85
                 }
83 86
             }
84 87
         }
85
-        return Success("成功", Records,iPage.getTotal());
88
+        return Success("成功", Records, iPage.getTotal());
86 89
     }
87 90
 
88 91
     @ApiOperation("详情")
89
-    @Log(title = "查询通话记录表详情",businessType = BusinessType.QUERY)
92
+    @Log(title = "查询通话记录表详情", businessType = BusinessType.QUERY)
90 93
     @GetMapping("/{id}")
91 94
     public AjaxResult getInfo(@PathVariable long id) {
92 95
         return Success("成功", recordService.getEntity(id));
93 96
     }
94 97
 
95 98
     @ApiOperation("删除")
96
-    @Log(title = "删除通话记录表",businessType = BusinessType.DELETE)
99
+    @Log(title = "删除通话记录表", businessType = BusinessType.DELETE)
97 100
     @DeleteMapping("/{ids}")
98
-    public AjaxResult delete(@PathVariable Long[] ids)  {
101
+    public AjaxResult delete(@PathVariable Long[] ids) {
99 102
         boolean result = recordService.delete(Arrays.asList(ids));
100 103
         if (result) {
101 104
             return Success("成功");
@@ -105,14 +108,14 @@ public class RecordController extends BaseController {
105 108
     }
106 109
 
107 110
     @ApiOperation("编辑")
108
-    @Log(title = "编辑通话记录",businessType = BusinessType.UPDATE)
111
+    @Log(title = "编辑通话记录", businessType = BusinessType.UPDATE)
109 112
     @PutMapping
110
-    public AjaxResult edit(@RequestBody Record input)  {
113
+    public AjaxResult edit(@RequestBody Record input) {
111 114
         LambdaQueryWrapper<Record> qw = new LambdaQueryWrapper<>();
112 115
         qw.eq(Record::getCallId, input.getCallId());
113 116
 
114
-     Record  record= recordService.getEntity(qw);
115
-     record.setWorkorderId(input.getWorkorderId());
117
+        Record record = recordService.getEntity(qw);
118
+        record.setWorkorderId(input.getWorkorderId());
116 119
         boolean result = recordService.update(record);
117 120
         if (result) {
118 121
             return Success("成功");
@@ -120,6 +123,4 @@ public class RecordController extends BaseController {
120 123
             return Error("修改失败");
121 124
         }
122 125
     }
123
-
124
-
125 126
 }

+ 86 - 0
zxkf-entity/src/main/java/api/entity/database/call/CallLog.java

@@ -0,0 +1,86 @@
1
+package api.entity.database.call;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import io.swagger.annotations.ApiModel;
7
+import io.swagger.annotations.ApiModelProperty;
8
+import lombok.Data;
9
+import java.util.Date;
10
+
11
+/** 通话记录表 */
12
+@ApiModel(value = "CallLog", description = "通话记录表实体")
13
+@Data
14
+@TableName("rep_cdr")
15
+public class CallLog {
16
+    /** id */
17
+    @ApiModelProperty("id")
18
+    @TableId(type = IdType.AUTO)
19
+    private Long id;
20
+    /** 会话标识,进行转移时会重复出现,这时和action_id一起可以组成唯一值 */
21
+    @ApiModelProperty("会话标识,进行转移时会重复出现,这时和action_id一起可以组成唯一值")
22
+    private String uuid;
23
+    /** 会话标识,uuid+action_id 组合成唯一值 */
24
+    @ApiModelProperty("会话标识,uuid+action_id 组合成唯一值")
25
+    private Long actionId;
26
+    /** 主叫坐席工号,分机为主叫且签入才会有值,否则为空 */
27
+    @ApiModelProperty("主叫坐席工号,分机为主叫且签入才会有值,否则为空")
28
+    private String callerAgent;
29
+    /** 主叫号码,分机号或者手机号 */
30
+    @ApiModelProperty("主叫号码,分机号或者手机号")
31
+    private String caller;
32
+    /** 中继号,手机号呼入系统时拨打号码(底号) */
33
+    @ApiModelProperty("中继号,手机号呼入系统时拨打号码(底号)")
34
+    private String trunkNum;
35
+    /** 被叫坐席工号,分机为被叫且签入才会有值,否则为空 */
36
+    @ApiModelProperty("被叫坐席工号,分机为被叫且签入才会有值,否则为空")
37
+    private String calleeAgent;
38
+    /** 被叫号码,分机号或手机号 */
39
+    @ApiModelProperty("被叫号码,分机号或手机号")
40
+    private String callee;
41
+    /** 被叫坐席组 */
42
+    @ApiModelProperty("被叫坐席组")
43
+    private String groupNo;
44
+    /** 呼叫类型,0呼入(外线即手机号打进系统),1呼出 */
45
+    @ApiModelProperty("呼叫类型,0呼入(外线即手机号打进系统),1呼出")
46
+    private Long callType;
47
+    /** 呼入系统时间 */
48
+    @ApiModelProperty("呼入系统时间")
49
+    private Date createTime;
50
+    /** 被叫振铃时间 */
51
+    @ApiModelProperty("被叫振铃时间")
52
+    private Date ringTime;
53
+    /** 被叫应答时间 */
54
+    @ApiModelProperty("被叫应答时间")
55
+    private Date answerTime;
56
+    /** 被叫是否接听 */
57
+    @ApiModelProperty("被叫是否接听")
58
+    private Long isAnswer;
59
+    /** 坐席挂机时间 */
60
+    @ApiModelProperty("坐席挂机时间")
61
+    private Date endTime;
62
+    /** 外线挂机时间 */
63
+    @ApiModelProperty("外线挂机时间")
64
+    private Date hangupTime;
65
+    /** 操作类型,转移,会议,留言 */
66
+    @ApiModelProperty("操作类型,转移,会议,留言")
67
+    private Long opType;
68
+    /** 挂机原因,意义不大 */
69
+    @ApiModelProperty("挂机原因,意义不大")
70
+    private String hangupCause;
71
+    /** 满意度,1,2,3 */
72
+    @ApiModelProperty("满意度,1,2,3")
73
+    private Long myd;
74
+    /** 目前只用来记录是否是黑名单,记录内容为“blacklist” */
75
+    @ApiModelProperty("目前只用来记录是否是黑名单,记录内容为“blacklist”")
76
+    private String note;
77
+    /** 录音路径 */
78
+    @ApiModelProperty("录音路径")
79
+    private String recordPath;
80
+    /** 留言路径 */
81
+    @ApiModelProperty("留言路径")
82
+    private String leavePath;
83
+    /** 工单号 */
84
+    @ApiModelProperty("工单号")
85
+    private String workordercode;
86
+}

+ 9 - 0
zxkf-mapper/src/main/java/api/mapper/call/CallLogMapper.java

@@ -0,0 +1,9 @@
1
+package api.mapper.call;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import api.entity.database.call.CallLog;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+@Mapper
8
+public interface CallLogMapper extends BaseMapper<CallLog> {
9
+}

+ 7 - 0
zxkf-service/src/main/java/api/service/call/ICallLogService.java

@@ -0,0 +1,7 @@
1
+package api.service.call;
2
+
3
+import api.entity.database.call.CallLog;
4
+import api.service.IBaseService;
5
+
6
+public interface ICallLogService extends IBaseService<CallLog> {
7
+}

+ 14 - 0
zxkf-service/src/main/java/api/service/call/impl/CallLogServiceImpl.java

@@ -0,0 +1,14 @@
1
+package api.service.call.impl;
2
+
3
+import api.entity.database.call.CallLog;
4
+import api.mapper.call.CallLogMapper;
5
+import api.service.call.ICallLogService;
6
+import api.service.BaseServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+import org.springframework.transaction.annotation.Transactional;
9
+
10
+@Transactional
11
+@Service
12
+public class CallLogServiceImpl extends BaseServiceImpl<CallLogMapper, CallLog> implements ICallLogService{
13
+    public CallLogServiceImpl(){ super(false); }
14
+}