于紫祥_1901
2020-12-14 782e84d68779471c0640584678d4c4df3afa80a2
src/main/java/com/moral/controller/ScreenController.java
@@ -727,7 +727,7 @@
             */
            /*改动范围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
@@ -745,7 +745,7 @@
                    datas.put("time",time1);
                    list.add(datas);
                }
            }
            //}
            /*改动范围end-------------------------------------------------------------------------*/
@@ -2963,28 +2963,35 @@
            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;
    }
}