| | |
| | | Map<String, List<OnlineRateVo>> collectList=new HashMap<>(); |
| | | List<OnlineRateVo> OnlineRateVoList = deviceMapper.getLists(onlineRatePageCond.getOrganizationId(),onlineRatePageCond.getState()); |
| | | if (!ObjectUtils.isEmpty(OnlineRateVoList)){ |
| | | collectList = OnlineRateVoList.stream().collect(Collectors.groupingBy(OnlineRateVo::getHourState)); |
| | | |
| | | for (OnlineRateVo onlineRateVo : OnlineRateVoList) { |
| | | List<HistoryHourly> valueByMacAndTime = historyHourlyService.getValueByMacAndTime(onlineRateVo.getMac(), start, end); |
| | | ArrayList<Date> dates = new ArrayList<>(); |
| | |
| | | } |
| | | }); |
| | | }*/ |
| | | |
| | | if (!ObjectUtils.isEmpty(OnlineRateVoList)){ |
| | | collectList = OnlineRateVoList.stream().collect(Collectors.groupingBy(OnlineRateVo::getHourState)); |
| | | } |
| | | return ObjectUtils.isEmpty(onlineRatePageCond.getHourState())?OnlineRateVoList:collectList.get(onlineRatePageCond.getHourState()); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String,Object> getStart(Integer organizationId) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<OnlineRateVo> lists = deviceMapper.getLists(organizationId, null); |
| | | if (!ObjectUtils.isEmpty(lists)){ |
| | | Map<String, List<OnlineRateVo>> collect = lists.stream().collect(Collectors.groupingBy(OnlineRateVo::getState)); |
| | | int size1 = lists.size(); |
| | | int size = collect.get("0").size(); |
| | | int i = size1 - size; |
| | | //总数 |
| | | map.put("sum",lists.size()); |
| | | //在线 |
| | | map.put("online",i); |
| | | double number = (double) i / size1 * 100; |
| | | String result = String.format("%.2f", number); |
| | | map.put("onlineRate",result); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> detailV1(String mac, String startTime, String endTime, String type) { |
| | | HashMap<String, Object> rsMap = new HashMap<>(); |
| | | Map<String, Object> map = new TreeMap<>( |