|
|
|
@ -24,7 +24,8 @@ public class BoardServiceImpl implements BoardService { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public List<NewScheduledData> getNewScheduledTableData(int number){ |
|
|
|
public Map<String, Object> getNewScheduledTableData(int number){ |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
String date = DateUtil.getStringDate(new Date()); |
|
|
|
// String date="2022-05-22"; |
|
|
|
List<NewScheduledData> tableList =boardDao.getNewScheduledTableList(date); |
|
|
|
@ -34,7 +35,9 @@ public class BoardServiceImpl implements BoardService { |
|
|
|
tableList.add(tableData); |
|
|
|
} |
|
|
|
if(tableList.size()<=5){ |
|
|
|
return tableList; |
|
|
|
map.put("rows", tableList); |
|
|
|
map.put("num", 0); |
|
|
|
map.put("total", tableList.size()); |
|
|
|
}else { |
|
|
|
int max=(tableList.size()+4)/5; |
|
|
|
if(number>=max){ |
|
|
|
@ -45,15 +48,22 @@ public class BoardServiceImpl implements BoardService { |
|
|
|
for (int i = 0; i +5*number< tableList.size(); i++) { |
|
|
|
result.add(tableList.get(i +5*number)); |
|
|
|
} |
|
|
|
return result; |
|
|
|
map.put("rows", result); |
|
|
|
map.put("num", number+1); |
|
|
|
map.put("total", result.size()); |
|
|
|
}else { |
|
|
|
List<NewScheduledData> result=new ArrayList<>(); |
|
|
|
for (int i = 0; i < 5; i++) { |
|
|
|
result.add(tableList.get(i +5*number)); |
|
|
|
} |
|
|
|
return result; |
|
|
|
map.put("rows", result); |
|
|
|
map.put("num", number+1); |
|
|
|
map.put("total", result.size()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
return map; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|