胡轶钦 5 年之前
父節點
當前提交
9bb5d50f34

+ 6
- 5
src/main/java/com.huiju.welcome/controller/TaMainUsherRecordController.java 查看文件

@@ -29,6 +29,7 @@ import javax.servlet.http.HttpServletResponse;
29 29
 import java.io.IOException;
30 30
 import java.time.LocalDateTime;
31 31
 import java.time.format.DateTimeFormatter;
32
+import java.util.Date;
32 33
 import java.util.List;
33 34
 
34 35
 /**
@@ -309,8 +310,8 @@ public class TaMainUsherRecordController extends BaseController {
309 310
      */
310 311
     @RequestMapping(value="/excel/usherListExcel",method= RequestMethod.GET)
311 312
     public void exportCustomerExcel(@RequestParam(value = "personName" ,required = false)String personName,
312
-                                    @RequestParam(value = "startTime",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startTime,
313
-                                    @RequestParam(value = "endTime",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endTime,
313
+                                    @RequestParam(value = "startTime",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) Date startTime,
314
+                                    @RequestParam(value = "endTime",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) Date endTime,
314 315
                                     @RequestParam(value = "customerType" ,required = false)String customerType,
315 316
                                     @RequestParam(value = "customerSource" ,required = false)Integer customerSource,
316 317
                                     @RequestParam(value = "receiver" ,required = false)String receiver,
@@ -328,7 +329,7 @@ public class TaMainUsherRecordController extends BaseController {
328 329
             response.setCharacterEncoding("utf-8");
329 330
             response.setHeader("Content-disposition", "attachment;filename="+fileName+".xlsx");
330 331
             ExcelWriter writer = new ExcelWriter(out, ExcelTypeEnum.XLSX, true);
331
-            Sheet sheet1 = new Sheet(1, 0, CustomerExcel.class);
332
+            Sheet sheet1 = new Sheet(1, 0, UsherRecordExcel.class);
332 333
             writer.write(result, sheet1);
333 334
             writer.finish();
334 335
 
@@ -342,8 +343,8 @@ public class TaMainUsherRecordController extends BaseController {
342 343
     public ResponseBean usherRecords(@RequestParam(defaultValue = "1") int pageNum,
343 344
                                  @RequestParam(defaultValue = "10") int pageSize,
344 345
                                      @RequestParam(value = "personName" ,required = false)String personName,
345
-                                     @RequestParam(value = "startTime",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startTime,
346
-                                     @RequestParam(value = "endTime",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endTime,
346
+                                     @RequestParam(value = "startTime",required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime,
347
+                                     @RequestParam(value = "endTime",required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime,
347 348
                                      @RequestParam(value = "customerType" ,required = false)String customerType,
348 349
                                      @RequestParam(value = "customerSource" ,required = false)Integer customerSource,
349 350
                                      @RequestParam(value = "receiver" ,required = false)String receiver,

+ 2
- 1
src/main/java/com.huiju.welcome/interceptor/AccessInterceptor.java 查看文件

@@ -37,7 +37,8 @@ public class AccessInterceptor implements HandlerInterceptor {
37 37
         "/camera",
38 38
         "/websocket",
39 39
          "/face",
40
-        "/miniapp/login"
40
+        "/miniapp/login",
41
+            "/excel/usherListExcel"
41 42
     };
42 43
 
43 44
     /*

+ 3
- 2
src/main/java/com.huiju.welcome/mapper/TaMainUsherRecordMapper.java 查看文件

@@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Mapper;
7 7
 import org.apache.ibatis.annotations.Param;
8 8
 
9 9
 import java.time.LocalDateTime;
10
+import java.util.Date;
10 11
 import java.util.List;
11 12
 import java.util.Map;
12 13
 
@@ -32,6 +33,6 @@ public interface TaMainUsherRecordMapper extends BaseMapper<TaMainUsherRecord> {
32 33
     List<TaMainUsherRecord> getLastList(@Param("personId") Integer personId, @Param("dt") LocalDateTime dt);
33 34
     IPage<TaMainUsherRecord> taMainUsherRecordList(IPage<TaMainUsherRecord> pg,@Param("phone")String phone,@Param("platNumber")String platNumber,@Param("personName")String personName,@Param("appointment")Integer appointment);
34 35
     Integer getRecIdByCustomerIdCurrentDate(@Param("customerId")Integer customerId);
35
-    IPage<TaMainUsherRecord> usherRecords(IPage<TaMainUsherRecord>pg,@Param("personName") String personName, @Param("phone") String phone, @Param("receiver") String receiver, @Param("customerType") String customerType, @Param("customerSource") Integer customerSource, @Param("startTime")LocalDateTime startTime,@Param("endTime")LocalDateTime endTime);
36
-    List<TaMainUsherRecord> getCustomersEqualCustomerPageExcel(@Param("personName") String personName, @Param("phone") String phone, @Param("receiver") String receiver, @Param("customerType") String customerType, @Param("customerSource") Integer customerSource, @Param("startTime")LocalDateTime startTime,@Param("endTime")LocalDateTime endTime);
36
+    IPage<TaMainUsherRecord> usherRecords(IPage<TaMainUsherRecord>pg, @Param("personName") String personName, @Param("phone") String phone, @Param("receiver") String receiver, @Param("customerType") String customerType, @Param("customerSource") Integer customerSource, @Param("startTime") Date startTime, @Param("endTime")Date endTime);
37
+    List<TaMainUsherRecord> getCustomersEqualCustomerPageExcel(@Param("personName") String personName, @Param("phone") String phone, @Param("receiver") String receiver, @Param("customerType") String customerType, @Param("customerSource") Integer customerSource, @Param("startTime")Date startTime,@Param("endTime")Date endTime);
37 38
 }

+ 3
- 2
src/main/java/com.huiju.welcome/service/ITaMainUsherRecordService.java 查看文件

@@ -7,6 +7,7 @@ import com.huiju.welcome.common.base.ResponseBean;
7 7
 import com.huiju.welcome.model.*;
8 8
 
9 9
 import java.time.LocalDateTime;
10
+import java.util.Date;
10 11
 import java.util.List;
11 12
 
12 13
 /**
@@ -52,7 +53,7 @@ public interface ITaMainUsherRecordService extends IService<TaMainUsherRecord> {
52 53
 
53 54
     TaMainUsherRecord mergeAndDelete(TaMainUsherRecord source, TaMainUsherRecord target);
54 55
 
55
-    List<UsherRecordExcel> getCustomersEqualCustomerPageExcel(String personName, String phone, String receiver, String customerType, Integer customerSource, LocalDateTime startTime,LocalDateTime endTime);
56
+    List<UsherRecordExcel> getCustomersEqualCustomerPageExcel(String personName, String phone, String receiver, String customerType, Integer customerSource, Date startTime,Date endTime);
56 57
 
57
-    IPage<TaMainUsherRecord> usherRecords(String personName, String phone, String receiver, String customerType, Integer customerSource, LocalDateTime startTime,LocalDateTime endTime,Integer pageNum,Integer pageSize);
58
+    IPage<TaMainUsherRecord> usherRecords(String personName, String phone, String receiver, String customerType, Integer customerSource, Date startTime, Date endTime, Integer pageNum, Integer pageSize);
58 59
 }

+ 3
- 2
src/main/java/com.huiju.welcome/service/impl/TaMainUsherRecordServiceImpl.java 查看文件

@@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
23 23
 
24 24
 import java.time.LocalDateTime;
25 25
 import java.util.ArrayList;
26
+import java.util.Date;
26 27
 import java.util.List;
27 28
 
28 29
 /**
@@ -681,7 +682,7 @@ public class TaMainUsherRecordServiceImpl extends ServiceImpl<TaMainUsherRecordM
681 682
     }
682 683
 
683 684
     @Override
684
-    public List<UsherRecordExcel> getCustomersEqualCustomerPageExcel(String personName, String phone, String receiver, String customerType, Integer customerSource, LocalDateTime startTime,LocalDateTime endTime) {
685
+    public List<UsherRecordExcel> getCustomersEqualCustomerPageExcel(String personName, String phone, String receiver, String customerType, Integer customerSource, Date startTime, Date endTime) {
685 686
         List<UsherRecordExcel> result = new ArrayList<>();
686 687
         List<TaMainUsherRecord> customers = taMainUsherRecordMapper.getCustomersEqualCustomerPageExcel(personName,phone,receiver,customerType,customerSource,startTime,endTime);
687 688
 
@@ -707,7 +708,7 @@ public class TaMainUsherRecordServiceImpl extends ServiceImpl<TaMainUsherRecordM
707 708
     }
708 709
 
709 710
     @Override
710
-    public  IPage<TaMainUsherRecord> usherRecords(String personName, String phone, String receiver, String customerType, Integer customerSource, LocalDateTime startTime,LocalDateTime endTime,Integer pageNum,Integer pageSize){
711
+    public  IPage<TaMainUsherRecord> usherRecords(String personName, String phone, String receiver, String customerType, Integer customerSource, Date startTime,Date endTime,Integer pageNum,Integer pageSize){
711 712
         IPage<TaMainUsherRecord> page=new Page<>();
712 713
         page.setSize(pageSize == null ? 10 : pageSize);
713 714
         page.setCurrent(pageNum == null ? 1 : pageNum);

+ 6
- 3
src/main/resources/mapper/TaMainUsherRecordMapper.xml 查看文件

@@ -73,10 +73,10 @@ WHERE
73 73
             <if test="receiver !=null and receiver != ''">
74 74
                 and t.receiver LIKE CONCAT('%',#{receiver},'%')
75 75
             </if>
76
-            <if test="customerType !=null and customerType != '' and customerType = 'channel'">
76
+            <if test="customerType !=null and customerType != '' and customerType == 'channel'">
77 77
                 and t.customer_type =#{customerType}
78 78
             </if>
79
-            <if test="customerType !=null and customerType != '' and customerType != 'channel'">
79
+            <if test="customerType !=null and customerType != '' and customerType == 'self'">
80 80
                 and t.customer_type is null
81 81
             </if>
82 82
             <if test="customerSource !=null and customerSource != ''">
@@ -112,9 +112,12 @@ WHERE
112 112
             <if test="receiver !=null and receiver != ''">
113 113
                 and t.receiver LIKE CONCAT('%',#{receiver},'%')
114 114
             </if>
115
-            <if test="customerType !=null and customerType != ''">
115
+            <if test="customerType !=null and customerType != '' and customerType == 'channel'">
116 116
                 and t.customer_type =#{customerType}
117 117
             </if>
118
+            <if test="customerType !=null and customerType != '' and customerType == 'self'">
119
+                and t.customer_type is null
120
+            </if>
118 121
             <if test="customerSource !=null and customerSource != ''">
119 122
                 and t.customer_source =#{customerSource}
120 123
             </if>