Bladeren bron

excel &list

胡轶钦 5 jaren geleden
bovenliggende
commit
c1453ae4db

+ 2
- 2
src/main/java/com.huiju.welcome/controller/TaMainUsherRecordController.java Bestand weergeven

@@ -312,7 +312,7 @@ public class TaMainUsherRecordController extends BaseController {
312 312
                                     @RequestParam(value = "startTime",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startTime,
313 313
                                     @RequestParam(value = "endTime",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endTime,
314 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 316
                                     @RequestParam(value = "receiver" ,required = false)String receiver,
317 317
                                     @RequestParam(value = "phone" ,required = false)String phone,
318 318
                                HttpServletResponse response) {
@@ -345,7 +345,7 @@ public class TaMainUsherRecordController extends BaseController {
345 345
                                      @RequestParam(value = "startTime",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startTime,
346 346
                                      @RequestParam(value = "endTime",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endTime,
347 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 349
                                      @RequestParam(value = "receiver" ,required = false)String receiver,
350 350
                                      @RequestParam(value = "phone" ,required = false)String phone){
351 351
         ResponseBean result = new ResponseBean();

+ 2
- 2
src/main/java/com.huiju.welcome/mapper/TaMainUsherRecordMapper.java Bestand weergeven

@@ -32,6 +32,6 @@ public interface TaMainUsherRecordMapper extends BaseMapper<TaMainUsherRecord> {
32 32
     List<TaMainUsherRecord> getLastList(@Param("personId") Integer personId, @Param("dt") LocalDateTime dt);
33 33
     IPage<TaMainUsherRecord> taMainUsherRecordList(IPage<TaMainUsherRecord> pg,@Param("phone")String phone,@Param("platNumber")String platNumber,@Param("personName")String personName,@Param("appointment")Integer appointment);
34 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 Bestand weergeven

@@ -81,7 +81,10 @@ public class TaMainUsherRecord implements Serializable {
81 81
     private boolean newCustomer;
82 82
 
83 83
     @TableField(exist = false)
84
-    private String SourceName;
84
+    private String sourceName;
85
+
86
+    @TableField(exist = false)
87
+    private String  appointmentName;
85 88
 
86 89
     private String receiver;
87 90
 

+ 3
- 0
src/main/java/com.huiju.welcome/model/UsherRecordExcel.java Bestand weergeven

@@ -34,4 +34,7 @@ public class UsherRecordExcel extends BaseRowModel {
34 34
     @ExcelProperty(value = "接待人" ,index = 7)
35 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 Bestand weergeven

@@ -52,7 +52,7 @@ public interface ITaMainUsherRecordService extends IService<TaMainUsherRecord> {
52 52
 
53 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 Bestand weergeven

@@ -681,7 +681,7 @@ public class TaMainUsherRecordServiceImpl extends ServiceImpl<TaMainUsherRecordM
681 681
     }
682 682
 
683 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 685
         List<UsherRecordExcel> result = new ArrayList<>();
686 686
         List<TaMainUsherRecord> customers = taMainUsherRecordMapper.getCustomersEqualCustomerPageExcel(personName,phone,receiver,customerType,customerSource,startTime,endTime);
687 687
 
@@ -706,7 +706,7 @@ public class TaMainUsherRecordServiceImpl extends ServiceImpl<TaMainUsherRecordM
706 706
     }
707 707
 
708 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 710
         IPage<TaMainUsherRecord> page=new Page<>();
711 711
         page.setSize(pageSize == null ? 10 : pageSize);
712 712
         page.setCurrent(pageNum == null ? 1 : pageNum);

+ 10
- 3
src/main/resources/mapper/TaMainUsherRecordMapper.xml Bestand weergeven

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