Przeglądaj źródła

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

张延森 5 lat temu
rodzic
commit
fa2a3f4acb

+ 6
- 3
src/main/java/com/huiju/estateagents/controller/TaPersonVisitRecordController.java Wyświetl plik

@@ -350,13 +350,16 @@ public class TaPersonVisitRecordController extends BaseController {
350 350
         }
351 351
         //使用分页插件
352 352
         IPage<TaConsultantInfo> pg = new Page<>(pageNumber, pageSize);
353
-        IPage<TaConsultantInfo> result = iTaPersonVisitRecordService.getConsultantShareInfoList(pg, userId, getOrgId(request));
353
+        QueryWrapper<TaPerson> taPersonQueryWrapper = new QueryWrapper<>();
354
+        taPersonQueryWrapper.eq("user_id", userId);
355
+        TaPerson taPerson = taPersonService.getOne(taPersonQueryWrapper);
356
+        IPage<TaConsultantInfo> result = iTaPersonVisitRecordService.getConsultantShareInfoList(pg, taPerson.getPersonId());
354 357
 
355 358
         List<TaConsultantInfo> taConsultantInfos = result.getRecords();
356 359
         taConsultantInfos.forEach(e ->{
357
-            Integer shareNum = iTaPersonVisitRecordService.countShareNumByEventType(e.getTargetId(), getOrgId(request), userId, e.getEventType());
360
+            Integer shareNum = iTaPersonVisitRecordService.countShareNumByEventType(getOrgId(request), e.getTargetId(), userId, (CommConstant.FAVOR_PROJECT.equals(e.getEventType()) ? "building" : e.getEventType()) + "_share");
358 361
             switch (e.getEventType()){
359
-                case CommConstant.POSTER_CONTENT_TYPE_ACTIVITY:
362
+                case CommConstant.FAVOR_PROJECT:
360 363
                     e.setActivityShareNum(shareNum);
361 364
                     break;
362 365
                 case CommConstant.POINTS_CHANGE_HELP:

+ 1
- 1
src/main/java/com/huiju/estateagents/entity/TaBuilding.java Wyświetl plik

@@ -52,7 +52,7 @@ public class TaBuilding implements Serializable {
52 52
     /**
53 53
      * 开盘时间
54 54
      */
55
-    private LocalDateTime openingDate;
55
+    private String openingDate;
56 56
 
57 57
     /**
58 58
      * 项目地址

+ 2
- 2
src/main/java/com/huiju/estateagents/mapper/TaPersonVisitRecordMapper.java Wyświetl plik

@@ -80,7 +80,7 @@ public interface TaPersonVisitRecordMapper extends BaseMapper<TaPersonVisitRecor
80 80
 
81 81
     IPage<TaPersonVisitRecord> getWxVisitRecordActivityList(IPage<TaPersonVisitRecord> pg, @Param("userId") Integer userId,@Param("personId") String personId,@Param("orgId") Integer orgId,@Param("eventType") String eventType);
82 82
 
83
-    IPage<TaConsultantInfo> getConsultantShareInfoList(IPage<TaConsultantInfo> pg, @Param("userId") Integer userId, @Param("orgId") Integer orgId);
83
+    IPage<TaConsultantInfo> getConsultantShareInfoList(IPage<TaConsultantInfo> pg, @Param("personId") String personId);
84 84
 
85
-    Integer countShareNumByEventType(@Param("targetId") String targetId, @Param("orgId")Integer orgId, @Param("userId")Integer userId, @Param("eventType")String eventType);
85
+    Integer countShareNumByEventType(@Param("orgId")Integer orgId, @Param("targetId") String targetId, @Param("userId")Integer userId, @Param("eventType")String eventType);
86 86
 }

+ 2
- 2
src/main/java/com/huiju/estateagents/service/ITaPersonVisitRecordService.java Wyświetl plik

@@ -60,7 +60,7 @@ public interface ITaPersonVisitRecordService extends IService<TaPersonVisitRecor
60 60
 
61 61
 	IPage<TaPersonVisitRecord> getDrainageVisitRecord(IPage<TaPersonVisitRecord> pg, Integer orgId, String activityName, String eventType, String shareName, String shareTel, String buildingId, String personType, List<TaPersonBuilding> taPersonBuildingList);
62 62
 
63
-	IPage<TaConsultantInfo> getConsultantShareInfoList(IPage<TaConsultantInfo> pg, Integer userId, Integer orgId);
63
+	IPage<TaConsultantInfo> getConsultantShareInfoList(IPage<TaConsultantInfo> pg, String personId);
64 64
 
65
-	Integer countShareNumByEventType(String targetId, Integer orgId, Integer userId, String eventType);
65
+	Integer countShareNumByEventType(Integer orgId, String targetId, Integer userId, String eventType);
66 66
 }

+ 0
- 3
src/main/java/com/huiju/estateagents/service/impl/TaBuildingServiceImpl.java Wyświetl plik

@@ -458,9 +458,6 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
458 458
 
459 459
         TaBuilding building = object.toJavaObject(TaBuilding.class);
460 460
 
461
-        if(null!= object.getDate("openingDate")){
462
-            building.setOpeningDate(DateUtils.date2LocalDateTime(object.getDate("openingDate")));
463
-        }
464 461
         building.setCreateDate(LocalDateTime.now());
465 462
         building.setStatus(2);
466 463
         building.setOrgId(orgId);

+ 4
- 4
src/main/java/com/huiju/estateagents/service/impl/TaPersonVisitRecordServiceImpl.java Wyświetl plik

@@ -164,14 +164,14 @@ public class TaPersonVisitRecordServiceImpl extends ServiceImpl<TaPersonVisitRec
164 164
 	}
165 165
 
166 166
 	@Override
167
-	public IPage<TaConsultantInfo> getConsultantShareInfoList(IPage<TaConsultantInfo> pg, Integer userId, Integer orgId) {
168
-		IPage<TaConsultantInfo> result = personVisitRecordMapper.getConsultantShareInfoList(pg,userId,orgId);
167
+	public IPage<TaConsultantInfo> getConsultantShareInfoList(IPage<TaConsultantInfo> pg, String personId) {
168
+		IPage<TaConsultantInfo> result = personVisitRecordMapper.getConsultantShareInfoList(pg,personId);
169 169
 		return result;
170 170
 	}
171 171
 
172 172
 	@Override
173
-	public Integer countShareNumByEventType(String targetId, Integer orgId, Integer userId, String eventType) {
174
-		return personVisitRecordMapper.countShareNumByEventType(targetId, orgId, userId, eventType);
173
+	public Integer countShareNumByEventType(Integer orgId, String targetId, Integer userId, String eventType) {
174
+		return personVisitRecordMapper.countShareNumByEventType(orgId, targetId, userId, eventType);
175 175
 	}
176 176
 
177 177
 	/**

+ 1
- 1
src/main/java/com/huiju/estateagents/service/impl/TaShareServiceImpl.java Wyświetl plik

@@ -62,7 +62,7 @@ public class TaShareServiceImpl extends ServiceImpl<TaShareMapper, TaShare> impl
62 62
             taBuildingDynamicQuery.eq("dynamic_id",id);
63 63
             TaBuildingDynamic taBuildingDynamic = taBuildingDynamicMapper.selectOne(taBuildingDynamicQuery);
64 64
             taBuildingDynamicMapper.updateById( taBuildingDynamic.setShareNum(taBuildingDynamic.getShareNum() == null ? 1:taBuildingDynamic.getShareNum()+1));
65
-            return ResponseBean.success("成功");
65
+//            return ResponseBean.success("成功");
66 66
         }
67 67
 
68 68
         QueryWrapper<TaShare> queryWrapper = new QueryWrapper<>();

+ 49
- 62
src/main/resources/mapper/TaPersonVisitRecordMapper.xml Wyświetl plik

@@ -211,20 +211,18 @@
211 211
         select * From (
212 212
             select * from (
213 213
                 select
214
-                t.target_id,
214
+                t.be_share as target_id,
215 215
                 a.url as activity_img,
216 216
                 a.building_name as activity_name,
217 217
                 a.building_name,
218 218
                 a.address,
219 219
                 a.price,
220
-                t.event_type,
221
-                t.visit_time
222
-                from ta_person_visit_record t
223
-                left join (select b.url, a.building_name,a.address,a.price,a.building_id from ta_building a left join ta_building_img b on a.building_id = b.building_id where b.img_type = 'list') a on t.target_id = a.building_id
224
-                where t.event_type = 'building'
225
-                and t.consultant_id = #{userId}
226
-                and t.org_id = #{orgId}
227
-                and t.`event` = 'share' order by t.visit_time desc limit 9999
220
+                t.tagert_type as eventType,
221
+				t.create_date
222
+                from ta_share t
223
+                left join (select b.url, a.building_name,a.address,a.price,a.building_id from ta_building a left join ta_building_img b on a.building_id = b.building_id where b.img_type = 'list') a on t.be_share = a.building_id
224
+                where t.tagert_type = 'project'
225
+                and t.person_id = #{personId} order by t.create_date desc limit 9999
228 226
             ) t
229 227
             group by t.target_id
230 228
 
@@ -232,20 +230,18 @@
232 230
 
233 231
         select * from (
234 232
         select
235
-        t.target_id,
233
+        t.be_share as target_id,
236 234
         b.list_img_url as activity_img,
237 235
         b.title as activity_name,
238 236
         '1' as price,
239 237
         '2' as building_name,
240 238
         '3' as address,
241
-        t.event_type,
242
-		t.visit_time
243
-        from ta_person_visit_record t
244
-        left join ta_building_dynamic b on t.target_id = b.dynamic_id
245
-        where t.event_type = 'activity'
246
-        and t.consultant_id = #{userId}
247
-        and t.org_id = #{orgId}
248
-        and t.`event` = 'share' order by t.visit_time desc limit 9999
239
+        t.tagert_type as eventType,
240
+		t.create_date
241
+        from ta_share t
242
+        left join ta_building_dynamic b on t.be_share = b.dynamic_id
243
+        where t.tagert_type = 'activity'
244
+        and t.person_id = #{personId} order by t.create_date desc limit 9999
249 245
         ) t
250 246
         group by t.target_id
251 247
 
@@ -253,20 +249,18 @@
253 249
 
254 250
         select * from (
255 251
         select
256
-        t.target_id,
252
+        t.be_share as target_id,
257 253
         c.list_img as activity_img,
258 254
         c.title as activity_name,
259 255
         '1' as price,
260 256
         '2' as building_name,
261 257
         '3' as address,
262
-        t.event_type,
263
-		t.visit_time
264
-        from ta_person_visit_record t
265
-        left join ta_help_activity c on t.target_id = c.help_activity_id
266
-        where t.event_type = 'help'
267
-        and t.consultant_id = #{userId}
268
-        and t.org_id = #{orgId}
269
-        and t.`event` = 'share' order by t.visit_time desc limit 9999
258
+        t.tagert_type as eventType,
259
+		t.create_date
260
+        from ta_share t
261
+        left join ta_help_activity c on t.be_share = c.help_activity_id
262
+        where t.tagert_type = 'help'
263
+        and t.person_id = #{personId} order by t.create_date desc limit 9999
270 264
         ) t
271 265
         group by t.target_id
272 266
 
@@ -274,41 +268,37 @@
274 268
 
275 269
         select * from (
276 270
         select
277
-        t.target_id,
271
+        t.be_share as target_id,
278 272
         d.list_img as activity_img,
279 273
         d.activity_name as activity_name,
280 274
         '1' as price,
281 275
         '2' as building_name,
282 276
         '3' as address,
283
-        t.event_type,
284
-		t.visit_time
285
-        from ta_person_visit_record t
286
-        left join ta_share_activity d on t.target_id = d.group_activity_id
287
-        where t.event_type = 'group'
288
-        and t.consultant_id = #{userId}
289
-        and t.org_id = #{orgId}
290
-        and t.`event` = 'share'
291
-        group by t.target_id order by t.visit_time desc limit 9999
277
+        t.tagert_type as eventType,
278
+		t.create_date
279
+        from ta_share t
280
+        left join ta_share_activity d on t.be_share = d.group_activity_id
281
+        where t.tagert_type = 'group'
282
+        and t.person_id = #{personId} order by t.create_date desc limit 9999
292 283
         ) t
284
+		group by t.target_id
293 285
 
294 286
         union all
295 287
 
296 288
         select * from (
297 289
         select
298
-        t.target_id,
290
+        t.be_share as target_id,
299 291
         e.news_img as activity_img,
300 292
         e.news_name as activity_name,
301 293
         '1' as price,
302 294
         '2' as building_name,
303 295
         '3' as address,
304
-        t.event_type,
305
-		t.visit_time
306
-        from ta_person_visit_record t
307
-        left join ta_news e on t.target_id = e.news_id
308
-        where t.event_type = 'news'
309
-        and t.consultant_id = #{userId}
310
-        and t.org_id = #{orgId}
311
-        and t.`event` = 'share' order by t.visit_time desc limit 9999
296
+        t.tagert_type as eventType,
297
+		t.create_date
298
+        from ta_share t
299
+        left join ta_news e on t.be_share = e.news_id
300
+        where t.tagert_type = 'news'
301
+        and t.person_id = #{personId} order by t.create_date desc limit 9999
312 302
         ) t
313 303
         group by t.target_id
314 304
 
@@ -316,35 +306,32 @@
316 306
 
317 307
         select * from (
318 308
             select
319
-            t.target_id,
309
+            t.be_share as target_id,
320 310
             f.share_img as activity_img,
321 311
             f.`name` as activity_name,
322 312
             '1' as price,
323 313
             '2' as building_name,
324 314
             '3' as address,
325
-            t.event_type,
326
-            t.visit_time
327
-            from ta_person_visit_record t
328
-            left join ta_drainage f on t.target_id = f.drainage_id
329
-            where t.event_type = 'h5'
330
-            and t.consultant_id = #{userId}
331
-            and t.org_id = #{orgId}
332
-            and t.`event` = 'share' order by t.visit_time desc limit 9999
315
+			t.tagert_type as eventType,
316
+			t.create_date
317
+            from ta_share t
318
+            left join ta_drainage f on t.be_share = f.drainage_id
319
+            where t.tagert_type = 'h5'
320
+            and t.person_id = #{personId} order by t.create_date desc limit 9999
333 321
             ) t
334 322
             group by t.target_id
335 323
         ) t
336
-        order by t.visit_time desc
324
+        order by t.create_date desc
337 325
     </select>
338 326
 
339 327
     <select id="countShareNumByEventType" resultType="java.lang.Integer">
340
-        select count(DISTINCT t.person_id)  from ta_person_visit_record t
328
+        select count(DISTINCT t.person_id)  from ta_share_person_from t
341 329
         where
342
-        t.consultant_id = #{userId}
343
-        and t.org_id = #{orgId}
344
-        and t.event_type = #{eventType}
330
+        t.share_person = #{userId}
331
+        and t.orgId = #{orgId}
332
+        and t.target_type = #{eventType}
345 333
         and t.target_id = #{targetId}
346
-        and t.person_id != t.share_person_id
347
-        group by t.event_type
334
+        group by t.target_type
348 335
     </select>
349 336
 
350 337
 </mapper>