소스 검색

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'stammstationen....

testBranch
Johannes Oehm 10 년 전
부모
커밋
48e2a466ab
3개의 변경된 파일42개의 추가작업 그리고 7개의 파일을 삭제
  1. +3
    -1
      src/main/java/de/uniluebeck/mi/projmi6/controller/MainController.java
  2. +39
    -5
      src/main/java/de/uniluebeck/mi/projmi6/controller/StationsHistorieController.java
  3. +0
    -1
      src/main/resources/stationshistorie.fxml

+ 3
- 1
src/main/java/de/uniluebeck/mi/projmi6/controller/MainController.java 파일 보기

@@ -264,7 +264,7 @@ public class MainController {
protected Void call() throws Exception {
untersuchungList = DBHandler.getUntersuchungByFall(newValue);
diagnoseList = DBHandler.getDiagnosenByFall(newValue);
// stationsHistorieList = DBHandler.getStationsHistorieByStation("");
stationsHistorieList = DBHandler.getStationsHistorieByFall(newValue);
return null;
}

@@ -277,6 +277,8 @@ public class MainController {
}
untersuchungenController.setUntersuchungen(FXCollections.observableArrayList(untersuchungList));
diagnoseController.setDiagnosen(FXCollections.observableArrayList(diagnoseList));
stationsHistorieController.setStationsHistorie(FXCollections.observableArrayList(stationsHistorieList));


tabPaneFall.setDisable(false);
tabFallDiagnose.setDisable(false);


+ 39
- 5
src/main/java/de/uniluebeck/mi/projmi6/controller/StationsHistorieController.java 파일 보기

@@ -1,15 +1,21 @@
package de.uniluebeck.mi.projmi6.controller;

import de.uniluebeck.mi.projmi6.db.DBHandler;
import de.uniluebeck.mi.projmi6.model.Station;
import de.uniluebeck.mi.projmi6.model.StationsHistorie;
import de.uniluebeck.mi.projmi6.view.DateTimePicker;
import javafx.beans.binding.Bindings;
import javafx.beans.property.SimpleObjectProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.collections.transformation.FilteredList;
import javafx.fxml.FXML;
import javafx.scene.control.*;
import javafx.scene.control.cell.PropertyValueFactory;

import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;

/**
* Created by 631806 on 12.11.15.
@@ -33,7 +39,7 @@ public class StationsHistorieController {
private Label statHistCreator, statHistCreateTime, statHistEditor, statHistEditTime;

@FXML
private TableColumn<StationsHistorie,String>colStatHistAbteilung, colStatHistStation;
private TableColumn<StationsHistorie,String> colStatHistStation;

@FXML
private TableColumn<StationsHistorie,LocalDate> colStatHistAufnahmeDatum, colStatHistEntlassungsDatum;
@@ -45,19 +51,44 @@ public class StationsHistorieController {
private ComboBox<Station> cmbStation;

@FXML
private ComboBox<?> cmbAbteilung;
private ComboBox<String> cmbAbteilung;

public StationsHistorieController(MainController mainController){
this.mainController = mainController;
}


public void setStationsHistorie(ObservableList<StationsHistorie> stationsHistorie) {
this.stationsHistorie.set(stationsHistorie);
}

private SimpleObjectProperty<ObservableList<StationsHistorie>> stationsHistorie =
new SimpleObjectProperty<>();



@FXML
private void initialize() {
initColumns();

List<String> abteilungen = mainController.getStammdaten().getStationen().stream()
.map(stat->stat.getAbteilung()).distinct().collect(Collectors.toList());
cmbAbteilung.setItems(FXCollections.observableArrayList(abteilungen));


FilteredList<Station> stationenFiltered = new FilteredList<Station>(mainController.getStammdaten().getStationen());

stationenFiltered.predicateProperty().bind(Bindings.createObjectBinding(() -> {
return p -> p.getAbteilung().equals(cmbAbteilung.getValue());
},cmbAbteilung.valueProperty()));

cmbStation.setItems(mainController.getStammdaten().getStationen());



tblStationsHistorie.itemsProperty().bind(stationsHistorie);
tblStationsHistorie.getSelectionModel().selectedItemProperty().addListener((observableValue, oldValue, newValue) -> {
setStationsHistorieSelected(newValue);

});
}

@@ -91,7 +122,6 @@ public class StationsHistorieController {
this.stationsHistorie.set(stationsHistorie);
}

private SimpleObjectProperty<ObservableList<StationsHistorie>> stationsHistorie = new SimpleObjectProperty<>();

public void setStationsHistorieSelected(StationsHistorie stationsHistorie){
@@ -105,7 +135,7 @@ public class StationsHistorieController {


private void initColumns(){
//colStatHistAbteilung.setCellValueFactory();
// colStatHistStation.setCellValueFactory(new PropertyValueFactory<StationsHistorie, String>());
colStatHistAufnahmeDatum.setCellValueFactory(new PropertyValueFactory<StationsHistorie, LocalDate>("aufnahmeDatum"));
colStatHistEntlassungsDatum.setCellValueFactory(new PropertyValueFactory<StationsHistorie, LocalDate>("entlassungsDatum"));
//colStatHistStation.setCellValueFactory(new PropertyValueFactory<StationsHistorie, LocalDate>());
@@ -114,6 +144,10 @@ public class StationsHistorieController {

private void copyStationsHistorieDataIntoFields(){

if(stationsHistorieSelected==null){
return;
}

//TODO cmbStation.setValue

dtTmAufnahme.setDateTime(stationsHistorieSelected.getAufnahmeDatum());


+ 0
- 1
src/main/resources/stationshistorie.fxml 파일 보기

@@ -21,7 +21,6 @@
</ToolBar>
<TableView prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS" fx:id="tblStationsHistorie">
<columns>
<TableColumn prefWidth="75.0" text="Abteilung" fx:id="colStatHistAbteilung"/>
<TableColumn prefWidth="75.0" text="Station" fx:id="colStatHistStation"/>
<TableColumn prefWidth="75.0" text="Aufnahme" fx:id="colStatHistAufnahmeDatum"/>
<TableColumn prefWidth="75.0" text="Entlassung" fx:id="colStatHistEntlassungsDatum"/>


불러오는 중...
취소
저장