Browse Source

excel &list

胡轶钦 5 years ago
parent
commit
c1453ae4db

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

312
                                     @RequestParam(value = "startTime",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startTime,
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 = "endTime",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endTime,
314
                                     @RequestParam(value = "customerType" ,required = false)String customerType,
314
                                     @RequestParam(value = "customerType" ,required = false)String customerType,
315
-                                    @RequestParam(value = "customerSource" ,required = false)String customerSource,
315
+                                    @RequestParam(value = "customerSource" ,required = false)Integer customerSource,
316
                                     @RequestParam(value = "receiver" ,required = false)String receiver,
316
                                     @RequestParam(value = "receiver" ,required = false)String receiver,
317
                                     @RequestParam(value = "phone" ,required = false)String phone,
317
                                     @RequestParam(value = "phone" ,required = false)String phone,
318
                                HttpServletResponse response) {
318
                                HttpServletResponse response) {
345
                                      @RequestParam(value = "startTime",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startTime,
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 = "endTime",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endTime,
347
                                      @RequestParam(value = "customerType" ,required = false)String customerType,
347
                                      @RequestParam(value = "customerType" ,required = false)String customerType,
348
-                                     @RequestParam(value = "customerSource" ,required = false)String customerSource,
348
+                                     @RequestParam(value = "customerSource" ,required = false)Integer customerSource,
349
                                      @RequestParam(value = "receiver" ,required = false)String receiver,
349
                                      @RequestParam(value = "receiver" ,required = false)String receiver,
350
                                      @RequestParam(value = "phone" ,required = false)String phone){
350
                                      @RequestParam(value = "phone" ,required = false)String phone){
351
         ResponseBean result = new ResponseBean();
351
         ResponseBean result = new ResponseBean();

+ 2
- 2
src/main/java/com.huiju.welcome/mapper/TaMainUsherRecordMapper.java View File

32
     List<TaMainUsherRecord> getLastList(@Param("personId") Integer personId, @Param("dt") LocalDateTime dt);
32
     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);
33
     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);
34
     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") String 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") String customerSource, @Param("startTime")LocalDateTime startTime,@Param("endTime")LocalDateTime endTime);
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);
37
 }
37
 }

+ 4
- 1
src/main/java/com.huiju.welcome/model/TaMainUsherRecord.java View File

81
     private boolean newCustomer;
81
     private boolean newCustomer;
82
 
82
 
83
     @TableField(exist = false)
83
     @TableField(exist = false)
84
-    private String SourceName;
84
+    private String sourceName;
85
+
86
+    @TableField(exist = false)
87
+    private String  appointmentName;
85
 
88
 
86
     private String receiver;
89
     private String receiver;
87
 
90
 

+ 3
- 0
src/main/java/com.huiju.welcome/model/UsherRecordExcel.java View File

34
     @ExcelProperty(value = "接待人" ,index = 7)
34
     @ExcelProperty(value = "接待人" ,index = 7)
35
     String receiver;
35
     String receiver;
36
 
36
 
37
+    @ExcelProperty(value = "预约人",index = 8)
38
+    String appointmentName;
39
+
37
 }
40
 }

+ 2
- 2
src/main/java/com.huiju.welcome/service/ITaMainUsherRecordService.java View File

52
 
52
 
53
     TaMainUsherRecord mergeAndDelete(TaMainUsherRecord source, TaMainUsherRecord target);
53
     TaMainUsherRecord mergeAndDelete(TaMainUsherRecord source, TaMainUsherRecord target);
54
 
54
 
55
-    List<UsherRecordExcel> getCustomersEqualCustomerPageExcel(String personName, String phone, String receiver, String customerType, String customerSource, LocalDateTime startTime,LocalDateTime endTime);
55
+    List<UsherRecordExcel> getCustomersEqualCustomerPageExcel(String personName, String phone, String receiver, String customerType, Integer customerSource, LocalDateTime startTime,LocalDateTime endTime);
56
 
56
 
57
-    IPage<TaMainUsherRecord> usherRecords(String personName, String phone, String receiver, String customerType, String customerSource, LocalDateTime startTime,LocalDateTime endTime,Integer pageNum,Integer pageSize);
57
+    IPage<TaMainUsherRecord> usherRecords(String personName, String phone, String receiver, String customerType, Integer customerSource, LocalDateTime startTime,LocalDateTime endTime,Integer pageNum,Integer pageSize);
58
 }
58
 }

+ 2
- 2
src/main/java/com.huiju.welcome/service/impl/TaMainUsherRecordServiceImpl.java View File

681
     }
681
     }
682
 
682
 
683
     @Override
683
     @Override
684
-    public List<UsherRecordExcel> getCustomersEqualCustomerPageExcel(String personName, String phone, String receiver, String customerType, String customerSource, LocalDateTime startTime,LocalDateTime endTime) {
684
+    public List<UsherRecordExcel> getCustomersEqualCustomerPageExcel(String personName, String phone, String receiver, String customerType, Integer customerSource, LocalDateTime startTime,LocalDateTime endTime) {
685
         List<UsherRecordExcel> result = new ArrayList<>();
685
         List<UsherRecordExcel> result = new ArrayList<>();
686
         List<TaMainUsherRecord> customers = taMainUsherRecordMapper.getCustomersEqualCustomerPageExcel(personName,phone,receiver,customerType,customerSource,startTime,endTime);
686
         List<TaMainUsherRecord> customers = taMainUsherRecordMapper.getCustomersEqualCustomerPageExcel(personName,phone,receiver,customerType,customerSource,startTime,endTime);
687
 
687
 
706
     }
706
     }
707
 
707
 
708
     @Override
708
     @Override
709
-    public  IPage<TaMainUsherRecord> usherRecords(String personName, String phone, String receiver, String customerType, String customerSource, LocalDateTime startTime,LocalDateTime endTime,Integer pageNum,Integer pageSize){
709
+    public  IPage<TaMainUsherRecord> usherRecords(String personName, String phone, String receiver, String customerType, Integer customerSource, LocalDateTime startTime,LocalDateTime endTime,Integer pageNum,Integer pageSize){
710
         IPage<TaMainUsherRecord> page=new Page<>();
710
         IPage<TaMainUsherRecord> page=new Page<>();
711
         page.setSize(pageSize == null ? 10 : pageSize);
711
         page.setSize(pageSize == null ? 10 : pageSize);
712
         page.setCurrent(pageNum == null ? 1 : pageNum);
712
         page.setCurrent(pageNum == null ? 1 : pageNum);

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

56
     <select id="getCustomersEqualCustomerPageExcel" resultType="com.huiju.welcome.model.TaMainUsherRecord">
56
     <select id="getCustomersEqualCustomerPageExcel" resultType="com.huiju.welcome.model.TaMainUsherRecord">
57
         SELECT
57
         SELECT
58
         t.*,
58
         t.*,
59
-        b.label as sourceName
59
+        b.label AS sourceName,
60
+        c.person_name as appointmentName
60
         FROM
61
         FROM
61
         ta_main_usher_record t
62
         ta_main_usher_record t
62
         LEFT JOIN sys_dict b ON t.customer_source = b.id
63
         LEFT JOIN sys_dict b ON t.customer_source = b.id
64
+        LEFT JOIN ta_visitor_appointment c ON t.appointment_id = c.appointment_id
63
         <where>
65
         <where>
64
             t.status = 1
66
             t.status = 1
65
             <if test="personName !=null and personName != ''">
67
             <if test="personName !=null and personName != ''">
71
             <if test="receiver !=null and receiver != ''">
73
             <if test="receiver !=null and receiver != ''">
72
                 and t.receiver LIKE CONCAT('%',#{receiver},'%')
74
                 and t.receiver LIKE CONCAT('%',#{receiver},'%')
73
             </if>
75
             </if>
74
-            <if test="customerType !=null and customerType != ''">
76
+            <if test="customerType !=null and customerType != '' and customerType = 'channel'">
75
                 and t.customer_type =#{customerType}
77
                 and t.customer_type =#{customerType}
76
             </if>
78
             </if>
79
+            <if test="customerType !=null and customerType != '' and customerType != 'channel'">
80
+                and t.customer_type is null
81
+            </if>
77
             <if test="customerSource !=null and customerSource != ''">
82
             <if test="customerSource !=null and customerSource != ''">
78
                 and t.customer_source =#{customerSource}
83
                 and t.customer_source =#{customerSource}
79
             </if>
84
             </if>
90
     <select id="usherRecords" resultType="com.huiju.welcome.model.TaMainUsherRecord">
95
     <select id="usherRecords" resultType="com.huiju.welcome.model.TaMainUsherRecord">
91
         SELECT
96
         SELECT
92
         t.*,
97
         t.*,
93
-        b.label as sourceName
98
+        b.label AS sourceName,
99
+        c.person_name as appointmentName
94
         FROM
100
         FROM
95
         ta_main_usher_record t
101
         ta_main_usher_record t
96
         LEFT JOIN sys_dict b ON t.customer_source = b.id
102
         LEFT JOIN sys_dict b ON t.customer_source = b.id
103
+        LEFT JOIN ta_visitor_appointment c ON t.appointment_id = c.appointment_id
97
         <where>
104
         <where>
98
             t.status = 1
105
             t.status = 1
99
             <if test="personName !=null and personName != ''">
106
             <if test="personName !=null and personName != ''">