|
@@ -67,6 +67,8 @@ public class EmailMessageBroker implements MessageBroker {
|
|
|
|
|
|
|
|
String reportedTime = report.getCreated().format(ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
String reportedTime = report.getCreated().format(ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
final String rowStyle = "border: 1px solid #dddddd; text-align: left; padding: 8px;";
|
|
final String rowStyle = "border: 1px solid #dddddd; text-align: left; padding: 8px;";
|
|
|
|
|
+
|
|
|
|
|
+ report.getReports().sort(Comparator.comparing(SimpleReport::getStatus).reversed());
|
|
|
for (SimpleReport simpleReport : report.getReports()) {
|
|
for (SimpleReport simpleReport : report.getReports()) {
|
|
|
if (simpleReport.getRecord() instanceof ObservationInfo) {
|
|
if (simpleReport.getRecord() instanceof ObservationInfo) {
|
|
|
ObservationInfo observation = (ObservationInfo)simpleReport.getRecord();
|
|
ObservationInfo observation = (ObservationInfo)simpleReport.getRecord();
|
|
@@ -76,7 +78,7 @@ public class EmailMessageBroker implements MessageBroker {
|
|
|
String unitCell = String.format("%s (%s)", source.getUnit().getName(), source.getUnit().getId());
|
|
String unitCell = String.format("%s (%s)", source.getUnit().getName(), source.getUnit().getId());
|
|
|
String sensorCell = String.format("%s (%s)", source.getSensor().getName(), source.getSensor().getId());
|
|
String sensorCell = String.format("%s (%s)", source.getSensor().getName(), source.getSensor().getId());
|
|
|
|
|
|
|
|
- tableWriter.row(rowStyle + (isOk ? "background-color: #CCFFCC" : "background-color: #FFCCCC"))
|
|
|
|
|
|
|
+ tableWriter.row(rowStyle + "background-color: " + (isOk ? "#CCFFCC" : "#FFCCCC"))
|
|
|
.cell(unitCell, rowStyle)
|
|
.cell(unitCell, rowStyle)
|
|
|
.cell(sensorCell, rowStyle)
|
|
.cell(sensorCell, rowStyle)
|
|
|
.cell(observation.getTimestamp().toString(), rowStyle)
|
|
.cell(observation.getTimestamp().toString(), rowStyle)
|