Browse Source

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

傅行帆 5 years ago
parent
commit
9ce78e9bce

+ 6
- 0
src/main/java/com/huiju/estateagents/service/impl/TaPersonBuildingServiceImpl.java View File

@@ -3,6 +3,7 @@ package com.huiju.estateagents.service.impl;
3 3
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 4
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5 5
 import com.huiju.estateagents.base.ResponseBean;
6
+import com.huiju.estateagents.common.StringUtils;
6 7
 import com.huiju.estateagents.entity.TaPerson;
7 8
 import com.huiju.estateagents.entity.TaPersonBuilding;
8 9
 import com.huiju.estateagents.entity.TaShareCount;
@@ -47,6 +48,11 @@ public class TaPersonBuildingServiceImpl extends ServiceImpl<TaPersonBuildingMap
47 48
         List<TaPersonBuilding> list = taPersonBuildingMapper.selectListByParams(page, orgId, buildingId, startCreateDate, endCreateDate, taPersonBuildingList);
48 49
         for (TaPersonBuilding taPersonBuilding : list) {
49 50
             QueryWrapper<TaPerson> taPersonQueryWrapper = new QueryWrapper<>();
51
+            if (StringUtils.isEmpty(taPersonBuilding.getPersonId())){
52
+                taPersonBuilding.setClickNum(0);
53
+                taPersonBuilding.setShareCount(0);
54
+                continue;
55
+            }
50 56
             taPersonQueryWrapper.eq("person_id", taPersonBuilding.getPersonId());
51 57
             TaPerson taPerson = taPersonMapper.selectOne(taPersonQueryWrapper);
52 58
             taPersonBuilding.setShareCount(taShareCountMapper.countShare(taPersonBuilding.getPersonId(), orgId, startCreateDate, endCreateDate));

+ 11
- 11
src/main/java/com/huiju/estateagents/websocket/ChatServer.java View File

@@ -51,7 +51,7 @@ public class ChatServer {
51 51
         removeSameFromSets(sid);
52 52
         this.session = session;
53 53
         webSocketSet.add(this);
54
-        addOnlineCount();
54
+//        addOnlineCount();
55 55
         this.sid=sid;
56 56
         log.info("有新窗口开始监听: "+sid+" ,当前在线人数为 " + getOnlineCount());
57 57
     }
@@ -71,7 +71,7 @@ public class ChatServer {
71 71
     @OnMessage
72 72
     public void onMessage(String message, Session session) {
73 73
         // 心跳
74
-        if ("ping" == message) {
74
+        if ("ping".equals(message)) {
75 75
             try {
76 76
                 this.sendMessage("pong");
77 77
             } catch (IOException e) {
@@ -119,7 +119,7 @@ public class ChatServer {
119 119
         for(ChatServer c: webSocketSet) {
120 120
             if (sid.equals(c.sid)) {
121 121
                 webSocketSet.remove(c);
122
-                subOnlineCount();
122
+//                subOnlineCount();
123 123
                 log.info("有一连接关闭:"+sid+"!当前在线人数为" + getOnlineCount());
124 124
             }
125 125
         }
@@ -129,7 +129,7 @@ public class ChatServer {
129 129
         for(ChatServer c: webSocketSet) {
130 130
             if (currentSid.equals(c.sid)) {
131 131
                 webSocketSet.remove(c);
132
-                subOnlineCount();
132
+//                subOnlineCount();
133 133
                 log.info("有一连接关闭:"+sid+"!当前在线人数为" + getOnlineCount());
134 134
             }
135 135
         }
@@ -166,16 +166,16 @@ public class ChatServer {
166 166
     }
167 167
 
168 168
     public static synchronized int getOnlineCount() {
169
-        return onlineCount;
169
+        return webSocketSet.size();
170 170
     }
171 171
 
172
-    public static synchronized void addOnlineCount() {
173
-        ChatServer.onlineCount++;
174
-    }
172
+//    public static synchronized void addOnlineCount() {
173
+//        ChatServer.onlineCount++;
174
+//    }
175 175
 
176
-    public static synchronized void subOnlineCount() {
177
-        ChatServer.onlineCount--;
178
-    }
176
+//    public static synchronized void subOnlineCount() {
177
+//        ChatServer.onlineCount--;
178
+//    }
179 179
 
180 180
     public static void setApplicationContext(ApplicationContext applicationContext) {
181 181
         ChatServer.applicationContext = applicationContext;

+ 77
- 0
src/main/resources/application-gzysd.yml View File

@@ -1,3 +1,79 @@
1
+<<<<<<< HEAD
2
+server:
3
+  port: 8009
4
+spring:
5
+  application:
6
+    name: estateagents
7
+  datasource:
8
+    username: estateagents
9
+    password: DQ@0lW##kBb2+-jPZ
10
+    url: jdbc:mysql://rm-uf6z3z6jq11x653d77o.mysql.rds.aliyuncs.com:3306/estateagents_17?useUnicode=true&serverTimezone=CTT&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&zeroDateTimeBehavior=convertToNull
11
+    driver-class-name: com.mysql.cj.jdbc.Driver
12
+    initial-size: 10 # 初始化连接数
13
+    max-active: 20 # 最大连接数
14
+    min-idle: 8 # 最小空闲数
15
+    max-idle: 8 # 最大空闲数
16
+  servlet:
17
+    multipart:
18
+      max-file-size: 10MB
19
+      max-request-size: 50MB
20
+
21
+##mybatis-plus
22
+mybatis-plus:
23
+  configuration:
24
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
25
+    call-setters-on-nulls: true
26
+  mapper-locations: classpath:mapper/**/*.xml
27
+wx:
28
+  miniapp:
29
+    appid: wxe3b1e683853800b5
30
+    secret: 207dd6d0f807b2dd0d41b57a8184365f
31
+    token:
32
+    aesKey:
33
+    msgDataFormat: JSON
34
+  tpls:
35
+    - name: notice
36
+      id: 6hWKexNlaVpAOvrcWxHHQ_Duz1gRIkg2-Clsktp2-Os
37
+      keywords: 4
38
+    - name: newCustomer
39
+      id: WiBYjqkE9KvwDv1WSq5vnuv5A6FSaOB8ETFcrVmtCEI
40
+      keywords: 4
41
+    - name: mainbiz
42
+      id: IywdSfNPegeg5GB3Q-TVieSYD9DA0im8eI-hF_u0i-4
43
+      keywords: 6
44
+ali:
45
+  accessKeyId: LTAIkc75dpkJw8Lb
46
+  accessKeySecret: v4bvXCaix6vSDTCFfwSAdqV53iFEQw
47
+  oss:
48
+    endpoint: oss-cn-shanghai.aliyuncs.com
49
+    bucketName: estateagents
50
+    bucketURL: https://estateagents.oss-cn-shanghai.aliyuncs.com
51
+
52
+# 手机短信服务
53
+sms:
54
+  url: http://micservice.ycjcjy.com/sms
55
+  method: POST
56
+  contentType: "application/json;charset=UTF-8"
57
+  template:
58
+    code:
59
+    tel:
60
+    params:
61
+
62
+  # 以下为各模板 code
63
+  # 验证码
64
+  captcha:
65
+    # 模板 code
66
+    code: "0301"
67
+    # 有效时间 秒
68
+    expire: 120
69
+    # 验证码长度
70
+    size: 4
71
+    # 短信签名
72
+    sign: AI智慧案场
73
+
74
+  visitor:
75
+    code: "0501"
76
+=======
1 77
 server:
2 78
   port: 8009
3 79
 spring:
@@ -50,3 +126,4 @@ ali:
50 126
     bucketURL: https://njcj.oss-cn-shanghai.aliyuncs.com
51 127
 
52 128
 
129
+>>>>>>> ac499f2ddc4d4469098e59fff8bbe310779f7be3

+ 2
- 2
src/main/resources/mapper/TaPersonBuildingMapper.xml View File

@@ -3,12 +3,12 @@
3 3
 <mapper namespace="com.huiju.estateagents.mapper.TaPersonBuildingMapper">
4 4
 
5 5
     <select id="selectListByParams" resultType="com.huiju.estateagents.entity.TaPersonBuilding">
6
-        select  a.building_id, t.user_name as consultantName, d.building_name, b.person_id From ta_user t
6
+        select  a.building_id, t.user_name as consultantName, d.building_name, b.person_id, t.user_id From ta_user t
7 7
         left join ta_person_building a on t.user_id = a.user_id
8 8
         left join ta_person b on t.user_id = b.user_id
9 9
         left join ta_share_count c on b.person_id = c.person_id
10 10
         LEFT JOIN ta_building d on a.building_id = d.building_id
11
-        where t.org_id = #{orgId}
11
+        where t.org_id = #{orgId} and t.is_consultant = 1
12 12
             <if test="buildingId != null and buildingId != ''">
13 13
               and a.building_id = #{buildingId}
14 14
             </if>

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

@@ -613,11 +613,11 @@ FROM
613 613
         if(a.sex = 1, '男', if(a.sex = 2, '女', '未知')) as sex,
614 614
         CASE
615 615
         WHEN b.NAME IS NULL THEN
616
-        c.NAME ELSE b.NAME
616
+        d.user_name ELSE b.NAME
617 617
         END AS consultantName,
618 618
         CASE
619 619
         WHEN b.tel IS NULL THEN
620
-        c.tel ELSE b.tel
620
+        d.phone ELSE b.tel
621 621
         END AS consultTel,
622 622
         t.building_name
623 623
         FROM

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

@@ -31,7 +31,7 @@
31 31
         from ta_share_count t
32 32
         left join ta_building_dynamic a on t.be_share = a.dynamic_id and t.tagert_type = 'activity'
33 33
         left join ta_help_activity b on t.be_share = b.help_activity_id and t.tagert_type = 'help'
34
-        left join ta_share_activity c on t.be_share = c.share_id and t.tagert_type = 'group'
34
+        left join ta_share_activity c on t.be_share = c.group_activity_id and t.tagert_type = 'group'
35 35
         LEFT JOIN ta_drainage d on t.be_share = d.drainage_id and t.tagert_type = 'h5'
36 36
         left join ta_building e on t.be_share = e.building_id and t.tagert_type = 'project'
37 37
         LEFT JOIN ta_news f on t.be_share = f.news_id and t.tagert_type = 'news'
@@ -67,8 +67,8 @@
67 67
                 when a.`name` != null || a.`name` != '' then a.`name`
68 68
                 else '空'
69 69
                 end as shareTitle,
70
-                        a.phone as personPhone,
71
-                        a.nickName as personName,
70
+                        z.phone as personPhone,
71
+                        z.nickName as personName,
72 72
                         t.create_date
73 73
 
74 74
         FROM
@@ -81,7 +81,8 @@
81 81
                 left join ta_building e on t.target_id = e.building_id and t.target_type = 'building_share'
82 82
                 LEFT JOIN ta_news f on t.target_id = f.news_id and t.target_type = 'news_share'
83 83
 
84
-        LEFT JOIN ta_person a ON t.person_id = a.person_id and t.target_type = 'card_share'
84
+        LEFT JOIN ta_person a ON t.share_person = a.person_id or t.share_person = a.user_id
85
+        LEFT JOIN ta_person z ON t.person_id = z.person_id
85 86
         WHERE
86 87
             (t.share_person = (select user_id from ta_person where person_id = #{personId}) or t.share_person = #{personId})
87 88
         AND t.org_id = #{orgId}