|
@@ -8,7 +8,6 @@ import com.huiju.estateagents.common.CommConstant;
|
8
|
8
|
import com.huiju.estateagents.entity.TaPersonBuilding;
|
9
|
9
|
import com.huiju.estateagents.entity.TaPersonVisitRecord;
|
10
|
10
|
import com.huiju.estateagents.entity.TdWxDict;
|
11
|
|
-import com.huiju.estateagents.exception.EstaException;
|
12
|
11
|
import com.huiju.estateagents.mapper.*;
|
13
|
12
|
import com.huiju.estateagents.po.PersonPO;
|
14
|
13
|
import com.huiju.estateagents.service.IStatisticalService;
|
|
@@ -19,10 +18,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
19
|
18
|
import org.springframework.stereotype.Service;
|
20
|
19
|
|
21
|
20
|
import java.time.LocalDate;
|
22
|
|
-import java.time.LocalDateTime;
|
23
|
21
|
import java.time.format.DateTimeFormatter;
|
24
|
22
|
import java.time.temporal.ChronoUnit;
|
25
|
|
-import java.util.*;
|
|
23
|
+import java.util.ArrayList;
|
|
24
|
+import java.util.HashMap;
|
|
25
|
+import java.util.List;
|
|
26
|
+import java.util.Map;
|
26
|
27
|
import java.util.stream.Collectors;
|
27
|
28
|
import java.util.stream.Stream;
|
28
|
29
|
|
|
@@ -402,4 +403,38 @@ public class StatisticalServiceImpl implements IStatisticalService {
|
402
|
403
|
});
|
403
|
404
|
return dataList;
|
404
|
405
|
}
|
|
406
|
+
|
|
407
|
+ /**
|
|
408
|
+ * 获取楼盘的折线图统计
|
|
409
|
+ *
|
|
410
|
+ * @param orgId
|
|
411
|
+ * @param startDate
|
|
412
|
+ * @param endDate
|
|
413
|
+ * @param personBuildingList
|
|
414
|
+ * @return
|
|
415
|
+ */
|
|
416
|
+ @Override
|
|
417
|
+ public ResponseBean getStatsBarList(Integer orgId, LocalDate startDate, LocalDate endDate, List<TaPersonBuilding> personBuildingList) {
|
|
418
|
+ Map<String,Object> map = new HashMap<>();
|
|
419
|
+ //项目公客排行折线图获取
|
|
420
|
+ Map<String,Object> gkBarMap = getGkBarData(orgId,startDate,endDate,personBuildingList);
|
|
421
|
+ map.put("gkBarMap",gkBarMap);
|
|
422
|
+ //项目私客排行折线图获取
|
|
423
|
+ //项目访问人数排行折线图获取
|
|
424
|
+ //项目访问次数排行折线图获取
|
|
425
|
+ return ResponseBean.success(map);
|
|
426
|
+ }
|
|
427
|
+
|
|
428
|
+ private Map<String, Object> getGkBarData(Integer orgId, LocalDate startDate, LocalDate endDate, List<TaPersonBuilding> personBuildingList) {
|
|
429
|
+ Map<String,Object> map = new HashMap<>();
|
|
430
|
+ List<Map<String, Object>> gkBarData = taBuildingMapper.getGkBarData(orgId, startDate, endDate, personBuildingList);
|
|
431
|
+ if (gkBarData.size() > 0){
|
|
432
|
+ map.put("data",gkBarData);
|
|
433
|
+ List<Object> buildingNameList = gkBarData.stream().map(x -> x.get("buildingName")).collect(Collectors.toList());
|
|
434
|
+ map.put("buildingNameList",buildingNameList);
|
|
435
|
+ List<Object> gkNumList = gkBarData.stream().map(x -> x.get("gkNum")).collect(Collectors.toList());
|
|
436
|
+ map.put("numList",gkNumList);
|
|
437
|
+ }
|
|
438
|
+ return map;
|
|
439
|
+ }
|
405
|
440
|
}
|