Bladeren bron

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

张延森 5 jaren geleden
bovenliggende
commit
31036e03b6

+ 39
- 8
src/main/java/com/huiju/estateagents/controller/MiniAppController.java Bestand weergeven

@@ -1,6 +1,5 @@
1 1
 package com.huiju.estateagents.controller;
2 2
 
3
-import cn.binarywang.wx.miniapp.api.WxMaService;
4 3
 import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
5 4
 import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
6 5
 import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
@@ -8,22 +7,20 @@ import com.alibaba.fastjson.JSONObject;
8 7
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
9 8
 import com.huiju.estateagents.base.BaseController;
10 9
 import com.huiju.estateagents.base.ResponseBean;
11
-import com.huiju.estateagents.center.sysUser.entity.SysToken;
12 10
 import com.huiju.estateagents.center.sysUser.service.ISysTokenService;
13 11
 import com.huiju.estateagents.center.taUser.entity.TaUser;
14 12
 import com.huiju.estateagents.center.taUser.service.ITaUserService;
15 13
 import com.huiju.estateagents.common.CommConstant;
16
-import com.huiju.estateagents.common.WxUtils;
14
+import com.huiju.estateagents.common.JWTUtils;
15
+import com.huiju.estateagents.drainage.entity.TaDrainage;
16
+import com.huiju.estateagents.drainage.service.ITaDrainageService;
17 17
 import com.huiju.estateagents.entity.*;
18 18
 import com.huiju.estateagents.event.EventBus;
19 19
 import com.huiju.estateagents.mapper.TaOrgCityMapper;
20
-import com.huiju.estateagents.mapper.TaShareMapper;
20
+import com.huiju.estateagents.mapper.TaSalesBatchMapper;
21 21
 import com.huiju.estateagents.service.*;
22
-import com.huiju.estateagents.common.JWTUtils;
23
-import com.huiju.estateagents.third.entity.TaThirdPartyMiniappConfig;
24 22
 import com.huiju.estateagents.third.service.ITaThirdPartyMiniappConfigService;
25 23
 import me.chanjar.weixin.common.error.WxErrorException;
26
-import net.bytebuddy.asm.Advice;
27 24
 import org.apache.commons.collections.CollectionUtils;
28 25
 import org.apache.commons.lang3.StringUtils;
29 26
 import org.apache.http.HttpStatus;
@@ -36,7 +33,6 @@ import org.springframework.web.bind.annotation.*;
36 33
 import javax.annotation.Resource;
37 34
 import javax.servlet.http.HttpServletRequest;
38 35
 import java.time.LocalDateTime;
39
-import java.util.Collections;
40 36
 import java.util.HashMap;
41 37
 import java.util.List;
42 38
 import java.util.Map;
@@ -103,6 +99,21 @@ public class MiniAppController extends BaseController {
103 99
     @Autowired
104 100
     public ITdCityService iTdCityService;
105 101
 
102
+    @Autowired
103
+    private IHelpActivityService helpActivityService;
104
+
105
+    @Autowired
106
+    private ITaShareActivityService taShareActivityService;
107
+
108
+    @Autowired
109
+    private ITaLiveActivityService taLiveActivityService;
110
+
111
+    @Autowired
112
+    private ITaDrainageService taDrainageService;
113
+
114
+    @Autowired
115
+    private TaSalesBatchMapper taSalesBatchMapper;
116
+
106 117
     /**
107 118
      * 验证接入
108 119
      */
@@ -295,6 +306,26 @@ public class MiniAppController extends BaseController {
295 306
                 } else if (from.contains("building")) {
296 307
                     taSharePersonFrom.setBuildingId(targetId);
297 308
                     sharePersonFromQueryWrapper.eq("building_id", targetId);
309
+                }else if (from.contains("help")) {
310
+                    HelpActivity helpActivity = helpActivityService.getById(targetId);
311
+                    taSharePersonFrom.setBuildingId(helpActivity.getBuildingId());
312
+                    sharePersonFromQueryWrapper.eq("building_id", helpActivity.getBuildingId());
313
+                }else if (from.contains("group")) {
314
+                    TaShareActivity taShareActivity = taShareActivityService.getById(targetId);
315
+                    taSharePersonFrom.setBuildingId(taShareActivity.getBuildingId());
316
+                    sharePersonFromQueryWrapper.eq("building_id", taShareActivity.getBuildingId());
317
+                }else if (from.contains("live")) {
318
+                    TaLiveActivity liveActivity = taLiveActivityService.getById(targetId);
319
+                    taSharePersonFrom.setBuildingId(liveActivity.getBuildingId());
320
+                    sharePersonFromQueryWrapper.eq("building_id", liveActivity.getBuildingId());
321
+                }else if (from.contains("h5")) {
322
+                    TaDrainage taDrainage = taDrainageService.getById(targetId);
323
+                    taSharePersonFrom.setBuildingId(taDrainage.getBuildingId());
324
+                    sharePersonFromQueryWrapper.eq("building_id", taDrainage.getBuildingId());
325
+                }else if (from.contains("house")) {
326
+                    TaSalesBatch taSalesBatch = taSalesBatchMapper.selectById(targetId);
327
+                    taSharePersonFrom.setBuildingId(taSalesBatch.getBuildingId());
328
+                    sharePersonFromQueryWrapper.eq("building_id", taSalesBatch.getBuildingId());
298 329
                 }
299 330
                 Integer isFirstTime = taSharePersonFromService.count(sharePersonFromQueryWrapper);
300 331
                 if (isFirstTime > 0) {

+ 16
- 16
src/main/java/com/huiju/estateagents/excel/IntentionUser.java Bestand weergeven

@@ -56,39 +56,39 @@ public class IntentionUser {
56 56
     @ExcelProperty(value = "置业顾问电话", index = 6)
57 57
     private String realtyConsultantPhone;
58 58
 
59
-    /**
60
-     * 分享者
61
-     */
62
-    @ColumnWidth(15)
63
-    @ExcelProperty(value = "分享者", index = 7)
64
-    private String sharePersonName;
65
-
66
-    /**
67
-     * 分享者电话
68
-     */
69
-    @ColumnWidth(15)
70
-    @ExcelProperty(value = "分享者电话", index = 8)
71
-    private String sharePersonPhone;
59
+//    /**
60
+//     * 分享者
61
+//     */
62
+//    @ColumnWidth(15)
63
+//    @ExcelProperty(value = "分享者", index = 7)
64
+//    private String sharePersonName;
65
+//
66
+//    /**
67
+//     * 分享者电话
68
+//     */
69
+//    @ColumnWidth(15)
70
+//    @ExcelProperty(value = "分享者电话", index = 8)
71
+//    private String sharePersonPhone;
72 72
 
73 73
     /**
74 74
      * 性别
75 75
      */
76 76
     @ColumnWidth(15)
77
-    @ExcelProperty(value = "性别", index = 9)
77
+    @ExcelProperty(value = "性别", index = 7)
78 78
     private String gender;
79 79
 
80 80
     /**
81 81
      * 来源
82 82
      */
83 83
     @ColumnWidth(15)
84
-    @ExcelProperty(value = "用户来源", index = 10)
84
+    @ExcelProperty(value = "用户来源", index = 8)
85 85
     private String personFrom;
86 86
 
87 87
     /**
88 88
      * 推广人
89 89
      */
90 90
     @ColumnWidth(15)
91
-    @ExcelProperty(value = "推广人", index =11)
91
+    @ExcelProperty(value = "推广人", index = 9)
92 92
     private String recommendPerson;
93 93
 
94 94
 }

+ 4
- 6
src/main/resources/mapper/TaPersonIntentionRecordMapper.xml Bestand weergeven

@@ -43,7 +43,7 @@
43 43
         ORDER BY SUM(tpir.intention) DESC
44 44
     </select>
45 45
     <select id="selectExportIntentionUser" resultType="com.huiju.estateagents.excel.IntentionUser">
46
-        select t.*, IFNULL(b.nickname, c.user_name) as sharePersonName, ifnull(b.phone, c.phone) as sharePersonPhone, b1.scene_alias as personFrom, e.nickname as recommendPerson
46
+        select t.*, b1.scene_alias as personFrom, e.nickname as recommendPerson
47 47
         From (
48 48
 
49 49
         SELECT
@@ -60,7 +60,7 @@
60 60
 
61 61
         FROM ta_person_intention_record tpir
62 62
         LEFT JOIN ta_person tp ON tpir.person_id = tp.person_id
63
-        left join ta_recommend_customer c on c.person_id = tpir.person_id
63
+        left join ta_recommend_customer c on c.person_id = tpir.person_id and c.building_id = tpir.building_id
64 64
         left join ta_user d on c.realty_consultant = d.user_id
65 65
         <trim prefix="where" prefixOverrides="and | or">
66 66
             <if test="orgId != null">
@@ -72,11 +72,9 @@
72 72
 
73 73
         ) as t
74 74
         left join ta_share_person_from a on t.person_id = a.person_id
75
-        left join ta_user c on a.share_person = c.user_id
76
-        left join ta_person b on a.share_person = b.person_id
77
-        left join ta_person_from_record d on t.person_id = d.share_person_id and d.is_first_time = 1 and d.org_id = #{orgId}
75
+        left join ta_person_from_record d on t.person_id = d.person_id and d.is_first_time = 1 and d.org_id = #{orgId}
78 76
         left join td_wx_dict b1 on d.scene_id = b1.scene_id
79
-        left join ta_person e on d.person_id = e.person_id
77
+        left join ta_person e on d.share_person_id = e.person_id
80 78
 
81 79
         <trim prefix="where" prefixOverrides="and | or">
82 80
             <if test="buildingId != null and buildingId != ''">

+ 11
- 8
src/main/resources/mapper/statistic/TaActivityStaticMapper.xml Bestand weergeven

@@ -1105,7 +1105,8 @@
1105 1105
         ) as activity
1106 1106
 
1107 1107
         left join (
1108
-            SELECT count(1) as shareNum, a.be_share, case when a.tagert_type = 'liveApp' then 'live' when a.tagert_type = 'livePost' then 'live' else a.tagert_type end as tagert_type, a.create_date
1108
+            select count(1) as shareNum, a.* from (
1109
+            SELECT a.be_share, case when a.tagert_type = 'liveApp' then 'live' when a.tagert_type = 'livePost' then 'live' else a.tagert_type end as tagert_type, a.create_date
1109 1110
             FROM ta_share_count a where a.tagert_type in (
1110 1111
             'activity', 'group','h5','help','liveApp','livePost')
1111 1112
             and a.org_id = #{orgId}
@@ -1122,7 +1123,7 @@
1122 1123
             <if test="startDate == null or endDate == null ">
1123 1124
                 AND a.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1124 1125
             </if>
1125
-            group by a.be_share,a.tagert_type order by a.create_date desc limit 9999999
1126
+            order by a.create_date desc limit 9999999) as a group by a.be_share,a.tagert_type order by a.create_date desc
1126 1127
         ) as shareNum on shareNum.be_share = activity.activityId and shareNum.tagert_type = activity.activityType
1127 1128
 
1128 1129
         left join (
@@ -1216,7 +1217,7 @@
1216 1217
         </if>
1217 1218
         group by activity.activityId, activity.activityType
1218 1219
         <if test="colKey == null or colKey == ''">
1219
-            order by sharePersonNum.create_date desc
1220
+            order by shareNum.create_date desc
1220 1221
         </if>
1221 1222
         <if test="colKey != null and colKey != ''">
1222 1223
             ORDER BY ${colKey} ${sortType}
@@ -1317,7 +1318,9 @@
1317 1318
         ) as activity
1318 1319
 
1319 1320
         left join (
1320
-        SELECT count(1) as shareNum, a.be_share, case when a.tagert_type = 'liveApp' then 'live' when a.tagert_type = 'livePost' then 'live' else a.tagert_type end as tagert_type, a.create_date
1321
+        select count(1) as shareNum, a.* from (
1322
+
1323
+        SELECT a.be_share, case when a.tagert_type = 'liveApp' then 'live' when a.tagert_type = 'livePost' then 'live' else a.tagert_type end as tagert_type, a.create_date
1321 1324
         FROM ta_share_count a where a.tagert_type in (
1322 1325
         'activity', 'group','h5','help','liveApp','livePost')
1323 1326
         and a.org_id = #{orgId}
@@ -1334,7 +1337,7 @@
1334 1337
         <if test="startDate == null or endDate == null ">
1335 1338
             AND a.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1336 1339
         </if>
1337
-        group by a.be_share,a.tagert_type order by a.create_date desc limit 9999999
1340
+        order by a.create_date desc limit 9999999) as a group by a.be_share,a.tagert_type order by a.create_date desc
1338 1341
         ) as shareNum on shareNum.be_share = activity.activityId and shareNum.tagert_type = activity.activityType
1339 1342
 
1340 1343
         left join (
@@ -1428,7 +1431,7 @@
1428 1431
         </if>
1429 1432
         group by activity.activityId, activity.activityType
1430 1433
         <if test="colKey == null or colKey == ''">
1431
-            order by sharePersonNum.create_date desc
1434
+            order by shareNum.create_date desc
1432 1435
         </if>
1433 1436
         <if test="colKey != null and colKey != ''">
1434 1437
             ORDER BY ${colKey} ${sortType}
@@ -1971,7 +1974,7 @@
1971 1974
         a.province,
1972 1975
         b1.scene_alias as personFrom,
1973 1976
         GROUP_CONCAT(d.user_name) as realtyConsultant,
1974
-        d.phone as realtyConsultantPhone,
1977
+        group_concat(d.phone) as realtyConsultantPhone,
1975 1978
         ifnull(e.nickname, f.name) as sharePersonName,
1976 1979
         ifnull(e.phone, f.phone) as sharePersonPhone
1977 1980
         FROM ta_share_person_from t
@@ -2013,7 +2016,7 @@
2013 2016
         a.province,
2014 2017
         b1.scene_alias as personFrom,
2015 2018
         GROUP_CONCAT(d.user_name) as realtyConsultant,
2016
-        d.phone as realtyConsultantPhone,
2019
+        group_concat(d.phone) as realtyConsultantPhone,
2017 2020
         ifnull(e.nickname, f.name) as sharePersonName,
2018 2021
         ifnull(e.phone, f.phone) as sharePersonPhone
2019 2022
         FROM ta_share_person_from t