|  |  |  | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | 
|---|
|  |  |  | if(ksTime.equals(endTime)){ | 
|---|
|  |  |  | heatMapVo.setHourListTime(hourListTime); | 
|---|
|  |  |  | heatMapVos.add(heatMapVo); | 
|---|
|  |  |  | idHour++; | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | id++; | 
|---|
|  |  |  | 
|---|
|  |  |  | heatMapVo.setName(nameEndTime); | 
|---|
|  |  |  | heatMapVo.setHourListTime(hourListTime); | 
|---|
|  |  |  | heatMapVos.add(heatMapVo); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | name = nameEndTime; | 
|---|
|  |  |  | heatMapVo.setHourListTime(hourListTime); | 
|---|
|  |  |  | 
|---|
|  |  |  | 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(" "); | 
|---|
|  |  |  | 
|---|
|  |  |  | 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); | 
|---|