Browse Source

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

傅行帆 5 years ago
parent
commit
3bbbf5d188

+ 8
- 8
src/main/java/com/huiju/estateagents/controller/TaPersonVisitRecordController.java View File

272
     @RequestMapping(value = "/wx/activityVisitRecord", method = RequestMethod.GET)
272
     @RequestMapping(value = "/wx/activityVisitRecord", method = RequestMethod.GET)
273
     public ResponseBean wxPersonActivityVisitRecordList(@RequestParam(value = "pageNumber", defaultValue = "1") Integer pageNumber,
273
     public ResponseBean wxPersonActivityVisitRecordList(@RequestParam(value = "pageNumber", defaultValue = "1") Integer pageNumber,
274
                                                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
274
                                                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
275
-                                                        @RequestParam(value = "userId") Integer userId,
275
+                                                        @RequestParam(value = "personId") String personId,
276
                                                         @RequestParam(value = "targetId") String targetId,
276
                                                         @RequestParam(value = "targetId") String targetId,
277
                                                         @RequestParam(value = "eventType") String eventType,
277
                                                         @RequestParam(value = "eventType") String eventType,
278
                                                         HttpServletRequest request) {
278
                                                         HttpServletRequest request) {
279
         try {
279
         try {
280
             //使用分页插件
280
             //使用分页插件
281
             IPage<TaPersonVisitRecord> pg = new Page<>(pageNumber, pageSize);
281
             IPage<TaPersonVisitRecord> pg = new Page<>(pageNumber, pageSize);
282
-            IPage<TaPersonVisitRecord> result = iTaPersonVisitRecordService.getWxActivityVisitRecordList(pg, userId, getOrgId(request), targetId, eventType);
282
+            IPage<TaPersonVisitRecord> result = iTaPersonVisitRecordService.getWxActivityVisitRecordList(pg, personId, getOrgId(request), targetId, eventType);
283
             return ResponseBean.success(result);
283
             return ResponseBean.success(result);
284
         } catch (Exception e) {
284
         } catch (Exception e) {
285
             e.printStackTrace();
285
             e.printStackTrace();
293
      *
293
      *
294
      * @param pageNumber
294
      * @param pageNumber
295
      * @param pageSize
295
      * @param pageSize
296
-     * @param userId
296
+     * @param personId
297
      * @param request
297
      * @param request
298
      * @return
298
      * @return
299
      */
299
      */
300
     @RequestMapping(value = "/wx/shareRecords", method = RequestMethod.GET)
300
     @RequestMapping(value = "/wx/shareRecords", method = RequestMethod.GET)
301
     public ResponseBean wxShareRecordsByUserId(@RequestParam(value = "pageNumber", defaultValue = "1") Integer pageNumber,
301
     public ResponseBean wxShareRecordsByUserId(@RequestParam(value = "pageNumber", defaultValue = "1") Integer pageNumber,
302
                                                @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
302
                                                @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
303
-                                               @RequestParam(value = "userId") Integer userId,
303
+                                               @RequestParam(value = "personId") String personId,
304
                                                HttpServletRequest request) {
304
                                                HttpServletRequest request) {
305
         ResponseBean responseBean = new ResponseBean();
305
         ResponseBean responseBean = new ResponseBean();
306
-        if (userId == null) {
306
+        if (personId == null) {
307
             return responseBean;
307
             return responseBean;
308
         }
308
         }
309
         //使用分页插件
309
         //使用分页插件
310
         IPage<TaConsultantInfo> pg = new Page<>(pageNumber, pageSize);
310
         IPage<TaConsultantInfo> pg = new Page<>(pageNumber, pageSize);
311
         QueryWrapper<TaPerson> taPersonQueryWrapper = new QueryWrapper<>();
311
         QueryWrapper<TaPerson> taPersonQueryWrapper = new QueryWrapper<>();
312
-        taPersonQueryWrapper.eq("user_id", userId);
312
+        taPersonQueryWrapper.eq("person_id", personId);
313
         TaPerson taPerson = taPersonService.getOne(taPersonQueryWrapper);
313
         TaPerson taPerson = taPersonService.getOne(taPersonQueryWrapper);
314
-        IPage<TaConsultantInfo> result = iTaPersonVisitRecordService.getConsultantShareInfoList(pg, taPerson.getPersonId());
314
+        IPage<TaConsultantInfo> result = iTaPersonVisitRecordService.getConsultantShareInfoList(pg, personId);
315
 
315
 
316
         List<TaConsultantInfo> taConsultantInfos = result.getRecords();
316
         List<TaConsultantInfo> taConsultantInfos = result.getRecords();
317
         taConsultantInfos.forEach(e -> {
317
         taConsultantInfos.forEach(e -> {
318
-            Integer shareNum = iTaPersonVisitRecordService.countShareNumByEventType(getOrgId(request), e.getTargetId(), userId, taPerson.getPersonId(), (CommConstant.FAVOR_PROJECT.equals(e.getEventType()) ? "building" : CommConstant.FAVOR_ACTIVITY.equals(e.getEventType()) ? "dynamic" : e.getEventType()) + "_share");
318
+            Integer shareNum = iTaPersonVisitRecordService.countShareNumByEventType(getOrgId(request), e.getTargetId(), taPerson.getUserId(), taPerson.getPersonId(), (CommConstant.FAVOR_PROJECT.equals(e.getEventType()) ? "building" : CommConstant.FAVOR_ACTIVITY.equals(e.getEventType()) ? "dynamic" : e.getEventType()) + "_share");
319
             switch (e.getEventType()) {
319
             switch (e.getEventType()) {
320
                 case CommConstant.FAVOR_ACTIVITY:
320
                 case CommConstant.FAVOR_ACTIVITY:
321
                     e.setActivityShareNum(shareNum);
321
                     e.setActivityShareNum(shareNum);

+ 14
- 14
src/main/java/com/huiju/estateagents/excel/PrivateCustomerExport.java View File

14
      * 姓名
14
      * 姓名
15
      */
15
      */
16
     @ColumnWidth(15)
16
     @ColumnWidth(15)
17
-    @ExcelProperty(value = "姓名", index = 0)
17
+    @ExcelProperty(value = "客户昵称", index = 0)
18
     private String name;
18
     private String name;
19
 
19
 
20
     /**
20
     /**
21
      * 电话
21
      * 电话
22
      */
22
      */
23
     @ColumnWidth(15)
23
     @ColumnWidth(15)
24
-    @ExcelProperty(value = "电话", index = 1)
24
+    @ExcelProperty(value = "手机号码", index = 1)
25
     private String phone;
25
     private String phone;
26
 
26
 
27
     /**
27
     /**
28
      * 性别
28
      * 性别
29
      */
29
      */
30
     @ColumnWidth(15)
30
     @ColumnWidth(15)
31
-    @ExcelProperty(value = "性别", index = 2)
31
+    @ExcelProperty(value = "性别", index = 9)
32
     private String sex;
32
     private String sex;
33
 
33
 
34
     /**
34
     /**
56
      * 用户注册时间
56
      * 用户注册时间
57
      */
57
      */
58
     @ColumnWidth(15)
58
     @ColumnWidth(15)
59
-    @ExcelProperty(value = "关注时间", index = 6)
59
+    @ExcelProperty(value = "关注时间(用户注册时间)", index = 2)
60
     private String createDate;
60
     private String createDate;
61
 
61
 
62
     /**
62
     /**
63
      * 国家
63
      * 国家
64
      */
64
      */
65
     @ColumnWidth(15)
65
     @ColumnWidth(15)
66
-    @ExcelProperty(value = "国家", index = 7)
67
-    private String country;
68
-
69
-    /**
70
-     * 省份
71
-     */
72
-    @ColumnWidth(15)
73
-    @ExcelProperty(value = "省份", index = 8)
66
+    @ExcelProperty(value = "归属地", index = 6)
74
     private String province;
67
     private String province;
75
 
68
 
69
+//    /**
70
+//     * 省份
71
+//     */
72
+//    @ColumnWidth(15)
73
+//    @ExcelProperty(value = "省份", index = 8)
74
+//    private String province;
75
+
76
     /**
76
     /**
77
      * 来访方式
77
      * 来访方式
78
      */
78
      */
79
     @ColumnWidth(15)
79
     @ColumnWidth(15)
80
-    @ExcelProperty(value = "来访方式", index = 9)
80
+    @ExcelProperty(value = "来访方式(场景渠道)", index = 7)
81
     private String sceneType;
81
     private String sceneType;
82
 
82
 
83
     /**
83
     /**
84
      * 意向度
84
      * 意向度
85
      */
85
      */
86
     @ColumnWidth(15)
86
     @ColumnWidth(15)
87
-    @ExcelProperty(value = "意向度", index = 10)
87
+    @ExcelProperty(value = "意向度(意向值)", index = 8)
88
     private String intention ;
88
     private String intention ;
89
 }
89
 }

+ 16
- 16
src/main/java/com/huiju/estateagents/excel/PublicCustomerExport.java View File

14
      * 姓名
14
      * 姓名
15
      */
15
      */
16
     @ColumnWidth(15)
16
     @ColumnWidth(15)
17
-    @ExcelProperty(value = "姓名", index = 0)
17
+    @ExcelProperty(value = "客户昵称", index = 0)
18
     private String nickname;
18
     private String nickname;
19
 
19
 
20
     /**
20
     /**
21
      * 电话
21
      * 电话
22
      */
22
      */
23
     @ColumnWidth(15)
23
     @ColumnWidth(15)
24
-    @ExcelProperty(value = "电话", index = 1)
24
+    @ExcelProperty(value = "手机号码", index = 1)
25
     private String phone;
25
     private String phone;
26
 
26
 
27
     /**
27
     /**
28
      * 性别
28
      * 性别
29
      */
29
      */
30
     @ColumnWidth(15)
30
     @ColumnWidth(15)
31
-    @ExcelProperty(value = "性别", index = 2)
31
+    @ExcelProperty(value = "性别", index = 7)
32
     private String sex;
32
     private String sex;
33
 
33
 
34
     /**
34
     /**
35
      * 关注时间
35
      * 关注时间
36
      */
36
      */
37
     @ColumnWidth(15)
37
     @ColumnWidth(15)
38
-    @ExcelProperty(value = "关注时间", index = 3)
38
+    @ExcelProperty(value = "关注时间(用户注册时间)", index = 2)
39
     private String createDate;
39
     private String createDate;
40
 
40
 
41
     /**
41
     /**
42
-     * 国家
42
+     * 归属地
43
      */
43
      */
44
     @ColumnWidth(15)
44
     @ColumnWidth(15)
45
-    @ExcelProperty(value = "国家", index = 4)
46
-    private String country;
47
-
48
-    /**
49
-     * 省份
50
-     */
51
-    @ColumnWidth(15)
52
-    @ExcelProperty(value = "省份", index = 5)
45
+    @ExcelProperty(value = "归属地", index = 4)
53
     private String province;
46
     private String province;
54
 
47
 
48
+//    /**
49
+//     * 省份
50
+//     */
51
+//    @ColumnWidth(15)
52
+//    @ExcelProperty(value = "省份", index = 5)
53
+//    private String province;
54
+
55
     /**
55
     /**
56
      * 来访方式
56
      * 来访方式
57
      */
57
      */
58
     @ColumnWidth(15)
58
     @ColumnWidth(15)
59
-    @ExcelProperty(value = "性别", index = 6)
59
+    @ExcelProperty(value = "来访方式(场景渠道)", index = 5)
60
     private String sceneType;
60
     private String sceneType;
61
 
61
 
62
     /**
62
     /**
63
      * 意向度
63
      * 意向度
64
      */
64
      */
65
     @ColumnWidth(15)
65
     @ColumnWidth(15)
66
-    @ExcelProperty(value = "意向度", index = 7)
66
+    @ExcelProperty(value = "意向度(意向值)", index = 6)
67
     private String intention;
67
     private String intention;
68
 
68
 
69
     /**
69
     /**
70
      * 项目名称
70
      * 项目名称
71
      */
71
      */
72
     @ColumnWidth(15)
72
     @ColumnWidth(15)
73
-    @ExcelProperty(value = "项目名称", index = 8)
73
+    @ExcelProperty(value = "项目名称", index = 3)
74
     private String buildingName;
74
     private String buildingName;
75
 }
75
 }

+ 1
- 1
src/main/java/com/huiju/estateagents/service/ITaPersonVisitRecordService.java View File

45
 	 * @param orgId
45
 	 * @param orgId
46
 	 * @return
46
 	 * @return
47
 	 */
47
 	 */
48
-	IPage<TaPersonVisitRecord> getWxActivityVisitRecordList(IPage<TaPersonVisitRecord> pg, Integer userId, Integer orgId, String targetId, String eventType);
48
+	IPage<TaPersonVisitRecord> getWxActivityVisitRecordList(IPage<TaPersonVisitRecord> pg, String personId, Integer orgId, String targetId, String eventType);
49
 
49
 
50
 	/**
50
 	/**
51
 	 * 获取这个人的活动数据列表
51
 	 * 获取这个人的活动数据列表

+ 3
- 3
src/main/java/com/huiju/estateagents/service/impl/TaPersonVisitRecordServiceImpl.java View File

304
 	 * @return
304
 	 * @return
305
 	 */
305
 	 */
306
 	@Override
306
 	@Override
307
-	public IPage<TaPersonVisitRecord> getWxActivityVisitRecordList(IPage<TaPersonVisitRecord> pg, Integer userId, Integer orgId, String targetId, String eventType) {
307
+	public IPage<TaPersonVisitRecord> getWxActivityVisitRecordList(IPage<TaPersonVisitRecord> pg, String personId, Integer orgId, String targetId, String eventType) {
308
 		//根据userId获取用户信息
308
 		//根据userId获取用户信息
309
 		QueryWrapper<TaPerson> taPersonQueryWrapper = new QueryWrapper<>();
309
 		QueryWrapper<TaPerson> taPersonQueryWrapper = new QueryWrapper<>();
310
-		taPersonQueryWrapper.eq("user_id",userId);
310
+		taPersonQueryWrapper.eq("person_id",personId);
311
 		taPersonQueryWrapper.eq("org_id",orgId);
311
 		taPersonQueryWrapper.eq("org_id",orgId);
312
 		TaPerson taPerson = taPersonMapper.selectOne(taPersonQueryWrapper);
312
 		TaPerson taPerson = taPersonMapper.selectOne(taPersonQueryWrapper);
313
 		//获取我的访问客户列表
313
 		//获取我的访问客户列表
314
-		IPage<TaPersonVisitRecord> result = personVisitRecordMapper.getWxActivityVisitRecordList(pg,userId,orgId, targetId,taPerson.getPersonId(), (CommConstant.FAVOR_PROJECT.equals(eventType) ? "building" : CommConstant.FAVOR_ACTIVITY.equals(eventType) ? "dynamic" : eventType)  + "_share");
314
+		IPage<TaPersonVisitRecord> result = personVisitRecordMapper.getWxActivityVisitRecordList(pg, taPerson.getUserId(), orgId, targetId, personId, (CommConstant.FAVOR_PROJECT.equals(eventType) ? "building" : CommConstant.FAVOR_ACTIVITY.equals(eventType) ? "dynamic" : eventType)  + "_share");
315
 		List<TaPersonVisitRecord> records = result.getRecords();
315
 		List<TaPersonVisitRecord> records = result.getRecords();
316
 		//判断是否我的客户状态
316
 		//判断是否我的客户状态
317
 		records.forEach(e -> {
317
 		records.forEach(e -> {

+ 4
- 4
src/main/resources/mapper/TaPersonVisitRecordMapper.xml View File

123
 
123
 
124
     <select id="getWxActivityVisitRecordList" resultType="com.huiju.estateagents.entity.TaPersonVisitRecord">
124
     <select id="getWxActivityVisitRecordList" resultType="com.huiju.estateagents.entity.TaPersonVisitRecord">
125
         SELECT
125
         SELECT
126
-            t.share_from_id, t.share_person as consultant_id, t.share_person_type, t.person_id, t.target_type, t.target_id, t.create_date as visit_time, t.org_id ,building_id, t.status, t.is_first_time,
126
+            t.share_from_id, t.share_person as consultant_id, t.share_person_type, t.person_id, t.target_type, t.target_id, t.create_date as visit_time, t.org_id ,t.building_id, t.status, t.is_first_time,
127
 	        p.`name` as user_name,
127
 	        p.`name` as user_name,
128
 	        p.`nickname` as nickname,
128
 	        p.`nickname` as nickname,
129
 	        p.avatarurl
129
 	        p.avatarurl
384
         select count(DISTINCT t.person_id)  from ta_share_person_from t
384
         select count(DISTINCT t.person_id)  from ta_share_person_from t
385
         left join ta_person a on t.person_id = a.person_id
385
         left join ta_person a on t.person_id = a.person_id
386
         where
386
         where
387
-        (t.share_person = #{userId}
388
-        <if test="personId != null and personId != ''">
389
-            or t.share_person = #{personId}
387
+        (t.share_person = #{personId}
388
+        <if test="userId != null and userId != ''">
389
+            or t.share_person = #{userId}
390
         </if>
390
         </if>
391
         )
391
         )
392
         and t.org_id = #{orgId}
392
         and t.org_id = #{orgId}

+ 3
- 5
src/main/resources/mapper/TaRecommendCustomerMapper.xml View File

281
             <if test="buildingId != null and buildingId !=''">
281
             <if test="buildingId != null and buildingId !=''">
282
                 AND b.building_id = #{buildingId}
282
                 AND b.building_id = #{buildingId}
283
             </if>
283
             </if>
284
-            and NOT EXISTS ( select * from ta_recommend_customer a where a.org_id = #{orgId} and a.recommend_person = b.person_id)
284
+<!--            and NOT EXISTS ( select * from ta_recommend_customer a where a.org_id = #{orgId} and a.recommend_person = b.person_id)-->
285
             <if test="personBuildingList != null and personBuildingList.size > 0">
285
             <if test="personBuildingList != null and personBuildingList.size > 0">
286
                 AND b.building_id in
286
                 AND b.building_id in
287
                 <foreach collection="personBuildingList" item="personBuilding" open="(" close=")" separator=",">
287
                 <foreach collection="personBuildingList" item="personBuilding" open="(" close=")" separator=",">
547
           b.phone as phone,
547
           b.phone as phone,
548
           if(b.gender = 1, '男', if(b.gender = 2, '女', '未知')) as sex,
548
           if(b.gender = 1, '男', if(b.gender = 2, '女', '未知')) as sex,
549
           b.create_date,
549
           b.create_date,
550
-          b.country,
551
-          b.province,
550
+          concat(b.country, b.province) as province,
552
           z.intention,
551
           z.intention,
553
           d.scene_alias as sceneType,
552
           d.scene_alias as sceneType,
554
           t.building_name
553
           t.building_name
666
         t.building_name,
665
         t.building_name,
667
         z.intention,
666
         z.intention,
668
         a.create_date,
667
         a.create_date,
669
-        a.country,
670
-        a.province,
668
+        concat(a.country,a.province) as province,
671
         w.scene_alias as scene_type
669
         w.scene_alias as scene_type
672
         FROM
670
         FROM
673
         ta_recommend_customer a
671
         ta_recommend_customer a