胡轶钦 5 years ago
parent
commit
9bb5d50f34

+ 6
- 5
src/main/java/com.huiju.welcome/controller/TaMainUsherRecordController.java View File

29
 import java.io.IOException;
29
 import java.io.IOException;
30
 import java.time.LocalDateTime;
30
 import java.time.LocalDateTime;
31
 import java.time.format.DateTimeFormatter;
31
 import java.time.format.DateTimeFormatter;
32
+import java.util.Date;
32
 import java.util.List;
33
 import java.util.List;
33
 
34
 
34
 /**
35
 /**
309
      */
310
      */
310
     @RequestMapping(value="/excel/usherListExcel",method= RequestMethod.GET)
311
     @RequestMapping(value="/excel/usherListExcel",method= RequestMethod.GET)
311
     public void exportCustomerExcel(@RequestParam(value = "personName" ,required = false)String personName,
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
                                     @RequestParam(value = "customerType" ,required = false)String customerType,
315
                                     @RequestParam(value = "customerType" ,required = false)String customerType,
315
                                     @RequestParam(value = "customerSource" ,required = false)Integer customerSource,
316
                                     @RequestParam(value = "customerSource" ,required = false)Integer customerSource,
316
                                     @RequestParam(value = "receiver" ,required = false)String receiver,
317
                                     @RequestParam(value = "receiver" ,required = false)String receiver,
328
             response.setCharacterEncoding("utf-8");
329
             response.setCharacterEncoding("utf-8");
329
             response.setHeader("Content-disposition", "attachment;filename="+fileName+".xlsx");
330
             response.setHeader("Content-disposition", "attachment;filename="+fileName+".xlsx");
330
             ExcelWriter writer = new ExcelWriter(out, ExcelTypeEnum.XLSX, true);
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
             writer.write(result, sheet1);
333
             writer.write(result, sheet1);
333
             writer.finish();
334
             writer.finish();
334
 
335
 
342
     public ResponseBean usherRecords(@RequestParam(defaultValue = "1") int pageNum,
343
     public ResponseBean usherRecords(@RequestParam(defaultValue = "1") int pageNum,
343
                                  @RequestParam(defaultValue = "10") int pageSize,
344
                                  @RequestParam(defaultValue = "10") int pageSize,
344
                                      @RequestParam(value = "personName" ,required = false)String personName,
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
                                      @RequestParam(value = "customerType" ,required = false)String customerType,
348
                                      @RequestParam(value = "customerType" ,required = false)String customerType,
348
                                      @RequestParam(value = "customerSource" ,required = false)Integer customerSource,
349
                                      @RequestParam(value = "customerSource" ,required = false)Integer customerSource,
349
                                      @RequestParam(value = "receiver" ,required = false)String receiver,
350
                                      @RequestParam(value = "receiver" ,required = false)String receiver,

+ 2
- 1
src/main/java/com.huiju.welcome/interceptor/AccessInterceptor.java View File

37
         "/camera",
37
         "/camera",
38
         "/websocket",
38
         "/websocket",
39
          "/face",
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 View File

7
 import org.apache.ibatis.annotations.Param;
7
 import org.apache.ibatis.annotations.Param;
8
 
8
 
9
 import java.time.LocalDateTime;
9
 import java.time.LocalDateTime;
10
+import java.util.Date;
10
 import java.util.List;
11
 import java.util.List;
11
 import java.util.Map;
12
 import java.util.Map;
12
 
13
 
32
     List<TaMainUsherRecord> getLastList(@Param("personId") Integer personId, @Param("dt") LocalDateTime dt);
33
     List<TaMainUsherRecord> getLastList(@Param("personId") Integer personId, @Param("dt") LocalDateTime dt);
33
     IPage<TaMainUsherRecord> taMainUsherRecordList(IPage<TaMainUsherRecord> pg,@Param("phone")String phone,@Param("platNumber")String platNumber,@Param("personName")String personName,@Param("appointment")Integer appointment);
34
     IPage<TaMainUsherRecord> taMainUsherRecordList(IPage<TaMainUsherRecord> pg,@Param("phone")String phone,@Param("platNumber")String platNumber,@Param("personName")String personName,@Param("appointment")Integer appointment);
34
     Integer getRecIdByCustomerIdCurrentDate(@Param("customerId")Integer customerId);
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 View File

7
 import com.huiju.welcome.model.*;
7
 import com.huiju.welcome.model.*;
8
 
8
 
9
 import java.time.LocalDateTime;
9
 import java.time.LocalDateTime;
10
+import java.util.Date;
10
 import java.util.List;
11
 import java.util.List;
11
 
12
 
12
 /**
13
 /**
52
 
53
 
53
     TaMainUsherRecord mergeAndDelete(TaMainUsherRecord source, TaMainUsherRecord target);
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 View File

23
 
23
 
24
 import java.time.LocalDateTime;
24
 import java.time.LocalDateTime;
25
 import java.util.ArrayList;
25
 import java.util.ArrayList;
26
+import java.util.Date;
26
 import java.util.List;
27
 import java.util.List;
27
 
28
 
28
 /**
29
 /**
681
     }
682
     }
682
 
683
 
683
     @Override
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
         List<UsherRecordExcel> result = new ArrayList<>();
686
         List<UsherRecordExcel> result = new ArrayList<>();
686
         List<TaMainUsherRecord> customers = taMainUsherRecordMapper.getCustomersEqualCustomerPageExcel(personName,phone,receiver,customerType,customerSource,startTime,endTime);
687
         List<TaMainUsherRecord> customers = taMainUsherRecordMapper.getCustomersEqualCustomerPageExcel(personName,phone,receiver,customerType,customerSource,startTime,endTime);
687
 
688
 
707
     }
708
     }
708
 
709
 
709
     @Override
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
         IPage<TaMainUsherRecord> page=new Page<>();
712
         IPage<TaMainUsherRecord> page=new Page<>();
712
         page.setSize(pageSize == null ? 10 : pageSize);
713
         page.setSize(pageSize == null ? 10 : pageSize);
713
         page.setCurrent(pageNum == null ? 1 : pageNum);
714
         page.setCurrent(pageNum == null ? 1 : pageNum);

+ 6
- 3
src/main/resources/mapper/TaMainUsherRecordMapper.xml View File

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