Fix
This commit is contained in:
parent
d04c61b683
commit
ebb29d49d3
@ -1,6 +1,7 @@
|
|||||||
package ru.ulstu.admin.model;
|
package ru.ulstu.admin.model;
|
||||||
|
|
||||||
import ru.ulstu.indicator.model.Course;
|
import ru.ulstu.indicator.model.Course;
|
||||||
|
import ru.ulstu.indicator.model.Indicator;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -16,6 +17,16 @@ public class IndicatorForm {
|
|||||||
|
|
||||||
private List<Course> courses = new ArrayList<>();
|
private List<Course> courses = new ArrayList<>();
|
||||||
|
|
||||||
|
public IndicatorForm() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public IndicatorForm(Indicator indicator) {
|
||||||
|
this.name = indicator.getName();
|
||||||
|
this.max = indicator.getMax();
|
||||||
|
this.proofDocuments = indicator.getProofDocuments();
|
||||||
|
this.courses = indicator.getCourses();
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ public class AdminIndicatorService {
|
|||||||
|
|
||||||
public void saveIndicator(IndicatorForm indicatorForm) {
|
public void saveIndicator(IndicatorForm indicatorForm) {
|
||||||
Indicator indicator = indicatorForm.getId() == null
|
Indicator indicator = indicatorForm.getId() == null
|
||||||
? new Indicator(indicatorForm)
|
? new Indicator()
|
||||||
: indicatorService.getIndicatorById(indicatorForm.getId());
|
: indicatorService.getIndicatorById(indicatorForm.getId());
|
||||||
indicator.setName(indicatorForm.getName());
|
indicator.setName(indicatorForm.getName());
|
||||||
indicator.setMax(indicatorForm.getMax());
|
indicator.setMax(indicatorForm.getMax());
|
||||||
|
@ -9,7 +9,6 @@ import jakarta.persistence.Lob;
|
|||||||
import jakarta.validation.constraints.Max;
|
import jakarta.validation.constraints.Max;
|
||||||
import jakarta.validation.constraints.Min;
|
import jakarta.validation.constraints.Min;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import ru.ulstu.admin.model.IndicatorForm;
|
|
||||||
import ru.ulstu.model.BaseEntity;
|
import ru.ulstu.model.BaseEntity;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -37,13 +36,6 @@ public class Indicator extends BaseEntity {
|
|||||||
public Indicator() {
|
public Indicator() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Indicator(IndicatorForm indicatorForm) {
|
|
||||||
this.name = indicatorForm.getName();
|
|
||||||
this.max = indicatorForm.getMax();
|
|
||||||
this.proofDocuments = indicatorForm.getProofDocuments();
|
|
||||||
this.courses = indicatorForm.getCourses();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user