Parcourir la source

数据库迁移

魏超 il y a 5 ans
Parent
révision
8d35f2f253

+ 4
- 2
src/main/java/com/huiju/estateagents/center/taUser/service/impl/TaUserServiceImpl.java Voir le fichier

@@ -335,9 +335,11 @@ public class TaUserServiceImpl extends ServiceImpl<TaUserMapper, TaUser> impleme
335 335
 		Integer status = isOn ? CommConstant.STATUS_NORMAL : CommConstant.STATUS_CLOSED;
336 336
 		TaUser user = new TaUser();
337 337
 		user.setStatus(status);
338
-		user.setUserId(id);
339 338
 
340
-		if (!this.updateById(user)) {
339
+		QueryWrapper<TaUser> taUserQueryWrapper = new QueryWrapper<>();
340
+		taUserQueryWrapper.eq("org_id", taUserMapper.selectById(id).getOrgId());
341
+
342
+		if (!this.update(user, taUserQueryWrapper)) {
341 343
 			throw new Exception("开启或禁用用户失败");
342 344
 		}
343 345
 	}

+ 21
- 0
src/main/java/com/huiju/estateagents/common/CommConstant.java Voir le fichier

@@ -556,4 +556,25 @@ public class CommConstant {
556 556
      * 登录中心端系统类型
557 557
      */
558 558
     public static final String LOGIN_TYPE_CENTER = "center";
559
+
560
+    /**
561
+     * 查看分享者活动类型 h5
562
+     */
563
+    public static final String H5_SHARE = "h5_share";
564
+
565
+    /**
566
+     * 查看分享者活动类型 拼团
567
+     */
568
+    public static final String GROUP_SHARE = "group_share";
569
+
570
+    /**
571
+     * 查看分享者活动类型 助力
572
+     */
573
+    public static final String HELP_SHARE = "help_share";
574
+
575
+    /**
576
+     * 查看分享者活动类型 活动
577
+     */
578
+    public static final String DYNAMIC_SHARE = "dynamic_share";
579
+
559 580
 }

+ 8
- 6
src/main/java/com/huiju/estateagents/service/impl/TaPersonVisitRecordServiceImpl.java Voir le fichier

@@ -132,29 +132,31 @@ public class TaPersonVisitRecordServiceImpl extends ServiceImpl<TaPersonVisitRec
132 132
 				e.setUserTel(personInfo.getPhone());
133 133
 			}
134 134
 
135
-			TaPerson userShareInfo = taPersonMapper.selectById(e.getPersonId());
135
+			QueryWrapper<TaPerson> queryWrapper = new QueryWrapper<>();
136
+			queryWrapper.eq("user_id", e.getSharePersonId()).or().eq("person_id", e.getSharePersonId());
137
+			TaPerson userShareInfo = taPersonMapper.selectOne(queryWrapper);
136 138
 			if (userShareInfo != null) {
137 139
 				e.setShareName(userShareInfo.getNickname());
138 140
 				e.setShareTel(userShareInfo.getPhone());
139 141
 			}
140 142
 
141
-			if (CommConstant.EVENT_H5.equals(e.getEventType())) {
143
+			if (CommConstant.H5_SHARE.equals(e.getEventType())) {
142 144
 				e.setActivityName(e.getDrainageName());
143 145
 				continue;
144 146
 			}
145
-			if (CommConstant.POSTER_CONTENT_TYPE_BUILDING.equals(e.getEventType())) {
147
+			if (CommConstant.BUILDING_SHARE.equals(e.getEventType())) {
146 148
 				e.setActivityName(e.getBuildingName());
147 149
 				continue;
148 150
 			}
149
-			if (CommConstant.POSTER_CONTENT_TYPE_NEWS.equals(e.getEventType())) {
151
+			if (CommConstant.NEWS_SHARE.equals(e.getEventType())) {
150 152
 				e.setActivityName(e.getNewsName());
151 153
 				continue;
152 154
 			}
153
-			if (CommConstant.POINTS_CHANGE_HELP.equals(e.getEventType())) {
155
+			if (CommConstant.HELP_SHARE.equals(e.getEventType())) {
154 156
 				e.setActivityName(e.getHelpActivityName());
155 157
 				continue;
156 158
 			}
157
-			if (CommConstant.POINTS_CHANGE_GROUP.equals(e.getEventType())) {
159
+			if (CommConstant.GROUP_SHARE.equals(e.getEventType())) {
158 160
 				e.setActivityName(e.getGroupActivityName());
159 161
 				continue;
160 162
 			}

+ 3
- 3
src/main/resources/application-blue.yml Voir le fichier

@@ -4,9 +4,9 @@ spring:
4 4
   application:
5 5
     name: estateagents
6 6
   datasource:
7
-    username: estateagents
8
-    password: estateagents
9
-    url: jdbc:mysql://47.101.36.130:3306/estateagents_3.5.1_test?useUnicode=true&serverTimezone=GMT%2B8&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&zeroDateTimeBehavior=convertToNull
7
+    username: root
8
+    password: LUfZGvh7j1^qA*2c
9
+    url: jdbc:mysql://123.57.65.31:3306/estateagents_test?useUnicode=true&serverTimezone=GMT%2B8&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&zeroDateTimeBehavior=convertToNull
10 10
     driver-class-name: com.mysql.cj.jdbc.Driver
11 11
     initial-size: 10 # 初始化连接数
12 12
     max-active: 20 # 最大连接数

+ 3
- 3
src/main/resources/application-green.yml Voir le fichier

@@ -4,9 +4,9 @@ spring:
4 4
   application:
5 5
     name: estateagents
6 6
   datasource:
7
-    username: estateagents
8
-    password: estateagents
9
-    url: jdbc:mysql://47.101.36.130:3306/estateagents_3.5.1_test?useUnicode=true&serverTimezone=GMT%2B8&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&zeroDateTimeBehavior=convertToNull
7
+    username: root
8
+    password: LUfZGvh7j1^qA*2c
9
+    url: jdbc:mysql://123.57.65.31:3306/estateagents_test?useUnicode=true&serverTimezone=GMT%2B8&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&zeroDateTimeBehavior=convertToNull
10 10
     driver-class-name: com.mysql.cj.jdbc.Driver
11 11
     initial-size: 10 # 初始化连接数
12 12
     max-active: 20 # 最大连接数

+ 3
- 3
src/main/resources/application-prod-blue.yml Voir le fichier

@@ -4,9 +4,9 @@ spring:
4 4
   application:
5 5
     name: estateagents
6 6
   datasource:
7
-    username: estateagents
8
-    password: DQ@0lW##kBb2+-jPZ
9
-    url: jdbc:mysql://rm-uf6z3z6jq11x653d77o.mysql.rds.aliyuncs.com:3306/estateagents3.5?useUnicode=true&serverTimezone=CTT&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&zeroDateTimeBehavior=convertToNull
7
+    username: root
8
+    password: HZjVK5O%zTdP0#8AhGcF@03!eZsGbqdO
9
+    url: jdbc:mysql://rm-2zez52se79qgg9649po.mysql.rds.aliyuncs.com:3306/estateagents3.5?useUnicode=true&serverTimezone=CTT&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&zeroDateTimeBehavior=convertToNull
10 10
     driver-class-name: com.mysql.cj.jdbc.Driver
11 11
     initial-size: 10 # 初始化连接数
12 12
     max-active: 20 # 最大连接数

+ 3
- 3
src/main/resources/application-prod-green.yml Voir le fichier

@@ -4,9 +4,9 @@ spring:
4 4
   application:
5 5
     name: estateagents
6 6
   datasource:
7
-    username: estateagents
8
-    password: DQ@0lW##kBb2+-jPZ
9
-    url: jdbc:mysql://rm-uf6z3z6jq11x653d77o.mysql.rds.aliyuncs.com:3306/estateagents3.5?useUnicode=true&serverTimezone=CTT&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&zeroDateTimeBehavior=convertToNull
7
+    username: root
8
+    password: HZjVK5O%zTdP0#8AhGcF@03!eZsGbqdO
9
+    url: jdbc:mysql://rm-2zez52se79qgg9649po.mysql.rds.aliyuncs.com:3306/estateagents3.5?useUnicode=true&serverTimezone=CTT&characterEncoding=utf8&allowMultiQueries=true&autoReconnect=true&zeroDateTimeBehavior=convertToNull
10 10
     driver-class-name: com.mysql.cj.jdbc.Driver
11 11
     initial-size: 10 # 初始化连接数
12 12
     max-active: 20 # 最大连接数

+ 16
- 16
src/main/resources/mapper/TaPersonVisitRecordMapper.xml Voir le fichier

@@ -155,12 +155,12 @@
155 155
     <select id="getDrainageVisitRecord" resultType="com.huiju.estateagents.entity.TaPersonVisitRecord">
156 156
         select * from (
157 157
             select
158
-<!--            <include refid="columnSql"></include>,-->
158
+            t.share_person as share_person_id,
159 159
             t.person_id,
160 160
             c.person_type,
161 161
             t.create_date as visit_time,
162
-            t.tagert_type as event_type,
163
-            t.be_share as target_id,
162
+            t.target_type as event_type,
163
+            t.target_id as target_id,
164 164
             b.name as drainageName,
165 165
             d.building_name as buildingName,
166 166
             tn.news_name as newsName,
@@ -168,26 +168,26 @@
168 168
             tsa.activity_name as groupActivityName,
169 169
             tbd.title as activityName,
170 170
             b.drainage_id
171
-            from ta_share t
172
-            left join ta_drainage b on t.be_share = b.drainage_id
173
-            left join ta_building d on t.be_share = d.building_id
174
-            left join ta_news tn on t.be_share = tn.news_id
175
-            left join ta_help_activity tha on t.be_share = tha.help_activity_id
176
-            left join ta_share_activity tsa on t.be_share = tsa.group_activity_id
177
-            left join ta_building_dynamic tbd on t.be_share = tbd.dynamic_id
178
-            left join ta_person c on t.person_id = c.person_id
171
+            from ta_share_person_from t
172
+            left join ta_drainage b on t.target_id = b.drainage_id
173
+            left join ta_building d on t.target_id = d.building_id
174
+            left join ta_news tn on t.target_id = tn.news_id
175
+            left join ta_help_activity tha on t.target_id = tha.help_activity_id
176
+            left join ta_share_activity tsa on t.target_id = tsa.group_activity_id
177
+            left join ta_building_dynamic tbd on t.target_id = tbd.dynamic_id
178
+            left join ta_person c on (t.share_person = c.person_id or t.share_person = c.user_id)
179 179
             where 1=1
180
-                and t.tagert_type != 'consultant'
180
+            and t.target_type in ('h5_share','group_share','help_share','news_share','dynamic_share','building_share')
181 181
             <if test="orgId != null and orgId != ''">
182 182
                 and c.org_id = #{orgId}
183 183
             </if>
184 184
             <if test="eventType !=null and eventType != ''">
185
-                and t.tagert_type = #{eventType}
185
+                and t.target_type = #{eventType}
186 186
             </if>
187 187
             <if test="activityName !=null and activityName != ''">
188 188
                 and (
189
-                (b.name like concat('%',#{activityName},'%') and t.tagert_type = 'h5')or (d.name like concat('%',#{activityName},'%') and t.tagert_type = 'building') or (tn.news_name like concat('%',#{activityName},'%') and t.tagert_type = 'news')
190
-                or (tha.title like concat( '%', #{activityName}, '%' ) and t.tagert_type = 'help')  or (tsa.activity_name like concat('%',#{activityName},'%') and t.tagert_type = 'group') or (tbd.title like concat('%',#{activityName},'%') and t.tagert_type = 'activity')
189
+                (b.name like concat('%',#{activityName},'%') and t.target_type = 'h5_share')or (d.name like concat('%',#{activityName},'%') and t.target_type = 'building_share') or (tn.news_name like concat('%',#{activityName},'%') and t.target_type = 'news_share')
190
+                or (tha.title like concat( '%', #{activityName}, '%' ) and t.target_type = 'help_share')  or (tsa.activity_name like concat('%',#{activityName},'%') and t.target_type = 'group_share') or (tbd.title like concat('%',#{activityName},'%') and t.target_type = 'dynamic_share')
191 191
                 )
192 192
             </if>
193 193
             <if test="shareName !=null and shareName != ''">
@@ -213,7 +213,7 @@
213 213
             </if>
214 214
             order by t.create_date desc
215 215
         ) t
216
-        group by t.person_id, t.target_id,t.event_type
216
+        group by t.person_id, t.target_id,t.event_type, t.share_person_id
217 217
         order by t.visit_time desc
218 218
     </select>
219 219