|
@@ -3,10 +3,12 @@ package com.community.huiju.service.impl;
|
3
|
3
|
import com.community.commom.mode.ResponseBean;
|
4
|
4
|
import com.community.huiju.dao.MqMessageMapper;
|
5
|
5
|
import com.community.huiju.service.IMqMessageService;
|
|
6
|
+import com.google.common.collect.Lists;
|
6
|
7
|
import com.google.common.collect.Maps;
|
7
|
8
|
import org.springframework.beans.factory.annotation.Autowired;
|
8
|
9
|
import org.springframework.stereotype.Service;
|
9
|
10
|
|
|
11
|
+import java.util.List;
|
10
|
12
|
import java.util.Map;
|
11
|
13
|
|
12
|
14
|
/**
|
|
@@ -22,11 +24,28 @@ public class MqMessageService implements IMqMessageService {
|
22
|
24
|
@Override
|
23
|
25
|
public ResponseBean selectOpenDoorCount() {
|
24
|
26
|
ResponseBean responseBean = new ResponseBean();
|
25
|
|
- Map<String,Object> map = Maps.newHashMap();
|
26
|
|
- Integer result = mqMessageMapper.selectOpenDoorCount();
|
27
|
|
- map.put("message","开门次数");
|
28
|
|
- map.put("count",result);
|
29
|
|
- responseBean.addSuccess(map);
|
|
27
|
+
|
|
28
|
+ Map<String,Object> communityMap = Maps.newHashMap();
|
|
29
|
+ Integer result = mqMessageMapper.selectCommunityOpenDoorCount();
|
|
30
|
+ communityMap.put("message","小区开门次数");
|
|
31
|
+ communityMap.put("count",result);
|
|
32
|
+
|
|
33
|
+ // 刷卡开门次数
|
|
34
|
+ Integer brushCardUnitsOpenDoorCount = mqMessageMapper.selectUnitsOpenDoorCount(983299);
|
|
35
|
+ // 刷脸开门次数
|
|
36
|
+ Integer brushFaceUunitsOpenDoorCount = mqMessageMapper.selectUnitsOpenDoorCount(983309);
|
|
37
|
+
|
|
38
|
+ Integer openCount = brushCardUnitsOpenDoorCount + brushFaceUunitsOpenDoorCount;
|
|
39
|
+
|
|
40
|
+ Map<String,Object> uunitsMap = Maps.newHashMap();
|
|
41
|
+ uunitsMap.put("message","单元门开门次数");
|
|
42
|
+ uunitsMap.put("count",openCount);
|
|
43
|
+
|
|
44
|
+ List<Map<String,Object>> mapList = Lists.newArrayList();
|
|
45
|
+ mapList.add(communityMap);
|
|
46
|
+ mapList.add(uunitsMap);
|
|
47
|
+
|
|
48
|
+ responseBean.addSuccess(mapList);
|
30
|
49
|
return responseBean;
|
31
|
50
|
}
|
32
|
51
|
}
|