jinpengyong
2023-12-18 002f9e7d3576cc85bc5decd42c7bce02ef4bb6c4
chore:测试提交
1 files modified
32 ■■■■ changed files
screen-api/src/main/java/com/moral/api/controller/HeatMapController.java 32 ●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/controller/HeatMapController.java
@@ -16,8 +16,6 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.moral.api.pojo.dto.dataDisplay.HeatMapDTO;
import com.moral.api.service.DataDisplayService;
import com.moral.api.vo.HeatMapVo;
@@ -116,6 +114,8 @@
                    if(ksTime.equals(endTime)){
                        heatMapVo.setHourListTime(hourListTime);
                        heatMapVos.add(heatMapVo);
                        idHour++;
                        break;
                    }
                }else {
                    id++;
@@ -132,6 +132,7 @@
                        heatMapVo.setName(nameEndTime);
                        heatMapVo.setHourListTime(hourListTime);
                        heatMapVos.add(heatMapVo);
                        break;
                    }else {
                        name = nameEndTime;
                        heatMapVo.setHourListTime(hourListTime);
@@ -147,11 +148,8 @@
            if(CollectionUtils.isNotEmpty(heatMapVos)){
                heatMapVos.get(0).setIdLength(idHour);
            }
/*
            String[] splitStart = startTime.split("-");
/*            String[] splitStart = startTime.split("-");
            String[] s1 = splitStart[2].split(" ");
            String[] splitEnd = endTime.split("-");
            String[] s2 = splitEnd[2].split(" ");
@@ -168,24 +166,28 @@
                hourList.add(currentDateTime.toString());
                currentDateTime = currentDateTime.plusHours(1);
            }
            int length=0;
            for (int i = 0; i <= daysBetween; i++) {
                ArrayList<Map<String,Object>> list = new ArrayList<>();
                ArrayList<TimeHourVo> timeHourVos = new ArrayList<>();
                HeatMapVo heatMapVo = new HeatMapVo();
                LocalDate date = startDate.plusDays(i);
                heatMapVo.setId(i);
                heatMapVo.setName(date.toString());
                for (int i1 = 0; i1 < hourList.size(); i1++) {
                    HashMap<String, Object> map = new HashMap<>();
                    if (hourList.get(i).contains(date.toString())){
                        map.put("name",hourList.get(i).substring(11,16));
                        list.add(map);
                    if (hourList.get(i1).contains(date.toString())){
                        TimeHourVo hourVo = new TimeHourVo();
                        hourVo.setName(hourList.get(i1).substring(11,13));
                        hourVo.setId(length);
                        timeHourVos.add(hourVo);
                        hourList.remove(i1);
                        i1--;
                        length++;
                    }
                }
                heatMapVo.setHourList(list);
                heatMapVo.setHourListTime(timeHourVos);
                heatMapVos.add(heatMapVo);
            }*/
            }
            heatMapVos.get(0).setIdLength(length);*/
        }
        return ResultMessage.ok(ObjectUtils.isEmpty(heatMapVos)?"0":heatMapVos);