| | |
| | | */ |
| | | /*改动范围start-------------------------------------------------------------------------*/ |
| | | list.remove(0); |
| | | if (list.size() == 23) { |
| | | //if (list.size() == 23) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd"); |
| | | //获取全格式时间yyyy-MM-dd HH:mm:ss |
| | |
| | | datas.put("time",time1); |
| | | list.add(datas); |
| | | } |
| | | } |
| | | //} |
| | | /*改动范围end-------------------------------------------------------------------------*/ |
| | | |
| | | |
| | |
| | | rList.add(null); |
| | | }else { |
| | | for (int j = 0; j < lists.get(0).size(); j++) { |
| | | Map<String,Object> listMap = new HashMap(); |
| | | List<Map> mapList=new ArrayList<>(); |
| | | if (lists.get(0).size()==1){ |
| | | Map<String, Object> listMap = new HashMap(); |
| | | List<Map> mapList = new ArrayList<>(); |
| | | if (lists.get(0).size() == 1) { |
| | | mapList.add(null); |
| | | }else { |
| | | } else { |
| | | mapList.add((Map) lists.get(0).get(j).get("data")); |
| | | } |
| | | for (int i = 1; i < lists.size(); i++) { |
| | | if (lists.get(i).size()==1){ |
| | | mapList.add(null); |
| | | listMap.put("data",mapList); |
| | | }else { |
| | | if (lists.get(0).get(j).get("time").equals(lists.get(i).get(j).get("time"))){ |
| | | mapList.add((Map) lists.get(i).get(j).get("data")); |
| | | } |
| | | listMap.put("time",lists.get(0).get(j).get("time")); |
| | | listMap.put("data",mapList); |
| | | for (int i = 1; i < lists.size(); i++) { |
| | | if (lists.get(i).size() == 1) { |
| | | mapList.add(null); |
| | | listMap.put("data", mapList); |
| | | } else { |
| | | if (lists.get(0).get(j).get("time").equals(lists.get(i).get(j).get("time"))) { |
| | | mapList.add((Map) lists.get(i).get(j).get("data")); |
| | | } |
| | | listMap.put("time", lists.get(0).get(j).get("time")); |
| | | listMap.put("data", mapList); |
| | | } |
| | | } |
| | | rList.add(listMap); |
| | | } |
| | | } |
| | | return new ResultBean<List<Map<String,Object>>>(rList); |
| | | } |
| | | |
| | | @PostMapping("byAccountGetDevices") |
| | | public List<Device> byAccountGetDevices(@RequestBody Map<String, Object> parameters) { |
| | | String id =parameters.get("id").toString(); |
| | | List<Device> devicesList = deviceService.getDevicesByAccountId(id); |
| | | return devicesList; |
| | | } |
| | | } |