|
7 | 7 | import java.util.Collections; |
8 | 8 | import java.util.HashMap; |
9 | 9 | import java.util.List; |
| 10 | +import java.util.Locale; |
10 | 11 | import java.util.Map; |
11 | 12 | import java.util.stream.Collectors; |
12 | 13 |
|
@@ -64,6 +65,9 @@ public class MonitoringAPController<T extends MonitoringResult> extends BorderPa |
64 | 65 |
|
65 | 66 | @FXML |
66 | 67 | DatePicker inquiryDatePicker; |
| 68 | + |
| 69 | + @FXML |
| 70 | + Label historyDateTimeLabel; |
67 | 71 |
|
68 | 72 | @FXML |
69 | 73 | Pagination pagination; |
@@ -240,6 +244,15 @@ public void syncTableData(String id, int index) { |
240 | 244 |
|
241 | 245 | // Sync monitoring prequency UI |
242 | 246 | syncPrequency(prequencyTimeDivBtn.getText()); |
| 247 | + |
| 248 | + // Sync history monitoring datetime |
| 249 | + if(tableData != null && !tableData.isEmpty()) { |
| 250 | + String monitoringDateTime = tableData.get(0).getMonitoringDateTime(); |
| 251 | + historyDateTimeLabel.setText(DateUtils.convertDateFormat("yyyyMMddHHmmss", "yyyy-MM-dd HH:mm:ss", |
| 252 | + monitoringDateTime, Locale.KOREA)); |
| 253 | + } else { |
| 254 | + historyDateTimeLabel.setText("기록을 조회해주세요."); |
| 255 | + } |
243 | 256 | } |
244 | 257 |
|
245 | 258 | /** |
@@ -366,9 +379,22 @@ private void syncPrequency(String timeDiv) { |
366 | 379 | prequencyHBox.getChildren().add(new PrequencyButton(countByTime.get(i))); |
367 | 380 | } |
368 | 381 | } |
369 | | - |
| 382 | + |
370 | 383 | public void showPrevHistory(ActionEvent e) { |
| 384 | + String selected = aliasComboBox.getSelectionModel().getSelectedItem(); |
| 385 | + |
| 386 | + // Clear data |
| 387 | + clearTableData(selected); |
371 | 388 |
|
| 389 | + Map<String, List<T>> allDataList = inquiryMonitoringHistory(); |
| 390 | + if (allDataList == null || allDataList.size() == 0) { |
| 391 | + AlertUtils.showAlert(AlertType.INFORMATION, "조회결과 없음", "해당일자의 모니터링 기록이 없습니다."); |
| 392 | + return; |
| 393 | + } |
| 394 | + |
| 395 | + // Add and Sync data |
| 396 | + addTableDataSet(selected, allDataList); |
| 397 | + syncTableData(selected, 0); |
372 | 398 | } |
373 | 399 |
|
374 | 400 | public void showNextHistory(ActionEvent e) { |
|
0 commit comments