WIP: страницы для правил #62

Closed
Ghost wants to merge 132 commits from master into 61-rules-pages
2 changed files with 9 additions and 11 deletions
Showing only changes of commit 5c6b388901 - Show all commits

View File

@ -38,22 +38,22 @@ public class MarkupService {
List<TimeSeriesForMarkup> tsForMarkup = new ArrayList<>(); List<TimeSeriesForMarkup> tsForMarkup = new ArrayList<>();
for (int i = 0; i < timeSeriesList.size(); i++) { for (int i = 0; i < timeSeriesList.size(); i++) {
TimeSeries ts1 = timeSeriesList.get(i); TimeSeries ts1 = timeSeriesList.get(i);
for (int j = i + 1; j < timeSeriesList.size(); j++) { for (int j = i+1; j < timeSeriesList.size(); j++) {
TimeSeries ts2 = timeSeriesList.get(j); TimeSeries ts2 = timeSeriesList.get(j);
List<TimeSeriesValue> values1 = ts1.getValues(); List<TimeSeriesValue> values1 = ts1.getValues();
for (int k = 0; k < values1.size() - 1; k++) { for (int k = 0; k < values1.size()-1; k++) {
List<TimeSeriesValue> values2 = ts2.getValues(); List<TimeSeriesValue> values2 = ts2.getValues();
for (int l = 0; l < values2.size() - 1; l++) { for (int l = 0; l < values2.size()-1; l++) {
if (values1.get(k).getDate().equals(values2.get(l).getDate()) if (values1.get(k).getDate().equals(values2.get(l).getDate())
&& values1.get(k + 1).getDate().equals(values2.get(l + 1).getDate())) { && values1.get(k+1).getDate().equals(values2.get(l+1).getDate())) {
final int index = k; final int index = k;
TimeSeriesForMarkup found = tsForMarkup TimeSeriesForMarkup found = tsForMarkup
.stream() .stream()
.filter(m -> m.getDateFrom().equals(values1.get(index).getDate()) && m.getDateTo().equals(values1.get(index + 1).getDate())) .filter(m -> m.getDateFrom().equals(values1.get(index).getDate()) && m.getDateTo().equals(values1.get(index+1).getDate()))
.findAny() .findAny()
.orElse(null); .orElse(null);
if (found == null) { if (found == null) {
tsForMarkup.add(new TimeSeriesForMarkup(ts1, ts2, values1.get(index).getDate(), values1.get(index + 1).getDate())); tsForMarkup.add(new TimeSeriesForMarkup(ts1, ts2, values1.get(index).getDate(), values1.get(index+1).getDate()));
} else { } else {
found.getTimeSeriesSet().add(ts1); found.getTimeSeriesSet().add(ts1);
found.getTimeSeriesSet().add(ts2); found.getTimeSeriesSet().add(ts2);

View File

@ -22,9 +22,7 @@
</option> </option>
</select> </select>
<script th:inline="javascript"> <script th:inline="javascript">
$('#select-branch').val([[ * {branchId}] $('#select-branch').val([[*{branchId}]]);
])
;
$('#select-branch').selectpicker('refresh'); $('#select-branch').selectpicker('refresh');
</script> </script>
</div> </div>
@ -41,10 +39,10 @@
</thead> </thead>
<tbody> <tbody>
<tr th:each="m, itemStat: *{timeSeriesForMarkupList}"> <tr th:each="m, itemStat: *{timeSeriesForMarkupList}">
<!-- <td><input type="hidden" th:field="*{markupRows[__${itemStat.index}__].timeSeries.id}"></span></td>--> <!-- <td><input type="hidden" th:field="*{markupRows[__${itemStat.index}__].timeSeries.id}"></span></td>-->
<td><span class="badge badge-success" th:text="${m.dateFrom}"></span></td> <td><span class="badge badge-success" th:text="${m.dateFrom}"></span></td>
<td><span class="badge badge-success" th:text="${m.dateTo}"></span></td> <td><span class="badge badge-success" th:text="${m.dateTo}"></span></td>
<td><input type="text"></input></td> <td><input type="text" ></input></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>