Browse Source

通话时长,创建时间

1550076451 2 years ago
parent
commit
37943e15e3

+ 17 - 4
zxkf-api/src/main/java/api/controller/call/CallLogController.java

@@ -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("详情")

+ 4 - 6
zxkf-api/src/main/java/api/controller/order/WorkOrderBaseController.java

@@ -24,21 +24,19 @@ import api.service.order.IWorkOrderBaseService;
24 24
 import api.util.annotation.Log;
25 25
 import api.util.enums.BusinessType;
26 26
 import api.util.helper.StringHelper;
27
-import com.sun.org.apache.bcel.internal.generic.SWITCH;
27
+
28 28
 import io.swagger.annotations.Api;
29 29
 import io.swagger.annotations.ApiOperation;
30
-import lombok.var;
30
+
31 31
 import org.springframework.beans.factory.annotation.Autowired;
32
-import org.springframework.beans.propertyeditors.CurrencyEditor;
32
+
33 33
 import org.springframework.web.bind.annotation.*;
34 34
 
35 35
 import java.net.InetAddress;
36 36
 import java.net.UnknownHostException;
37 37
 import java.text.SimpleDateFormat;
38 38
 import java.time.LocalDate;
39
-import java.time.LocalDateTime;
40
-import java.time.LocalTime;
41
-import java.time.format.DateTimeFormatter;
39
+
42 40
 import java.util.*;
43 41
 //待交办1 ; 待接单(没有处理人的时候)2; 待处理3; 待审核 4 ;待回访5 ;已完结6;
44 42
 @Api(value = "wo_workorderbase",tags = "wo_workorderbase")

+ 5 - 2
zxkf-api/src/main/java/api/controller/system/WorkroderTypeController.java

@@ -3,6 +3,7 @@ package api.controller.system;
3 3
 import api.entity.database.system.Menu;
4 4
 import api.entity.database.system.WorkroderType;
5 5
 import api.service.system.IWorkroderTypeService;
6
+import api.util.annotation.Anonymous;
6 7
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
7 8
 import com.baomidou.mybatisplus.core.metadata.IPage;
8 9
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -40,7 +41,7 @@ public class WorkroderTypeController extends BaseController {
40 41
         qw.like(!StringHelper.isEmpty(input.getAncestors()), WorkroderType::getAncestors, input.getAncestors());
41 42
         qw.like(!StringHelper.isEmpty(input.getTypeName()), WorkroderType::getTypeName, input.getTypeName());
42 43
         qw.eq(input.getTypeOrder() != null && input.getTypeOrder() > 0, WorkroderType::getTypeOrder, input.getTypeOrder());
43
-        qw.eq(input.getCrateTime() != null , WorkroderType::getCrateTime, input.getCrateTime());
44
+        qw.eq(input.getCreate_time() != null , WorkroderType::getCreate_time, input.getCreate_time());
44 45
         qw.eq(WorkroderType::getIsDelete, 0);
45 46
         qw.like(!StringHelper.isEmpty(input.getCreateBy()), WorkroderType::getCreateBy, input.getCreateBy());
46 47
         if (pageInput.getPageNum() == null) {
@@ -85,10 +86,11 @@ public class WorkroderTypeController extends BaseController {
85 86
         else
86 87
         {
87 88
             input.setAncestors("0");
89
+            input.setParentId(0l);
88 90
         }
89 91
 
90 92
         input.setIsDelete(0L);
91
-        input.setCrateTime(currentDate);
93
+        input.setCreate_time(currentDate);
92 94
         input.setCreateBy(CurrentUser().getUserId().toString());
93 95
         boolean result = workrodertypeService.insert(input);
94 96
         if (result) {
@@ -138,6 +140,7 @@ public class WorkroderTypeController extends BaseController {
138 140
             return Error(error.toString());
139 141
         }
140 142
     }
143
+
141 144
     @GetMapping("/treeselect")
142 145
     public AjaxResult treeselect(Menu menu) {
143 146
         LambdaQueryWrapper<WorkroderType> qw = new LambdaQueryWrapper<>();

+ 1 - 2
zxkf-entity/src/main/java/api/entity/database/call/CallLog.java

@@ -85,6 +85,5 @@ public class CallLog {
85 85
     @ApiModelProperty("工单号")
86 86
     private String workordercode;
87 87
 
88
-    @TableField(exist = false)
89
-    private Long longTime;
88
+
90 89
 }

+ 1 - 1
zxkf-entity/src/main/java/api/entity/database/system/WorkroderType.java

@@ -39,7 +39,7 @@ public class WorkroderType {
39 39
     private Long typeOrder;
40 40
     /** crate_time */
41 41
     @ApiModelProperty("crate_time")
42
-    private Date crateTime;
42
+    private Date create_time;
43 43
     /** is_delete */
44 44
     @ApiModelProperty("is_delete")
45 45
     private Long isDelete;

+ 12 - 0
zxkf-entity/src/main/java/api/entity/view/call/CallLogView.java

@@ -0,0 +1,12 @@
1
+package api.entity.view.call;
2
+
3
+import api.entity.database.call.CallLog;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.Data;
6
+
7
+@Data
8
+public class CallLogView extends CallLog {
9
+    private long longTime;
10
+
11
+
12
+}