From a22c180aa8e5245c7830ab39287ff976dd04d3fd Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Tue, 15 Apr 2025 22:22:07 +0400 Subject: [PATCH] #21 -- Add comments --- .../ru/ulstu/report/model/ReportValue.java | 9 +++++++ .../report/model/dto/ReportValueDto.java | 10 +++++++ .../report/service/ReportValueService.java | 1 + .../templates/report/editReportValue.html | 27 ++++++++++++------- 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/src/main/java/ru/ulstu/report/model/ReportValue.java b/src/main/java/ru/ulstu/report/model/ReportValue.java index 2cb48b8..9ae1e0e 100644 --- a/src/main/java/ru/ulstu/report/model/ReportValue.java +++ b/src/main/java/ru/ulstu/report/model/ReportValue.java @@ -24,6 +24,7 @@ public class ReportValue extends BaseEntity { @Fetch(FetchMode.SUBSELECT) private List files = new ArrayList<>(); private int indicatorValue; + private String comment; public Indicator getIndicator() { return indicator; @@ -48,4 +49,12 @@ public class ReportValue extends BaseEntity { public void setFiles(List files) { this.files = files; } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } } diff --git a/src/main/java/ru/ulstu/report/model/dto/ReportValueDto.java b/src/main/java/ru/ulstu/report/model/dto/ReportValueDto.java index 885648f..19e776e 100644 --- a/src/main/java/ru/ulstu/report/model/dto/ReportValueDto.java +++ b/src/main/java/ru/ulstu/report/model/dto/ReportValueDto.java @@ -14,6 +14,7 @@ public class ReportValueDto { private Indicator indicator; private int indicatorValue; private List files = new ArrayList<>(); + private String comment; public ReportValueDto() { } @@ -33,6 +34,7 @@ public class ReportValueDto { this.indicator = reportValue.getIndicator(); this.files = reportValue.getFiles().stream().map(FileDataDto::new).collect(Collectors.toList()); this.indicatorValue = reportValue.getIndicatorValue(); + this.comment = reportValue.getComment(); } public Indicator getIndicator() { @@ -74,4 +76,12 @@ public class ReportValueDto { public void setReportId(Integer reportId) { this.reportId = reportId; } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } } diff --git a/src/main/java/ru/ulstu/report/service/ReportValueService.java b/src/main/java/ru/ulstu/report/service/ReportValueService.java index d059a8f..a4fb6d8 100644 --- a/src/main/java/ru/ulstu/report/service/ReportValueService.java +++ b/src/main/java/ru/ulstu/report/service/ReportValueService.java @@ -42,6 +42,7 @@ public class ReportValueService { .toList()); reportValue.getFiles().removeAll(files); reportValue.setFiles(files); + reportValue.setComment(reportValueDto.getComment()); reportValue = reportValueRepository.save(reportValue); reportService.addReportValue(reportValueDto.getReportId(), reportValue); diff --git a/src/main/resources/templates/report/editReportValue.html b/src/main/resources/templates/report/editReportValue.html index 437c76a..498fc7e 100644 --- a/src/main/resources/templates/report/editReportValue.html +++ b/src/main/resources/templates/report/editReportValue.html @@ -11,8 +11,17 @@ +
+
+
+ +
+ +
+
+
+