瀏覽代碼

Merge remote-tracking branch 'origin/master'

liyuanyuan 2 年之前
父節點
當前提交
3f8c4e3c71

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

@@ -132,6 +132,18 @@ public class CallLogController extends BaseController {
132 132
                 {
133 133
                     callLog.setCallTypeName("呼出");
134 134
                 }
135
+              if (list.get(i ).getIsAnswer()!=null)
136
+              {
137
+                  if (list.get(i ).getIsAnswer()==0)
138
+                  {
139
+                      callLog.setIsAnswerName("否");
140
+                  }
141
+                  else
142
+                  {
143
+                      callLog.setIsAnswerName("是");
144
+                  }
145
+              }
146
+
135 147
                 if(list.get(i ).getMyd()!=null&&list.get(i ).getMyd()>0)
136 148
                 {
137 149
                     if (list.get(i ).getMyd()==1)

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

@@ -26,7 +26,7 @@ import api.util.annotation.Log;
26 26
 import api.util.enums.BusinessType;
27 27
 import api.util.helper.StringHelper;
28 28
 
29
-import com.sun.org.apache.bcel.internal.generic.SWITCH;
29
+
30 30
 import io.swagger.annotations.Api;
31 31
 import io.swagger.annotations.ApiOperation;
32 32
 

+ 58 - 0
zxkf-api/src/main/java/api/controller/system/CustomerController.java

@@ -1,10 +1,14 @@
1 1
 package api.controller.system;
2 2
 
3
+import api.entity.database.call.CallLog;
3 4
 import api.entity.database.system.DictData;
5
+import api.entity.view.call.CallLogExportView;
4 6
 import api.entity.view.order.WorkOrderBaseView;
5 7
 import api.entity.view.system.CustomerView;
8
+import api.entity.view.system.CustomerViewExportView;
6 9
 import api.service.system.IDictDataService;
7 10
 import api.util.annotation.Anonymous;
11
+import api.util.helper.ExcelHelper;
8 12
 import com.alibaba.fastjson2.JSON;
9 13
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
10 14
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -23,6 +27,7 @@ import lombok.var;
23 27
 import org.springframework.beans.factory.annotation.Autowired;
24 28
 import org.springframework.web.bind.annotation.*;
25 29
 
30
+import java.time.temporal.ChronoUnit;
26 31
 import java.util.ArrayList;
27 32
 import java.util.Arrays;
28 33
 import java.util.Date;
@@ -77,7 +82,60 @@ public class CustomerController extends BaseController {
77 82
             return Success("成功", customerService.getList(qw));
78 83
         }
79 84
     }
85
+    @ApiOperation("导出Excel")
86
+    @Log(title = "导出excel", businessType = BusinessType.EXPORT)
87
+    @GetMapping("/exportExcel")
88
+    @Anonymous
89
+    public void ExportExcel(Customer input) {
90
+        LambdaQueryWrapper<Customer> qw = new LambdaQueryWrapper<>();
91
+        qw.eq(input.getCustomerId() != null && input.getCustomerId() > 0, Customer::getCustomerId, input.getCustomerId());
92
+        qw.like(!StringHelper.isEmpty(input.getCustomerName()), Customer::getCustomerName, input.getCustomerName());
93
+        qw.eq(!StringHelper.isEmpty(input.getCustomerSex()), Customer::getCustomerSex, input.getCustomerSex());
94
+        qw.like(!StringHelper.isEmpty(input.getCustomerPhone()), Customer::getCustomerPhone, input.getCustomerPhone());
95
+        qw.like(!StringHelper.isEmpty(input.getCustomerMobile()), Customer::getCustomerMobile, input.getCustomerMobile());
96
+        qw.like(!StringHelper.isEmpty(input.getCustomerNumber()), Customer::getCustomerNumber, input.getCustomerNumber());
97
+        qw.like(!StringHelper.isEmpty(input.getRemarks()), Customer::getRemarks, input.getRemarks());
98
+        qw.eq(Customer::getFIsdelete, 0);
99
+        qw.eq(input.getFCreatetime() != null , Customer::getFCreatetime, input.getFCreatetime());
100
+        qw.eq(input.getFUpdatetime() != null , Customer::getFUpdatetime, input.getFUpdatetime());
101
+        qw.eq(input.getType() != null && input.getType() > 0, Customer::getType, input.getType());
102
+        qw.like(!StringHelper.isEmpty(input.getIcon()), Customer::getIcon, input.getIcon());
103
+        qw.orderByDesc(Customer::getCustomerId);
104
+
105
+        var list=customerService.getList(qw);
80 106
 
107
+        List<CustomerViewExportView>  customerView=  JSON.parseArray(JSON.toJSONString(list),CustomerViewExportView.class);
108
+        int i=0;
109
+        if (customerView!=null && customerView.size()>0)
110
+        {
111
+            for (CustomerViewExportView customer : customerView) {
112
+
113
+                if (list.get(i ).getType()!=null)
114
+                {
115
+                    if (list.get(i ).getType()==1)
116
+                    {
117
+                        customer.setTypeName("普通");
118
+                    }
119
+                    else if (list.get(i ).getType()==2)
120
+                    {
121
+                        customer.setTypeName("微信");
122
+                    }
123
+                    else
124
+                    {
125
+                        customer.setTypeName("官网");
126
+                    }
127
+                    if ( list.get(i ).getProject() != null && list.get(i ).getProject() > 0) {
128
+
129
+                        DictData dicdata = dictDataService.getEntity(list.get(i ).getProject());
130
+                        customer.setProjectname(dicdata.getDictLabel());
131
+                    }
132
+                }
133
+                i++;
134
+            }
135
+        }
136
+        ExcelHelper<CustomerViewExportView> excel = new ExcelHelper<>(CustomerViewExportView.class);
137
+        excel.exportExcel("xlsx", customerView);
138
+    }
81 139
     @ApiOperation("详情")
82 140
     @Log(title = "查询sys_customer详情",businessType = BusinessType.QUERY)
83 141
     @GetMapping("/{id}")

+ 3 - 0
zxkf-api/src/main/java/api/controller/system/WorkroderTypeController.java

@@ -1,5 +1,6 @@
1 1
 package api.controller.system;
2 2
 
3
+import api.entity.database.call.CallLog;
3 4
 import api.entity.database.system.Menu;
4 5
 import api.entity.database.system.WorkroderType;
5 6
 import api.service.system.IWorkroderTypeService;
@@ -44,6 +45,7 @@ public class WorkroderTypeController extends BaseController {
44 45
         qw.eq(input.getCreate_time() != null , WorkroderType::getCreate_time, input.getCreate_time());
45 46
         qw.eq(WorkroderType::getIsDelete, 0);
46 47
         qw.like(!StringHelper.isEmpty(input.getCreateBy()), WorkroderType::getCreateBy, input.getCreateBy());
48
+        qw.orderByDesc(WorkroderType::getTypeOrder);
47 49
         if (pageInput.getPageNum() == null) {
48 50
             pageInput.setPageNum(1);
49 51
         }
@@ -173,6 +175,7 @@ public class WorkroderTypeController extends BaseController {
173 175
     public AjaxResult treeselect(Menu menu) {
174 176
         LambdaQueryWrapper<WorkroderType> qw = new LambdaQueryWrapper<>();
175 177
         qw.eq(WorkroderType::getIsDelete, 0);
178
+        qw.orderByDesc(WorkroderType::getTypeOrder);
176 179
         List<WorkroderType> menus = workrodertypeService.getList(qw);
177 180
         return Success("获取菜单下拉树列表成功", workrodertypeService.buildMenuTreeSelect(menus));
178 181
     }

+ 1 - 1
zxkf-entity/src/main/java/api/entity/view/call/CallLogExportView.java

@@ -37,7 +37,7 @@ public class CallLogExportView {
37 37
     private Date answerTime;
38 38
     /** 被叫是否接听 */
39 39
     @ApiModelProperty("被叫是否接听")
40
-    private Long isAnswer;
40
+    private String  isAnswerName;
41 41
     /** 坐席挂机时间 */
42 42
     @ApiModelProperty("坐席挂机时间")
43 43
     private Date endTime;

+ 31 - 0
zxkf-entity/src/main/java/api/entity/view/system/CustomerViewExportView.java

@@ -0,0 +1,31 @@
1
+package api.entity.view.system;
2
+
3
+import io.swagger.annotations.ApiModelProperty;
4
+import lombok.Data;
5
+
6
+import java.util.Date;
7
+@Data
8
+public class CustomerViewExportView {
9
+
10
+    /** 姓名 */
11
+    @ApiModelProperty("姓名")
12
+    private String customerName;
13
+    /** 性别 */
14
+    @ApiModelProperty("性别")
15
+    private String customerSex;
16
+
17
+    /** 一键通 */
18
+    @ApiModelProperty("电话")
19
+    private String customerPhone;
20
+
21
+    @ApiModelProperty("公司")
22
+    private String company;
23
+    @ApiModelProperty("项目名")
24
+    private String projectname;
25
+    /** 类型 */
26
+    @ApiModelProperty("类型") //1系统添加2微信3网站
27
+    private String typeName;
28
+
29
+    @ApiModelProperty("创建时间")
30
+    private Date fCreatetime;
31
+}