Преглед изворни кода

Merge branch 'v3' of http://git.ycjcjy.com/zhiyuxing/estateagents into v3

胡轶钦 пре 5 година
родитељ
комит
fc60f8b9da

+ 5
- 3
src/main/java/com/huiju/estateagents/controller/TaNewsController.java Прегледај датотеку

@@ -73,7 +73,8 @@ public class TaNewsController extends BaseController {
73 73
             @ApiImplicitParam(dataTypeClass = Integer.class, name = "pageSize", paramType = "query",value = "一页多少行"),
74 74
             @ApiImplicitParam(dataTypeClass = String.class, name = "buildingId", paramType = "query",value = "项目id"),
75 75
             @ApiImplicitParam(dataTypeClass = Integer.class, name = "newsTypeId", paramType = "query",value = "资讯类型id"),
76
-            @ApiImplicitParam(dataTypeClass = Integer.class, name = "newsStatus", paramType = "query",value = "状态")
76
+            @ApiImplicitParam(dataTypeClass = Integer.class, name = "newsStatus", paramType = "query",value = "状态"),
77
+            @ApiImplicitParam(dataTypeClass = String.class, name = "title", paramType = "query",value = "标题")
77 78
     })
78 79
     @RequestMapping(value="/admin/taNews",method= RequestMethod.GET)
79 80
     public ResponseBean taNewsList(HttpServletRequest request,
@@ -81,8 +82,9 @@ public class TaNewsController extends BaseController {
81 82
                                    @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
82 83
                                    @RequestParam(value = "buildingId", required = false) String buildingId,
83 84
                                    @RequestParam(value = "newsTypeId", required = false) Integer newsTypeId,
84
-                                   @RequestParam(value = "newsStatus", required = false) Integer newsStatus){
85
-        ResponseBean responseBean = iTaNewsService.getList(pageNum, pageSize, buildingId, getOrgId(request), newsTypeId, newsStatus);
85
+                                   @RequestParam(value = "newsStatus", required = false) Integer newsStatus,
86
+                                   @RequestParam(value = "title", required = false) String title){
87
+        ResponseBean responseBean = iTaNewsService.getList(pageNum, pageSize, buildingId, getOrgId(request), newsTypeId, newsStatus,title);
86 88
         return responseBean;
87 89
     }
88 90
 

+ 107
- 10
src/main/java/com/huiju/estateagents/controller/TaRecommendCustomerController.java Прегледај датотеку

@@ -16,10 +16,9 @@ import com.huiju.estateagents.entity.TaChannelPerson;
16 16
 import com.huiju.estateagents.entity.TaPerson;
17 17
 import com.huiju.estateagents.entity.TaRecommendCustomer;
18 18
 import com.huiju.estateagents.event.EventBus;
19
-import com.huiju.estateagents.excel.AgentsRecommendCustomer;
20
-import com.huiju.estateagents.excel.ExcelRecommendCustomer;
21
-import com.huiju.estateagents.excel.ReporRecommendCustomer;
19
+import com.huiju.estateagents.excel.*;
22 20
 import com.huiju.estateagents.excel.handler.CustomCellWriteHandler;
21
+import com.huiju.estateagents.mapper.TaRecommendCustomerMapper;
23 22
 import com.huiju.estateagents.service.ITaPersonService;
24 23
 import com.huiju.estateagents.service.ITaRecommendCustomerService;
25 24
 import com.huiju.estateagents.service.TaChannelPersonService;
@@ -70,6 +69,9 @@ public class TaRecommendCustomerController extends BaseController {
70 69
     @Autowired
71 70
     private TaChannelPersonService taChannelPersonService;
72 71
 
72
+    @Autowired
73
+    private TaRecommendCustomerMapper taRecommendCustomerMapper;
74
+
73 75
     /**
74 76
      * 我的客户列表
75 77
      * @param pageNumber
@@ -494,7 +496,7 @@ public class TaRecommendCustomerController extends BaseController {
494 496
         ResponseBean responseBean = new ResponseBean();
495 497
         try {
496 498
             TaRecommendCustomer taRecommendCustomer = taRecommendCustomerService.getById(id);
497
-            if(taRecommendCustomer.getVerifyStatus().equals(CommConstant.VERIFY_READY) ){
499
+            if(null == taRecommendCustomer.getVerifyStatus()){ // taRecommendCustomer.getVerifyStatus().equals(CommConstant.VERIFY_READY)
498 500
                 taRecommendCustomer.setVerifyStatus(verifyStatus);
499 501
                 if(!StringUtils.isEmpty(verifyRemark)){
500 502
                     taRecommendCustomer.setVerifyRemark(verifyRemark);
@@ -536,7 +538,7 @@ public class TaRecommendCustomerController extends BaseController {
536 538
 
537 539
         Integer count = taRecommendCustomerService.getRecCustomerExportCount(getOrgId(request));
538 540
 
539
-        Integer pageCode = 1;
541
+        Integer pageCode = 0;
540 542
         Integer pageSize = 100;
541 543
         // 总页数
542 544
         Integer pageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
@@ -545,7 +547,7 @@ public class TaRecommendCustomerController extends BaseController {
545 547
         // 设置 sheet, 同一个sheet只需要设置一次
546 548
         WriteSheet writeSheet = EasyExcel.writerSheet("推荐客户").build();
547 549
         do {
548
-            List<ExcelRecommendCustomer> recCustomerExport = taRecommendCustomerService.getRecCustomerExport(getOrgId(request), pageCode, pageSize);
550
+            List<ExcelRecommendCustomer> recCustomerExport = taRecommendCustomerService.getRecCustomerExport(getOrgId(request), pageCode * pageSize, pageSize);
549 551
             excelWriter.write(recCustomerExport, writeSheet);
550 552
 
551 553
             pageCode ++;
@@ -569,7 +571,7 @@ public class TaRecommendCustomerController extends BaseController {
569 571
 
570 572
         Integer count = taRecommendCustomerService.getRepCustomerReportCount(getOrgId(request));
571 573
 
572
-        Integer pageCode = 1;
574
+        Integer pageCode = 0;
573 575
         Integer pageSize = 100;
574 576
         // 总页数
575 577
         Integer pageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
@@ -579,7 +581,7 @@ public class TaRecommendCustomerController extends BaseController {
579 581
         WriteSheet writeSheet = EasyExcel.writerSheet("报备客户").build();
580 582
         List<ReporRecommendCustomer> recCustomerExport = null;
581 583
         do {
582
-            recCustomerExport = taRecommendCustomerService.getRepCustomerReportExport(getOrgId(request), pageCode, pageSize);
584
+            recCustomerExport = taRecommendCustomerService.getRepCustomerReportExport(getOrgId(request), pageCode * pageSize, pageSize);
583 585
             excelWriter.write(recCustomerExport, writeSheet);
584 586
 
585 587
             pageCode ++;
@@ -602,7 +604,7 @@ public class TaRecommendCustomerController extends BaseController {
602 604
 
603 605
         Integer count = taRecommendCustomerService.getIndependentAgentsCount(getOrgId(request));
604 606
 
605
-        Integer pageCode = 1;
607
+        Integer pageCode = 0;
606 608
         Integer pageSize = 100;
607 609
         // 总页数
608 610
         Integer pageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
@@ -612,7 +614,7 @@ public class TaRecommendCustomerController extends BaseController {
612 614
         WriteSheet writeSheet = EasyExcel.writerSheet("经纪人").build();
613 615
         List<AgentsRecommendCustomer> recCustomerExport = null;
614 616
         do {
615
-            recCustomerExport = taRecommendCustomerService.getIndependentAgentsExport(getOrgId(request), pageCode, pageSize);
617
+            recCustomerExport = taRecommendCustomerService.getIndependentAgentsExport(getOrgId(request), pageCode * pageSize, pageSize);
616 618
             excelWriter.write(recCustomerExport, writeSheet);
617 619
 
618 620
             pageCode ++;
@@ -623,4 +625,99 @@ public class TaRecommendCustomerController extends BaseController {
623 625
 
624 626
     }
625 627
 
628
+
629
+
630
+    // 客户列表 公客/私客
631
+
632
+    /**
633
+     * 导出数据 客户列表 公客/私客
634
+     * @param request
635
+     * @param response
636
+     * @param name
637
+     * @param tel
638
+     * @param buildingId
639
+     * @param consultName
640
+     * @param consultTel
641
+     * @param entryType
642
+     * @param verifyStatus
643
+     * @param sex
644
+     * @param customerType
645
+     * @param status
646
+     * @throws IOException
647
+     */
648
+    @GetMapping("/admin/customer/recommend/export")
649
+    public void getCustomerExportList (HttpServletRequest request,
650
+                                         HttpServletResponse response,
651
+                                         @RequestParam(value ="name",required = false) String name,
652
+                                         @RequestParam(value ="tel",required = false) String tel,
653
+                                         @RequestParam(value ="buildingId",required = false) String buildingId,
654
+                                         @RequestParam(value ="consultName",required = false) String consultName,
655
+                                         @RequestParam(value ="consultTel",required = false) String consultTel,
656
+                                         @RequestParam(value ="entryType",required = false) String entryType,
657
+                                         @RequestParam(value ="verifyStatus",required = false) String verifyStatus,
658
+                                         @RequestParam(value = "sex",required = false)Integer sex,
659
+                                         @RequestParam(value = "customerType") String customerType,
660
+                                         @RequestParam(value = "status",required = false) Integer status) throws IOException { // public 公  private 私
661
+
662
+        //        response.setContentType("application/vnd.ms-excel");
663
+        response.setContentType("application/octet-stream");
664
+        response.setCharacterEncoding("utf-8");
665
+        response.setHeader("Content-disposition", "attachment;filename=经纪人.xlsx");
666
+
667
+        Integer orgId = getOrgId(request);
668
+
669
+        Integer pageCode = 0;
670
+        Integer pageSize = 100;
671
+        // 总页数
672
+        Integer pageCount = 0;
673
+
674
+        if (CommConstant.CUTOMER_TYPE_PUBLIC.equals(customerType)) {
675
+            /**
676
+             * 公客
677
+             */
678
+
679
+            // 设置读取的class
680
+            ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), PublicCustomerExport.class).registerWriteHandler(new CustomCellWriteHandler()).build();
681
+            // 设置 sheet, 同一个sheet只需要设置一次
682
+            WriteSheet writeSheet = EasyExcel.writerSheet("客户列表-公客").build();
683
+
684
+            Integer count = taRecommendCustomerMapper.getPublicCustomerExportListCount(name, tel,  entryType, verifyStatus, sex, orgId,consultTel);
685
+            pageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
686
+            List<PublicCustomerExport> publicList = null;
687
+            do {
688
+                publicList = taRecommendCustomerMapper.getPublicCustomerExportList(pageCode * pageSize, pageSize, name, tel,  entryType, verifyStatus, sex, orgId,consultTel);
689
+                excelWriter.write(publicList, writeSheet);
690
+
691
+                pageCode ++;
692
+            } while (pageCode <= pageCount);
693
+
694
+            // finish 会帮忙关闭流
695
+            excelWriter.finish();
696
+        } else {
697
+            /**
698
+             * 私客
699
+             */
700
+
701
+            // 设置读取的class
702
+            ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), PrivateCustomerExport.class).registerWriteHandler(new CustomCellWriteHandler()).build();
703
+            // 设置 sheet, 同一个sheet只需要设置一次
704
+            WriteSheet writeSheet = EasyExcel.writerSheet("客户列表-私客").build();
705
+
706
+            Integer count = taRecommendCustomerMapper.getCustomerExportListCount(buildingId, name, tel, consultName, consultTel, entryType, verifyStatus, sex, orgId,status);
707
+            pageCount = count % pageSize == 0 ? count / pageSize : (count / pageSize) + 1;
708
+            List<PrivateCustomerExport> privateList = null;
709
+            do {
710
+                privateList = taRecommendCustomerMapper.getCustomerExportList(pageCode *  pageSize, pageSize, buildingId, name, tel, consultName, consultTel, entryType, verifyStatus, sex, orgId,status);
711
+                excelWriter.write(privateList, writeSheet);
712
+
713
+                pageCode ++;
714
+            } while (pageCode <= pageCount);
715
+            // finish 会帮忙关闭流
716
+            excelWriter.finish();
717
+
718
+        }
719
+
720
+
721
+    }
722
+
626 723
 }

+ 14
- 0
src/main/java/com/huiju/estateagents/excel/AgentsRecommendCustomer.java Прегледај датотеку

@@ -45,4 +45,18 @@ public class AgentsRecommendCustomer {
45 45
     @ExcelProperty(value = "所属渠道", index = 4)
46 46
     private String channelName;
47 47
 
48
+    /**
49
+     * 推荐客户(总数)
50
+     */
51
+    @ColumnWidth(15)
52
+    @ExcelProperty(value = "推荐客户(总数)", index = 5)
53
+    private String recommedCount;
54
+
55
+    /**
56
+     * 邀请经纪人(数量)
57
+     */
58
+    @ColumnWidth(15)
59
+    @ExcelProperty(value = "邀请经纪人(数量)", index = 6)
60
+    private String agentCount;
61
+
48 62
 }

+ 21
- 3
src/main/java/com/huiju/estateagents/excel/ExcelRecommendCustomer.java Прегледај датотеку

@@ -43,15 +43,33 @@ public class ExcelRecommendCustomer {
43 43
     private String intention;
44 44
 
45 45
     /**
46
-     * 置业顾问
46
+     * 推荐人姓名
47 47
      */
48 48
     @ColumnWidth(15)
49
-    @ExcelProperty(value = "推荐人", index = 4)
49
+    @ExcelProperty(value = "推荐人姓名", index = 4)
50 50
     private String recommend;
51 51
 
52
+    /**
53
+     * 推荐人电话
54
+     */
55
+    @ColumnWidth(15)
56
+    @ExcelProperty(value = "推荐人电话", index = 5)
57
+    private String recommendTel;
58
+
52 59
     @ColumnWidth(15)
53 60
     @DateTimeFormat("yyyy年MM月dd日")
54
-    @ExcelProperty(value = "推荐时间", index = 5)
61
+    @ExcelProperty(value = "推荐时间", index = 6)
55 62
     private Date createDate;
56 63
 
64
+    /**
65
+     * 审核状态名
66
+     */
67
+    @ColumnWidth(15)
68
+    @ExcelProperty(value = "审核状态名", index = 7)
69
+    private String verifyStatusName;
70
+
71
+
72
+
73
+
74
+
57 75
 }

+ 48
- 0
src/main/java/com/huiju/estateagents/excel/PrivateCustomerExport.java Прегледај датотеку

@@ -0,0 +1,48 @@
1
+package com.huiju.estateagents.excel;
2
+
3
+import com.alibaba.excel.annotation.ExcelProperty;
4
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
5
+import lombok.Data;
6
+
7
+/**
8
+ * 公客导出
9
+ */
10
+@Data
11
+public class PrivateCustomerExport {
12
+
13
+    /**
14
+     * 姓名
15
+     */
16
+    @ColumnWidth(15)
17
+    @ExcelProperty(value = "姓名", index = 0)
18
+    private String name;
19
+
20
+    /**
21
+     * 电话
22
+     */
23
+    @ColumnWidth(15)
24
+    @ExcelProperty(value = "电话", index = 1)
25
+    private String phone;
26
+
27
+    /**
28
+     * 性别
29
+     */
30
+    @ColumnWidth(15)
31
+    @ExcelProperty(value = "性别", index = 2)
32
+    private String sex;
33
+
34
+    /**
35
+     * 置业顾问姓名
36
+     */
37
+    @ColumnWidth(15)
38
+    @ExcelProperty(value = "置业顾问姓名", index = 3)
39
+    private String consultantName;
40
+
41
+    /**
42
+     * 置业顾问电话
43
+     */
44
+    @ColumnWidth(15)
45
+    @ExcelProperty(value = "置业顾问电话", index = 4)
46
+    private String consultTel;
47
+
48
+}

+ 34
- 0
src/main/java/com/huiju/estateagents/excel/PublicCustomerExport.java Прегледај датотеку

@@ -0,0 +1,34 @@
1
+package com.huiju.estateagents.excel;
2
+
3
+import com.alibaba.excel.annotation.ExcelProperty;
4
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
5
+import lombok.Data;
6
+
7
+/**
8
+ * 公客导出
9
+ */
10
+@Data
11
+public class PublicCustomerExport {
12
+
13
+    /**
14
+     * 姓名
15
+     */
16
+    @ColumnWidth(15)
17
+    @ExcelProperty(value = "姓名", index = 0)
18
+    private String nickname;
19
+
20
+    /**
21
+     * 电话
22
+     */
23
+    @ColumnWidth(15)
24
+    @ExcelProperty(value = "电话", index = 1)
25
+    private String phone;
26
+
27
+    /**
28
+     * 性别
29
+     */
30
+    @ColumnWidth(15)
31
+    @ExcelProperty(value = "性别", index = 2)
32
+    private String sex;
33
+
34
+}

+ 2
- 2
src/main/java/com/huiju/estateagents/excel/ReporRecommendCustomer.java Прегледај датотеку

@@ -45,14 +45,14 @@ public class ReporRecommendCustomer {
45 45
      * 置业顾问
46 46
      */
47 47
     @ColumnWidth(15)
48
-    @ExcelProperty(value = "置业顾问", index = 25)
48
+    @ExcelProperty(value = "置业顾问", index = 4)
49 49
     private String consultantName;
50 50
 
51 51
     /**
52 52
      * 置业顾问手机号
53 53
      */
54 54
     @ColumnWidth(15)
55
-    @ExcelProperty(value = "置业顾问手机号", index = 25)
55
+    @ExcelProperty(value = "置业顾问手机号", index = 5)
56 56
     private String consultTel;
57 57
 
58 58
 }

+ 68
- 9
src/main/java/com/huiju/estateagents/mapper/TaRecommendCustomerMapper.java Прегледај датотеку

@@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
4 4
 import com.huiju.estateagents.entity.TaPerson;
5 5
 import com.huiju.estateagents.entity.TaRecommendCustomer;
6 6
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
7
-import com.huiju.estateagents.excel.AgentsRecommendCustomer;
8
-import com.huiju.estateagents.excel.ExcelRecommendCustomer;
9
-import com.huiju.estateagents.excel.ReporRecommendCustomer;
7
+import com.huiju.estateagents.excel.*;
10 8
 import org.apache.ibatis.annotations.Mapper;
11 9
 import org.apache.ibatis.annotations.Param;
12 10
 
@@ -49,46 +47,107 @@ public interface TaRecommendCustomerMapper extends BaseMapper<TaRecommendCustome
49 47
     IPage<TaRecommendCustomer> getPublicCustomerList(IPage<TaPerson> page, @Param("name") String name, @Param("tel") String tel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex, @Param("orgId") Integer orgId,@Param("consultTel")String consultTel);
50 48
 
51 49
     /**
52
-     * 获取推荐用户数据
50
+     * 导出数据 获取推荐用户数据
53 51
      * @param orgId
54 52
      * @return
55 53
      */
56 54
     List<ExcelRecommendCustomer> getRecCustomerExport(@Param("orgId") Integer orgId, @Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize);
57 55
 
58 56
     /**
59
-     * 获取推荐用户数据 总数
57
+     * 导出数据 获取推荐用户数据 总数
60 58
      * @param orgId
61 59
      * @return
62 60
      */
63 61
     Integer getRecCustomerExportCount(@Param("orgId") Integer orgId);
64 62
 
65 63
     /**
66
-     * 获取报备客户数据 总数
64
+     * 导出数据 获取报备客户数据 总数
67 65
      * @param orgId
68 66
      * @return
69 67
      */
70 68
     Integer getRepCustomerReportCount(@Param("orgId")Integer orgId);
71 69
 
72 70
     /**
73
-     * 获取报备客户数据
71
+     * 导出数据 获取报备客户数据
74 72
      * @param orgId
75 73
      * @return
76 74
      */
77 75
     List<ReporRecommendCustomer> getRepCustomerReportExport(@Param("orgId") Integer orgId, @Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize);
78 76
 
79 77
     /**
80
-     * 获取经纪人数据 总数
78
+     * 导出数据 获取经纪人数据 总数
81 79
      * @param orgId
82 80
      * @return
83 81
      */
84 82
     Integer getIndependentAgentsCount(@Param("orgId") Integer orgId);
85 83
 
86 84
     /**
87
-     * 获取经纪人数据
85
+     * 导出数据 获取经纪人数据
88 86
      * @param orgId
89 87
      * @param pageCode
90 88
      * @param pageSize
91 89
      * @return
92 90
      */
93 91
     List<AgentsRecommendCustomer> getIndependentAgentsExport(@Param("orgId") Integer orgId, @Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize);
92
+
93
+    /**
94
+     * 导出数据 公客总数
95
+     * @param name
96
+     * @param tel
97
+     * @param entryType
98
+     * @param verifyStatus
99
+     * @param sex
100
+     * @param orgId
101
+     * @param consultTel
102
+     * @return
103
+     */
104
+    Integer getPublicCustomerExportListCount(@Param("name") String name, @Param("tel") String tel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex, @Param("orgId") Integer orgId,@Param("consultTel")String consultTel);
105
+
106
+    /**
107
+     * 导出数据 公客
108
+     * @param name
109
+     * @param tel
110
+     * @param entryType
111
+     * @param verifyStatus
112
+     * @param sex
113
+     * @param orgId
114
+     * @param consultTel
115
+     * @return
116
+     */
117
+    List<PublicCustomerExport> getPublicCustomerExportList(@Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize, @Param("name") String name, @Param("tel") String tel, @Param("entryType") String entryType, @Param("verifyStatus") String verifyStatus, @Param("sex") Integer sex, @Param("orgId") Integer orgId, @Param("consultTel")String consultTel);
118
+
119
+    /**
120
+     * 导出数据 私客总数
121
+     * @param buildingId
122
+     * @param name
123
+     * @param tel
124
+     * @param consultName
125
+     * @param consultTel
126
+     * @param entryType
127
+     * @param verifyStatus
128
+     * @param sex
129
+     * @param orgId
130
+     * @param status
131
+     * @return
132
+     */
133
+    Integer getCustomerExportListCount(@Param("building") String buildingId, @Param("name") String name, @Param("tel") String tel, @Param("consultName") String consultName, @Param("consultTel") String consultTel,@Param("entryType") String entryType,@Param("verifyStatus") String verifyStatus,@Param("sex") Integer sex, @Param("orgId") Integer orgId,@Param("status")Integer status);
134
+
135
+    /**
136
+     * 导出数据 私客
137
+     * @param pageCode
138
+     * @param pageSize
139
+     * @param buildingId
140
+     * @param name
141
+     * @param tel
142
+     * @param consultName
143
+     * @param consultTel
144
+     * @param entryType
145
+     * @param verifyStatus
146
+     * @param sex
147
+     * @param orgId
148
+     * @param status
149
+     * @return
150
+     */
151
+    List<PrivateCustomerExport> getCustomerExportList(@Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize, @Param("building") String buildingId, @Param("name") String name, @Param("tel") String tel, @Param("consultName") String consultName, @Param("consultTel") String consultTel, @Param("entryType") String entryType, @Param("verifyStatus") String verifyStatus, @Param("sex") Integer sex, @Param("orgId") Integer orgId, @Param("status")Integer status);
152
+
94 153
 }

+ 1
- 1
src/main/java/com/huiju/estateagents/service/ITaNewsService.java Прегледај датотеку

@@ -26,7 +26,7 @@ public interface ITaNewsService extends IService<TaNews> {
26 26
      * @param newsTypeId
27 27
      * @return
28 28
      */
29
-    ResponseBean getList(Integer pageNum, Integer pageSize, String buildingId, Integer orgId, Integer newsTypeId, Integer newsStatus);
29
+    ResponseBean getList(Integer pageNum, Integer pageSize, String buildingId, Integer orgId, Integer newsTypeId, Integer newsStatus,String title);
30 30
 
31 31
     /**
32 32
      * 根据Id查询资讯数据

+ 2
- 1
src/main/java/com/huiju/estateagents/service/impl/TaNewsServiceImpl.java Прегледај датотеку

@@ -58,7 +58,7 @@ public class TaNewsServiceImpl extends ServiceImpl<TaNewsMapper, TaNews> impleme
58 58
 
59 59
 
60 60
     @Override
61
-    public ResponseBean getList(Integer pageNum, Integer pageSize, String buildingId, Integer orgId, Integer newsTypeId, Integer newsStatus) {
61
+    public ResponseBean getList(Integer pageNum, Integer pageSize, String buildingId, Integer orgId, Integer newsTypeId, Integer newsStatus,String title) {
62 62
         ResponseBean responseBean = new ResponseBean();
63 63
 
64 64
         IPage<TaNews> page = new Page<>();
@@ -71,6 +71,7 @@ public class TaNewsServiceImpl extends ServiceImpl<TaNewsMapper, TaNews> impleme
71 71
         taNewsQueryWrapper.eq(newsTypeId != null,"news_type_id", newsTypeId);
72 72
         taNewsQueryWrapper.eq(newsStatus != null, "news_status", newsStatus);
73 73
         taNewsQueryWrapper.eq("status", 1);
74
+        taNewsQueryWrapper.like(title!=null,"news_name", title);
74 75
         taNewsQueryWrapper.orderByDesc("create_date");
75 76
         IPage<TaNews> taNewsIPage = this.page(page, taNewsQueryWrapper);
76 77
 

+ 1
- 1
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java Прегледај датотеку

@@ -186,7 +186,7 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
186 186
         taRecommendCustomer.setDemandType(params.getString("demandType"));
187 187
         taRecommendCustomer.setPriceRange(params.getString("priceRange"));
188 188
         taRecommendCustomer.setEntryType(CommConstant.ENTRY_INPUT);
189
-        taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_READY);
189
+        // taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_READY);
190 190
 
191 191
 
192 192
         String status = params.getString("status");

+ 1
- 1
src/main/resources/mapper/TaBuildingDynamicMapper.xml Прегледај датотеку

@@ -31,7 +31,7 @@
31 31
             and city_id = #{cityId}
32 32
         </if>
33 33
         <if test="title != null and title != ''">
34
-            and title = #{title}
34
+            and title like CONCAT('%', #{title} , '%')
35 35
         </if>
36 36
         <if test="orgId != null and orgId != ''">
37 37
             and org_id = #{orgId}

+ 2
- 6
src/main/resources/mapper/TaPersonMapper.xml Прегледај датотеку

@@ -503,12 +503,8 @@ FROM
503 503
 
504 504
     <select id="channelBrokerList" resultType="com.huiju.estateagents.entity.TaPerson">
505 505
         select
506
-        p.person_id,
507
-        p.avatarurl,
508
-        p.sex,
509
-        rc.`name` as name,
510
-        rc.phone as tel,
511
-        COUNT(rc.person_id) as recommendCount
506
+        p.*,
507
+        COUNT(rc.person_id) AS recommendCount
512 508
         from ta_channel_person tch
513 509
         left join  ta_person p on  tch.person_id = p.person_id
514 510
         LEFT JOIN ta_recommend_customer rc ON p.person_id = rc.person_id

+ 184
- 3
src/main/resources/mapper/TaRecommendCustomerMapper.xml Прегледај датотеку

@@ -240,7 +240,9 @@ FROM
240 240
         a.intention as intention,
241 241
         a.create_date as createDate,
242 242
         if(a.sex = 1, '男',if(a.sex = 2, '女', '未知')) as sex,
243
-        concat(c.nickname, c.phone) as recommend
243
+        c.nickname as recommend,
244
+        c.phone as recommendTel,
245
+        if(a.verify_status = 0, '未通过', if(a.verify_status = 1, '已通过', if(a.verify_status = 2, '已驳回', ''))) as verifyStatusName
244 246
         FROM
245 247
         ta_recommend_customer a
246 248
         LEFT JOIN ta_person c on a.recommend_person = c.person_id
@@ -333,13 +335,31 @@ FROM
333 335
         a.phone as phone,
334 336
         if(a.gender = '1', '男', if(a.gender = '2', '女', '未知')) as gender,
335 337
         if(ifnull(tc.channel_name, '') != '', '渠道经纪人', '独立经纪人') as personType,
336
-        tc.channel_name  as channelName
338
+        tc.channel_name  as channelName,
339
+        (
340
+            SELECT
341
+              count( 1 )
342
+            FROM
343
+              ta_recommend_customer tarc
344
+            LEFT JOIN ta_person tp ON tarc.recommend_person = tp.person_id
345
+            WHERE
346
+              tarc.recommend_person = a.person_id and ifnull(tp.person_type, '') = 'customer'
347
+        ) AS recommedCount,
348
+        (
349
+            SELECT
350
+              count( 1 )
351
+            FROM
352
+              ta_recommend_customer tarc
353
+            LEFT JOIN ta_person tp ON tarc.recommend_person = tp.person_id
354
+            WHERE
355
+              tarc.recommend_person = a.person_id and ifnull(tp.person_type, '') in ('channel agent', 'estate agent')
356
+        ) AS agentCount
337 357
         FROM
338 358
         ta_person a
339 359
         left join ta_channel_person tcp on a.person_id = tcp.person_id
340 360
         left join ta_channel tc on tc.channel_id = tcp.channel_id
341 361
         <where>
342
-            a.person_type = 'estate agent'
362
+            ifnull(a.person_type, '') in ('channel agent', 'estate agent')
343 363
             and a.status >0
344 364
             <if test="orgId != null">
345 365
                 and a.org_id = #{orgId}
@@ -349,6 +369,167 @@ FROM
349 369
 
350 370
         ORDER BY
351 371
         a.create_date DESC
372
+        limit #{pageCode}, #{pageSize}
373
+    </select>
374
+
375
+
376
+    <select id="getPublicCustomerExportListCount" resultType="Integer">
377
+        SELECT
378
+        count(1)
379
+        FROM
380
+        ta_person b
381
+        <where>
382
+            b.status > 0
383
+            AND IFNULL(b.person_type, '') in ('estate agent', 'customer')
384
+            <if test="name != null and name !=''">
385
+                and b.nickname like CONCAT('%',#{name}, '%')
386
+            </if>
387
+            <if test="tel != null and tel!=''">
388
+                and b.phone like CONCAT('%',#{tel}, '%')
389
+            </if>
390
+            <if test="entryType != null and entryType !=''">
391
+                and b.entry_type = #{entryType}
392
+            </if>
393
+            <if test="sex != null and sex !=''">
394
+                and b.sex = #{sex}
395
+            </if>
396
+            <if test="orgId != null">
397
+                and b.org_id = #{orgId}
398
+            </if>
399
+            <if test="consultTel != null and consultTel !=''">
400
+                and b.tel like CONCAT('%',#{consultTel}, '%')
401
+            </if>
402
+            and NOT EXISTS ( select * from ta_recommend_customer a where a.recommend_person = b.person_id)
403
+        </where>
404
+        order by b.create_date desc
405
+    </select>
406
+
407
+    <select id="getPublicCustomerExportList" resultType="com.huiju.estateagents.excel.PublicCustomerExport">
408
+        SELECT
409
+          b.nickname as nickname,
410
+          b.phone as phone,
411
+          if(b.sex = 1, '男', if(b.sex = 2, '女', '未知')) as sex
412
+        FROM
413
+        ta_person b
414
+        <where>
415
+            b.status > 0
416
+            AND IFNULL(b.person_type, '') in ('estate agent', 'customer')
417
+            <if test="name != null and name !=''">
418
+                and b.nickname like CONCAT('%',#{name}, '%')
419
+            </if>
420
+            <if test="tel != null and tel!=''">
421
+                and b.phone like CONCAT('%',#{tel}, '%')
422
+            </if>
423
+            <if test="entryType != null and entryType !=''">
424
+                and b.entry_type = #{entryType}
425
+            </if>
426
+            <if test="sex != null and sex !=''">
427
+                and b.sex = #{sex}
428
+            </if>
429
+            <if test="orgId != null">
430
+                and b.org_id = #{orgId}
431
+            </if>
432
+            <if test="consultTel != null and consultTel !=''">
433
+                and b.tel like CONCAT('%',#{consultTel}, '%')
434
+            </if>
435
+            and NOT EXISTS ( select * from ta_recommend_customer a where a.recommend_person = b.person_id)
436
+        </where>
437
+        order by b.create_date desc
438
+        limit #{pageCode}, #{pageSize}
439
+    </select>
440
+
441
+    <select id="getCustomerExportListCount" resultType="Integer" >
442
+        SELECT
443
+            count(1)
444
+        FROM
445
+        ta_recommend_customer a
446
+        LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
447
+        LEFT JOIN ta_person c on a.recommend_person = c.person_id
448
+        <where>
449
+            a.status > 0
450
+            and realty_consultant is not null
451
+            <if test="orgId != null">
452
+                and a.org_id = #{orgId}
453
+            </if>
454
+            <if test="building != null and building !=''">
455
+                and a.building_id = #{building}
456
+            </if>
457
+            <if test="name != null and name !=''">
458
+                and a.name like CONCAT('%',#{name}, '%')
459
+            </if>
460
+            <if test="tel != null and tel!=''">
461
+                and a.phone like CONCAT('%',#{tel}, '%')
462
+            </if>
463
+            <if test="consultName != null and consultName !=''">
464
+                and b.name like CONCAT('%',#{consultName}, '%')
465
+            </if>
466
+            <if test="consultTel != null and consultTel !=''">
467
+                and b.tel like CONCAT('%',#{consultTel}, '%')
468
+            </if>
469
+            <if test="entryType != null and entryType !=''">
470
+                and a.entry_type = #{entryType}
471
+            </if>
472
+            <if test="verifyStatus != null and verifyStatus !=''">
473
+                and a.verify_status = #{verifyStatus}
474
+            </if>
475
+            <if test="status != null and status !=''">
476
+                and a.status = #{status}
477
+            </if>
478
+            <if test="sex != null and sex !=''">
479
+                and a.sex = #{sex}
480
+            </if>
481
+        </where>
482
+        order by a.create_date desc
483
+    </select>
484
+
485
+
486
+    <select id="getCustomerExportList" resultType="com.huiju.estateagents.excel.PrivateCustomerExport">
487
+        SELECT
488
+        a.name AS name,
489
+        a.phone as phone,
490
+        if(a.sex = 1, '男', if(a.sex = 2, '女', '未知')) as sex,
491
+        b.name as consultantName,
492
+        b.tel as consultTel
493
+        FROM
494
+        ta_recommend_customer a
495
+        LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
496
+        LEFT JOIN ta_person c on a.recommend_person = c.person_id
497
+        <where>
498
+            a.status > 0
499
+            and realty_consultant is not null
500
+            <if test="orgId != null">
501
+                and a.org_id = #{orgId}
502
+            </if>
503
+            <if test="building != null and building !=''">
504
+                and a.building_id = #{building}
505
+            </if>
506
+            <if test="name != null and name !=''">
507
+                and a.name like CONCAT('%',#{name}, '%')
508
+            </if>
509
+            <if test="tel != null and tel!=''">
510
+                and a.phone like CONCAT('%',#{tel}, '%')
511
+            </if>
512
+            <if test="consultName != null and consultName !=''">
513
+                and b.name like CONCAT('%',#{consultName}, '%')
514
+            </if>
515
+            <if test="consultTel != null and consultTel !=''">
516
+                and b.tel like CONCAT('%',#{consultTel}, '%')
517
+            </if>
518
+            <if test="entryType != null and entryType !=''">
519
+                and a.entry_type = #{entryType}
520
+            </if>
521
+            <if test="verifyStatus != null and verifyStatus !=''">
522
+                and a.verify_status = #{verifyStatus}
523
+            </if>
524
+            <if test="status != null and status !=''">
525
+                and a.status = #{status}
526
+            </if>
527
+            <if test="sex != null and sex !=''">
528
+                and a.sex = #{sex}
529
+            </if>
530
+        </where>
531
+        order by a.create_date desc
532
+        limit #{pageCode}, #{pageSize}
352 533
     </select>
353 534
 
354 535
 </mapper>