Quellcode durchsuchen

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

张延森 vor 5 Jahren
Ursprung
Commit
469df10300

+ 4
- 3
src/main/java/com/huiju/estateagents/service/impl/TaUvServiceImpl.java Datei anzeigen

@@ -44,6 +44,10 @@ public class TaUvServiceImpl extends ServiceImpl<TaUvMapper, TaUv> implements IT
44 44
             return ResponseBean.error("验证当前人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
45 45
         }
46 46
 
47
+        if (typeOf.equals(CommConstant.FAVOR_PROJECT)) {
48
+            buildingMapper.setFieldNum(id,"pv_num",1);
49
+        }
50
+
47 51
         TaPerson taPerson = persons.get(0);
48 52
 
49 53
         QueryWrapper<TaUv> queryWrapper = new QueryWrapper<>();
@@ -83,9 +87,6 @@ public class TaUvServiceImpl extends ServiceImpl<TaUvMapper, TaUv> implements IT
83 87
         if (typeOf.equals(CommConstant.FAVOR_CONSULTANT)) {
84 88
             taPersonMapper.setFieldIncrement(id,"hot_num", 1);
85 89
         }
86
-        if (typeOf.equals(CommConstant.FAVOR_PROJECT)) {
87
-            buildingMapper.setFieldNum(id,"pv_num",1);
88
-        }
89 90
 
90 91
         return ResponseBean.success("");
91 92
     }

+ 2
- 2
src/main/java/com/huiju/estateagents/statistic/controller/ActivityStatisticController.java Datei anzeigen

@@ -143,14 +143,14 @@ public class ActivityStatisticController extends BaseController {
143 143
                                                    @RequestParam(value = "endDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDate endDate,
144 144
                                                    @RequestParam(value = "sharePersonType", required = false)String sharePersonType,
145 145
                                                    @RequestParam(value = "sharePersonName", required = false)  String sharePersonName,
146
-                                                   @RequestParam(value = "sharePhone", required = false)String sharePhone,
146
+                                                   @RequestParam(value = "sharePersonPhone", required = false)String sharePersonPhone,
147 147
                                                    @RequestParam(value = "activityId", required = false)String activityId,
148 148
                                                    @RequestParam(value = "activityType", required = false)String activityType,
149 149
                                                    @RequestParam(value = "sort", required = false)String sort,
150 150
                                                    @RequestParam(value = "colKey", required = false)String colKey,
151 151
                                                    @RequestParam(value = "buildingId", required = false)String buildingId,
152 152
                                                    HttpServletRequest request) {
153
-        return taActivityStaticService.selectActivitySharePersonNum(pageNum, pageSize, getOrgId(request), startDate, endDate, sharePersonType, sharePersonName, sharePhone, activityId, activityType, buildingId, sort, colKey, getTaPersonBuildingListByUserId(request), getUserId(request));
153
+        return taActivityStaticService.selectActivitySharePersonNum(pageNum, pageSize, getOrgId(request), startDate, endDate, sharePersonType, sharePersonName, sharePersonPhone, activityId, activityType, buildingId, sort, colKey, getTaPersonBuildingListByUserId(request), getUserId(request));
154 154
     }
155 155
 
156 156
     /**

+ 18
- 3
src/main/java/com/huiju/estateagents/statistic/mapper/TaActicityStaticMapper.java Datei anzeigen

@@ -63,11 +63,26 @@ public interface TaActicityStaticMapper {
63 63
                                                      @Param("taPersonBuildings") List<TaPersonBuilding> taPersonBuildings,
64 64
                                                      @Param("userId") Integer userId);
65 65
 
66
-    List<Map<String, Object>> selectVisitCount(@Param("orgId") Integer orgId, @Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate, @Param("buildingId") String buildingId, @Param("targetType") String targetType);
66
+    List<Map<String, Object>> selectVisitCount(@Param("orgId") Integer orgId,
67
+                                               @Param("startDate") LocalDateTime startDate,
68
+                                               @Param("endDate") LocalDateTime endDate,
69
+                                               @Param("buildingId") String buildingId,
70
+                                               @Param("targetType") String targetType,
71
+                                               @Param("taPersonBuildings") List<TaPersonBuilding> taPersonBuildings);
67 72
 
68
-    List<Map<String, Object>> selectVisitPersonCount(@Param("orgId") Integer orgId, @Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate, @Param("buildingId") String buildingId, @Param("targetType") String targetType);
73
+    List<Map<String, Object>> selectVisitPersonCount(@Param("orgId") Integer orgId,
74
+                                                     @Param("startDate") LocalDateTime startDate,
75
+                                                     @Param("endDate") LocalDateTime endDate,
76
+                                                     @Param("buildingId") String buildingId,
77
+                                                     @Param("targetType") String targetType,
78
+                                                     @Param("taPersonBuildings") List<TaPersonBuilding> taPersonBuildings);
69 79
 
70
-    List<Map<String, Object>> selectAddRegistCount(@Param("orgId") Integer orgId, @Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate, @Param("buildingId") String buildingId, @Param("targetType") String targetType);
80
+    List<Map<String, Object>> selectAddRegistCount(@Param("orgId") Integer orgId,
81
+                                                   @Param("startDate") LocalDateTime startDate,
82
+                                                   @Param("endDate") LocalDateTime endDate,
83
+                                                   @Param("buildingId") String buildingId,
84
+                                                   @Param("targetType") String targetType,
85
+                                                   @Param("taPersonBuildings") List<TaPersonBuilding> taPersonBuildings);
71 86
 
72 87
     IPage<StatisicAttractUser> selectTableData(
73 88
             IPage<StatisicAttractUser> attractUserIPage,

+ 3
- 3
src/main/java/com/huiju/estateagents/statistic/service/impl/TaActivityStaticServiceImpl.java Datei anzeigen

@@ -52,9 +52,9 @@ public class TaActivityStaticServiceImpl {
52 52
         // 新增用户数
53 53
         List<Map<String, Object>> selectShareCount = taActicityStaticMapper.selectShareCount(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType, taPersonBuildings, userId);
54 54
         List<Map<String, Object>> selectSharePersonCount = taActicityStaticMapper.selectSharePersonCount(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType, taPersonBuildings, userId);
55
-        List<Map<String, Object>> selectVisitCount = taActicityStaticMapper.selectVisitCount(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType);
56
-        List<Map<String, Object>> selectVisitPersonCount = taActicityStaticMapper.selectVisitPersonCount(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType);
57
-        List<Map<String, Object>> selectAddRegistCount = taActicityStaticMapper.selectAddRegistCount(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType);
55
+        List<Map<String, Object>> selectVisitCount = taActicityStaticMapper.selectVisitCount(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType, taPersonBuildings);
56
+        List<Map<String, Object>> selectVisitPersonCount = taActicityStaticMapper.selectVisitPersonCount(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType, taPersonBuildings);
57
+        List<Map<String, Object>> selectAddRegistCount = taActicityStaticMapper.selectAddRegistCount(orgId, LocalDateTime.of(startDate, LocalTime.MIN), LocalDateTime.of(endDate, LocalTime.MAX.withNano(0)), buildingId, targetType, taPersonBuildings);
58 58
 
59 59
 
60 60
         for (Map<String, Object> ssc : selectShareCount){

+ 5
- 3
src/main/resources/mapper/TaBuildingMapper.xml Datei anzeigen

@@ -580,7 +580,7 @@
580 580
             FROM
581 581
             sequence a
582 582
             WHERE
583
-            a.rownum &lt; datediff( #{endDate}, #{startDate} )
583
+            a.rownum &lt;= datediff( #{endDate}, #{startDate} )
584 584
         ) t
585 585
         LEFT JOIN (
586 586
             SELECT
@@ -663,7 +663,7 @@
663 663
         FROM
664 664
         sequence a
665 665
         WHERE
666
-        a.rownum &lt; datediff( #{endDate}, #{startDate} )
666
+        a.rownum &lt;= datediff( #{endDate}, #{startDate} )
667 667
         ) t
668 668
         LEFT JOIN (
669 669
         SELECT
@@ -730,9 +730,11 @@
730 730
         GROUP BY
731 731
         DATE_FORMAT( create_date, '%Y-%m-%d' )
732 732
         ) u ON t.date = u.create_date
733
+        ORDER BY
733 734
         <if test="sortField != null and sortField != ''">
734
-            ORDER BY ${sortField} ${orderType}
735
+             ${sortField} ${orderType},
735 736
         </if>
737
+        create_date
736 738
     </select>
737 739
 
738 740
 </mapper>

+ 76
- 14
src/main/resources/mapper/statistic/TaActivityStaticMapper.xml Datei anzeigen

@@ -131,6 +131,12 @@
131 131
         <if test="startDate == null or endDate == null">
132 132
             AND t.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
133 133
         </if>
134
+        <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
135
+            AND t.building_id in
136
+            <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
137
+                #{taPersonBuilding.buildingId}
138
+            </foreach>
139
+        </if>
134 140
         GROUP BY
135 141
         DATE_FORMAT(t.visit_time, '%Y-%m-%d'),
136 142
         person_id) as visitPersonCount
@@ -152,6 +158,12 @@
152 158
         <if test="endDate != null">
153 159
             and t.visit_time &lt;= DATE_FORMAT(#{endDate}, '%Y-%m-%d %H:%i:%S' )
154 160
         </if>
161
+        <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
162
+            AND t.building_id in
163
+            <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
164
+                #{taPersonBuilding.buildingId}
165
+            </foreach>
166
+        </if>
155 167
     </select>
156 168
 
157 169
     <select id="selectShareCount" resultType="java.util.Map">
@@ -170,7 +182,7 @@
170 182
         sequence a
171 183
         <trim prefix="where">
172 184
             <if test="startDate != null or endDate != null">
173
-                a.rownum <![CDATA[ < ]]> datediff(#{endDate}, #{startDate})
185
+                a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
174 186
             </if>
175 187
         </trim>
176 188
         ) AS temp_date
@@ -248,7 +260,7 @@
248 260
         sequence a
249 261
         <trim prefix="where">
250 262
             <if test="startDate != null or endDate != null">
251
-                a.rownum <![CDATA[ < ]]> datediff(#{endDate}, #{startDate})
263
+                a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
252 264
             </if>
253 265
         </trim>
254 266
         ) AS temp_date
@@ -326,7 +338,7 @@
326 338
         sequence a
327 339
         <trim prefix="where">
328 340
             <if test="startDate != null or endDate != null">
329
-                a.rownum <![CDATA[ < ]]> datediff(#{endDate}, #{startDate})
341
+                a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
330 342
             </if>
331 343
         </trim>
332 344
         ) AS temp_date
@@ -354,6 +366,12 @@
354 366
         <if test="startDate == null or endDate == null ">
355 367
             AND t.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
356 368
         </if>
369
+        <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
370
+            AND t.building_id in
371
+            <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
372
+                #{taPersonBuilding.buildingId}
373
+            </foreach>
374
+        </if>
357 375
         GROUP BY
358 376
         DATE_FORMAT( t.visit_time, '%Y-%m-%d' )
359 377
         ) AS temp ON temp_date.date = DATE_FORMAT( temp.create_date, '%Y-%m-%d' )
@@ -376,7 +394,7 @@
376 394
         sequence a
377 395
         <trim prefix="where">
378 396
             <if test="startDate != null or endDate != null">
379
-                a.rownum <![CDATA[ < ]]> datediff(#{endDate}, #{startDate})
397
+                a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
380 398
             </if>
381 399
         </trim>
382 400
         ) AS temp_date
@@ -405,6 +423,12 @@
405 423
         <if test="startDate == null or endDate == null">
406 424
             AND t.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
407 425
         </if>
426
+        <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
427
+            AND t.building_id in
428
+            <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
429
+                #{taPersonBuilding.buildingId}
430
+            </foreach>
431
+        </if>
408 432
         GROUP BY
409 433
         DATE_FORMAT(t.visit_time, '%Y-%m-%d'),
410 434
         person_id) as visitPersonCount GROUP BY DATE_FORMAT(visitPersonCount.create_date, '%Y-%m-%d')
@@ -425,7 +449,7 @@
425 449
         sequence a
426 450
         <trim prefix="where">
427 451
             <if test="startDate != null or endDate != null">
428
-                a.rownum <![CDATA[ < ]]> datediff(#{endDate}, #{startDate})
452
+                a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
429 453
             </if>
430 454
         </trim>
431 455
         ) AS temp_date
@@ -460,6 +484,12 @@
460 484
         <if test="startDate == null or endDate == null">
461 485
             AND t.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
462 486
         </if>
487
+        <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
488
+            AND t.building_id in
489
+            <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
490
+                #{taPersonBuilding.buildingId}
491
+            </foreach>
492
+        </if>
463 493
         ) AS temp4
464 494
         GROUP BY
465 495
         DATE_FORMAT( temp4.create_date, '%Y-%m-%d' )
@@ -481,7 +511,7 @@
481 511
         sequence a
482 512
         <trim prefix="where">
483 513
             <if test="startDate != null or endDate != null">
484
-                a.rownum <![CDATA[ < ]]> datediff(#{endDate}, #{startDate})
514
+                a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
485 515
             </if>
486 516
         </trim>
487 517
         ) AS temp_date
@@ -614,6 +644,12 @@
614 644
         <if test="startDate == null or endDate == null ">
615 645
             AND t.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
616 646
         </if>
647
+        <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
648
+            AND t.building_id in
649
+            <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
650
+                #{taPersonBuilding.buildingId}
651
+            </foreach>
652
+        </if>
617 653
         GROUP BY
618 654
         DATE_FORMAT( t.visit_time, '%Y-%m-%d' )
619 655
         ) AS temp2 ON temp_date.date = DATE_FORMAT( temp2.create_date, '%Y-%m-%d' )
@@ -642,6 +678,12 @@
642 678
         <if test="startDate == null or endDate == null">
643 679
             AND t.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
644 680
         </if>
681
+        <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
682
+            AND t.building_id in
683
+            <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
684
+                #{taPersonBuilding.buildingId}
685
+            </foreach>
686
+        </if>
645 687
         GROUP BY
646 688
         DATE_FORMAT(t.visit_time, '%Y-%m-%d'),
647 689
         person_id) as visitPersonCount GROUP BY DATE_FORMAT(visitPersonCount.create_date, '%Y-%m-%d')
@@ -694,7 +736,7 @@
694 736
         sequence a
695 737
         <trim prefix="where">
696 738
             <if test="startDate != null or endDate != null">
697
-                a.rownum <![CDATA[ < ]]> datediff(#{endDate}, #{startDate})
739
+                a.rownum <![CDATA[ <= ]]> datediff(#{endDate}, #{startDate})
698 740
             </if>
699 741
         </trim>
700 742
         ) AS temp_date
@@ -826,6 +868,12 @@
826 868
         <if test="startDate == null or endDate == null ">
827 869
             AND t.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
828 870
         </if>
871
+        <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
872
+            AND t.building_id in
873
+            <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
874
+                #{taPersonBuilding.buildingId}
875
+            </foreach>
876
+        </if>
829 877
         GROUP BY
830 878
         DATE_FORMAT( t.visit_time, '%Y-%m-%d' )
831 879
         ) AS temp2 ON temp_date.date = DATE_FORMAT( temp2.create_date, '%Y-%m-%d' )
@@ -853,6 +901,12 @@
853 901
         <if test="startDate == null or endDate == null">
854 902
             AND t.visit_time BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
855 903
         </if>
904
+        <if test="taPersonBuildings != null and taPersonBuildings.size > 0">
905
+            AND t.building_id in
906
+            <foreach collection="taPersonBuildings" item="taPersonBuilding" open="(" close=")" separator=",">
907
+                #{taPersonBuilding.buildingId}
908
+            </foreach>
909
+        </if>
856 910
         GROUP BY
857 911
         DATE_FORMAT(t.visit_time, '%Y-%m-%d'),
858 912
         person_id) as visitPersonCount GROUP BY DATE_FORMAT(visitPersonCount.create_date, '%Y-%m-%d')
@@ -1027,7 +1081,8 @@
1027 1081
         <if test="startDate == null or endDate == null ">
1028 1082
             AND a.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
1029 1083
         </if>
1030
-        group by a.person_id, be_share, tagert_type
1084
+        group by a.person_id
1085
+<!--        , be_share, tagert_type-->
1031 1086
         ) as sharePersonNum group by sharePersonNum.be_share, sharePersonNum.tagert_type
1032 1087
         ) as sharePersonNum on sharePersonNum.be_share = activity.activityId and sharePersonNum.tagert_type =
1033 1088
         activity.activityType
@@ -1372,7 +1427,8 @@
1372 1427
             and t.be_share = #{activityId}
1373 1428
         </if>
1374 1429
         <if test="activityType != null and activityType != ''">
1375
-            and t.tagert_type = #{activityType}
1430
+            and (case when #{activityType} = 'live' then t.tagert_type in ('liveApp', 'livePost') else t.tagert_type = #{activityType}
1431
+            end)
1376 1432
         </if>
1377 1433
         <if test="sharePersonType != null and sharePersonType != ''">
1378 1434
             and f.person_type = #{sharePersonType}
@@ -1404,7 +1460,8 @@
1404 1460
                     and t.be_share = #{activityId}
1405 1461
                 </if>
1406 1462
                 <if test="activityType != null and activityType != ''">
1407
-                    and t.tagert_type = #{activityType}
1463
+                    and (case when #{activityType} = 'live' then t.tagert_type in ('liveApp', 'livePost') else t.tagert_type = #{activityType}
1464
+                    end)
1408 1465
                 </if>
1409 1466
                 group by person_id
1410 1467
             ) as temp
@@ -1444,7 +1501,9 @@
1444 1501
             and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dynamic'), '_share')
1445 1502
         </if>
1446 1503
         and t.target_type in ('dynamic_share','h5_share','help_share','live_share', 'group_share')
1447
-        and t.org_id = #{orgId} group by t.share_person ) t
1504
+        and t.org_id = #{orgId}
1505
+<!--        group by t.share_person -->
1506
+        ) t
1448 1507
         left join ta_person a on t.share_person = a.person_id
1449 1508
         left join ta_person b on t.share_person = b.user_id
1450 1509
         ) as visitPersonNum on visitPersonNum.person_id = person.person_id
@@ -1512,7 +1571,8 @@
1512 1571
             and t.be_share = #{activityId}
1513 1572
         </if>
1514 1573
         <if test="activityType != null and activityType != ''">
1515
-            and t.tagert_type = #{activityType}
1574
+            and (case when #{activityType} = 'live' then t.tagert_type in ('liveApp', 'livePost') else t.tagert_type = #{activityType}
1575
+            end)
1516 1576
         </if>
1517 1577
         <if test="sharePersonType != null and sharePersonType != ''">
1518 1578
             and f.person_type = #{sharePersonType}
@@ -1544,7 +1604,8 @@
1544 1604
             and t.be_share = #{activityId}
1545 1605
         </if>
1546 1606
         <if test="activityType != null and activityType != ''">
1547
-            and t.tagert_type = #{activityType}
1607
+            and (case when #{activityType} = 'live' then t.tagert_type in ('liveApp', 'livePost') else t.tagert_type = #{activityType}
1608
+            end)
1548 1609
         </if>
1549 1610
         group by person_id
1550 1611
         ) as temp
@@ -1618,7 +1679,8 @@
1618 1679
             and t.be_share = #{activityId}
1619 1680
         </if>
1620 1681
         <if test="activityType != null and activityType != ''">
1621
-            and t.tagert_type = #{activityType}
1682
+            and (case when #{activityType} = 'live' then t.tagert_type in ('liveApp', 'livePost') else t.tagert_type = #{activityType}
1683
+            end)
1622 1684
         </if>
1623 1685
         <if test="buildingId != null and buildingId != ''">
1624 1686
             and (