傅行帆 5 vuotta sitten
vanhempi
commit
31149450e6

+ 7
- 0
src/main/java/com/huiju/estateagents/excel/SalesExport.java Näytä tiedosto

@@ -1,5 +1,6 @@
1 1
 package com.huiju.estateagents.excel;
2 2
 
3
+import com.alibaba.excel.annotation.ExcelIgnore;
3 4
 import com.alibaba.excel.annotation.ExcelProperty;
4 5
 import com.alibaba.excel.annotation.format.DateTimeFormat;
5 6
 import com.alibaba.excel.annotation.write.style.ColumnWidth;
@@ -45,4 +46,10 @@ public class SalesExport {
45 46
     @ColumnWidth(15)
46 47
     @ExcelProperty(value = "点击人数", index = 3)
47 48
     private int clickNum;
49
+
50
+    @ExcelIgnore
51
+    private String personId;
52
+
53
+    @ExcelIgnore
54
+    private Integer userId;
48 55
 }

+ 8
- 0
src/main/java/com/huiju/estateagents/service/impl/TaPersonBuildingServiceImpl.java Näytä tiedosto

@@ -75,6 +75,14 @@ public class TaPersonBuildingServiceImpl extends ServiceImpl<TaPersonBuildingMap
75 75
     @Override
76 76
     public List<SalesExport> selectSalesList(Integer orgId, String buildingId, String startCreateDate, String endCreateDate, List<TaPersonBuilding> taPersonBuildingList) {
77 77
         List<SalesExport> list = taPersonBuildingMapper.selectSalesList(orgId, buildingId, startCreateDate, endCreateDate, taPersonBuildingList);
78
+        for (SalesExport salesExport : list) {
79
+            if (StringUtils.isEmpty(salesExport.getPersonId())){
80
+                salesExport.setClickNum(0);
81
+                continue;
82
+            }
83
+
84
+            salesExport.setClickNum(taSharePersonFromMapper.countViewNum(salesExport.getUserId(), orgId, salesExport.getPersonId(), startCreateDate, endCreateDate));
85
+        }
78 86
         return list;
79 87
     }
80 88
 }

+ 1
- 4
src/main/resources/mapper/TaPersonBuildingMapper.xml Näytä tiedosto

@@ -34,16 +34,13 @@
34 34
             d.building_name,
35 35
             b.person_id,
36 36
             t.user_id ,
37
-            count(c.person_id) as share_count,
38
-            IFNULL( f.sharenum, 0 ) AS click_num
37
+            count(c.person_id) as share_count
39 38
         FROM
40 39
             ta_user t
41 40
         LEFT JOIN ta_person_building a ON t.user_id = a.user_id
42 41
         LEFT JOIN ta_person b ON t.user_id = b.user_id
43 42
         LEFT JOIN ta_share_count c ON b.person_id = c.person_id
44 43
         LEFT JOIN ta_building d ON a.building_id = d.building_id
45
-        left join (select count(DISTINCT m.person_id) as sharenum,m.share_person from ta_share_person_from m where m.org_id =  #{orgId} and m.status = 1 and (m.share_person > m.person_id or m.share_person &lt; m.person_id) GROUP BY m.share_person) f ON ( t.user_id = f.share_person OR b.person_id = f.share_person )
46
-        AND b.person_id IS NOT NULL
47 44
         WHERE
48 45
         t.org_id =  #{orgId}
49 46
         AND t.is_consultant = 1