Преглед на файлове

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

傅行帆 преди 5 години
родител
ревизия
6641ff77c4

+ 5
- 2
src/main/java/com/huiju/estateagents/controller/TaRecommendCustomerController.java Целия файл

781
      * 导出数据(经纪人)
781
      * 导出数据(经纪人)
782
      */
782
      */
783
     @GetMapping("/admin/customer/recommend/agents/export")
783
     @GetMapping("/admin/customer/recommend/agents/export")
784
-    public void agentsExport(HttpServletRequest request, HttpServletResponse response) throws IOException {
784
+    public void agentsExport(@RequestParam(value = "name", required = false) String name,
785
+                             @RequestParam(value = "tel", required = false) String tel,
786
+                             @RequestParam(value = "channelId", required = false) String channelId,
787
+                             HttpServletRequest request, HttpServletResponse response) throws IOException {
785
 //        response.setContentType("application/vnd.ms-excel");
788
 //        response.setContentType("application/vnd.ms-excel");
786
         response.setContentType("application/octet-stream");
789
         response.setContentType("application/octet-stream");
787
         response.setCharacterEncoding("utf-8");
790
         response.setCharacterEncoding("utf-8");
799
         WriteSheet writeSheet = EasyExcel.writerSheet("经纪人").build();
802
         WriteSheet writeSheet = EasyExcel.writerSheet("经纪人").build();
800
         List<AgentsRecommendCustomer> recCustomerExport = null;
803
         List<AgentsRecommendCustomer> recCustomerExport = null;
801
         do {
804
         do {
802
-            recCustomerExport = taRecommendCustomerService.getIndependentAgentsExport(getOrgId(request), pageCode * pageSize, pageSize);
805
+            recCustomerExport = taRecommendCustomerService.getIndependentAgentsExport(name, tel, channelId, getOrgId(request), pageCode * pageSize, pageSize);
803
             excelWriter.write(recCustomerExport, writeSheet);
806
             excelWriter.write(recCustomerExport, writeSheet);
804
 
807
 
805
             pageCode++;
808
             pageCode++;

+ 1
- 1
src/main/java/com/huiju/estateagents/mapper/TaRecommendCustomerMapper.java Целия файл

107
      * @param pageSize
107
      * @param pageSize
108
      * @return
108
      * @return
109
      */
109
      */
110
-    List<AgentsRecommendCustomer> getIndependentAgentsExport(@Param("orgId") Integer orgId, @Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize);
110
+    List<AgentsRecommendCustomer> getIndependentAgentsExport(@Param("name")String name, @Param("tel")String tel, @Param("channelId")String channelId, @Param("orgId") Integer orgId, @Param("pageCode") Integer pageCode, @Param("pageSize") Integer pageSize);
111
 
111
 
112
     /**
112
     /**
113
      * 导出数据 公客总数
113
      * 导出数据 公客总数

+ 1
- 1
src/main/java/com/huiju/estateagents/service/ITaRecommendCustomerService.java Целия файл

111
      * @param pageSize
111
      * @param pageSize
112
      * @return
112
      * @return
113
      */
113
      */
114
-    List<AgentsRecommendCustomer> getIndependentAgentsExport(Integer orgId, Integer pageCode, Integer pageSize);
114
+    List<AgentsRecommendCustomer> getIndependentAgentsExport(String name, String tel, String channelId, Integer orgId, Integer pageCode, Integer pageSize);
115
 
115
 
116
     /**
116
     /**
117
      * 查询我的客户人数集合
117
      * 查询我的客户人数集合

+ 1
- 1
src/main/java/com/huiju/estateagents/service/impl/TaPersonServiceImpl.java Целия файл

982
 
982
 
983
 
983
 
984
             TaRecommendCustomer customer = copyByPerosn(person, new TaRecommendCustomer());
984
             TaRecommendCustomer customer = copyByPerosn(person, new TaRecommendCustomer());
985
-            customer.setVerifyStatus(CommConstant.VERIFY_READY);
985
+            customer.setVerifyStatus(CommConstant.VERIFY_AGREE);
986
             customer.setStatus(CommConstant.CUSTOMER_REPORT);
986
             customer.setStatus(CommConstant.CUSTOMER_REPORT);
987
             customer.setEntryType(CommConstant.ENTRY_INPUT);
987
             customer.setEntryType(CommConstant.ENTRY_INPUT);
988
             customer.setCreateDate(now);
988
             customer.setCreateDate(now);

+ 2
- 2
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java Целия файл

931
     }
931
     }
932
 
932
 
933
     @Override
933
     @Override
934
-    public List<AgentsRecommendCustomer> getIndependentAgentsExport(Integer orgId, Integer pageCode, Integer pageSize) {
935
-        return taRecommendCustomerMapper.getIndependentAgentsExport(orgId, pageCode, pageSize);
934
+    public List<AgentsRecommendCustomer> getIndependentAgentsExport(String name, String tel, String channelId, Integer orgId, Integer pageCode, Integer pageSize) {
935
+        return taRecommendCustomerMapper.getIndependentAgentsExport(name, tel, channelId, orgId, pageCode, pageSize);
936
     }
936
     }
937
 
937
 
938
     /**
938
     /**

+ 2
- 1
src/main/resources/mapper/TaChannelMapper.xml Целия файл

31
     <select id="pageTaChannel" resultType="com.huiju.estateagents.entity.TaChannel">
31
     <select id="pageTaChannel" resultType="com.huiju.estateagents.entity.TaChannel">
32
         SELECT
32
         SELECT
33
         c.*,
33
         c.*,
34
-        (select count(*) AS brokerCount from ta_person a where a.person_id = cp.person_id) AS brokerCount,
34
+        count(tp.person_id) AS brokerCount,
35
         COUNT(rc.recommend_person) AS recommendCount,
35
         COUNT(rc.recommend_person) AS recommendCount,
36
         (SELECT COUNT(p.recommend_agent ) from ta_person p WHERE cp.person_id = p.recommend_agent) AS inviteCount,
36
         (SELECT COUNT(p.recommend_agent ) from ta_person p WHERE cp.person_id = p.recommend_agent) AS inviteCount,
37
         cp.person_id
37
         cp.person_id
38
         FROM
38
         FROM
39
         ta_channel c
39
         ta_channel c
40
         LEFT JOIN ta_channel_person cp ON c.channel_id = cp.channel_id
40
         LEFT JOIN ta_channel_person cp ON c.channel_id = cp.channel_id
41
+        LEFT JOIN ta_person tp on cp.person_id = tp.person_id and tp.person_type = 'estate agent'
41
         LEFT JOIN ta_recommend_customer rc ON cp.person_id = rc.recommend_person and rc.verify_status = 1 and rc.`status` = 1
42
         LEFT JOIN ta_recommend_customer rc ON cp.person_id = rc.recommend_person and rc.verify_status = 1 and rc.`status` = 1
42
         <where>
43
         <where>
43
             <if test="channelId != null and channelId != ''">
44
             <if test="channelId != null and channelId != ''">

+ 1
- 1
src/main/resources/mapper/TaPersonMapper.xml Целия файл

520
         p.*,
520
         p.*,
521
         COUNT(rc.person_id) AS recommendCount
521
         COUNT(rc.person_id) AS recommendCount
522
         from ta_channel_person tch
522
         from ta_channel_person tch
523
-        left join  ta_person p on  tch.person_id = p.person_id
523
+        left join  ta_person p on  tch.person_id = p.person_id and p.person_type = 'estate agent'
524
         LEFT JOIN ta_recommend_customer rc ON p.person_id = rc.person_id
524
         LEFT JOIN ta_recommend_customer rc ON p.person_id = rc.person_id
525
         <where>
525
         <where>
526
         <if test="name !=null and name !=''">
526
         <if test="name !=null and name !=''">

+ 10
- 1
src/main/resources/mapper/TaRecommendCustomerMapper.xml Целия файл

493
         a.nickname as nickname,
493
         a.nickname as nickname,
494
         a.phone as phone,
494
         a.phone as phone,
495
         if(a.gender = '1', '男', if(a.gender = '2', '女', '未知')) as gender,
495
         if(a.gender = '1', '男', if(a.gender = '2', '女', '未知')) as gender,
496
-        if(ifnull(tc.channel_name, '') != '', '渠道经纪人', '独立经纪人') as personType,
496
+        '专业经纪人' as personType,
497
         tc.channel_name as channelName,
497
         tc.channel_name as channelName,
498
         (
498
         (
499
         SELECT
499
         SELECT
523
             <if test="orgId != null">
523
             <if test="orgId != null">
524
                 and a.org_id = #{orgId}
524
                 and a.org_id = #{orgId}
525
             </if>
525
             </if>
526
+            <if test="name != null and name != ''">
527
+                and a.nickname like concat('%', #{orgId}, '%')
528
+            </if>
529
+            <if test="tel != null and tel != null">
530
+                and a.phone like concat('%', #{tel}, '%')
531
+            </if>
532
+            <if test="channelId != null and channelId != ''">
533
+                and tc.channel_id = #{channelId}
534
+            </if>
526
 
535
 
527
         </where>
536
         </where>
528
 
537