Add additional infos for order history in /user/... fixes #109

This commit is contained in:
CodeSteak 2020-06-24 01:19:37 +02:00
parent cd641d6cc4
commit b9e87f5bd4
2 changed files with 10 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package org.hso.ecommerce.controller;
import org.hso.ecommerce.action.user.CreateDeliveryData;
import org.hso.ecommerce.action.user.UpdateUserSettingsAction;
import org.hso.ecommerce.api.RestServiceForDelivery;
import org.hso.ecommerce.app.config.AppSettings;
import org.hso.ecommerce.entities.shop.CustomerOrder;
import org.hso.ecommerce.entities.user.User;
import org.hso.ecommerce.repos.shop.CustomerOrderRepository;
@ -31,6 +32,9 @@ public class UserController {
@Autowired
private final RestServiceForDelivery restServiceForDelivery = null;
@Autowired
private final AppSettings appSettings = null;
@GetMapping("/")
public String user() {
return "redirect:/user/settings";
@ -58,6 +62,7 @@ public class UserController {
.collect(Collectors.toList());
model.addAttribute("orderDeliveryDataMap", customerOrderDeliveryDataMap);
model.addAttribute("deliveryService", appSettings.getParcelServiceName());
return "user/orders/index";
}

View File

@ -27,6 +27,10 @@
<div th:if="${!orderDeliveryDataMap.isEmpty()}" th:each="order: ${orderDeliveryDataMap}">
<div>
<table class="key-value">
<tr>
<th>Bestelldatum</th>
<td th:text="${order.customerOrder.created}"></td>
</tr>
<tr>
<th>Lieferstatus</th>
<td th:if="${order.deliveryData.allOk()}"><span th:text="${order.deliveryData.getStatus()}"/>
@ -48,7 +52,7 @@
</tr>
<tr>
<th>Sendeverfolgungsnummer</th>
<td th:text="${order.customerOrder.trackingId!=null} ? ${order.customerOrder.trackingId} : 'Es wurde noch keine Sendungsnummer vergeben'"></td>
<td th:text="${order.customerOrder.trackingId!=null} ? ${deliveryService + ', ' + order.customerOrder.trackingId} : 'Es wurde noch keine Sendungsnummer vergeben'"></td>
</tr>
<tr>
<th></th>