fixed route for /intern/articles and /intern/suppliers/articles

This commit is contained in:
Hendrik Schutter 2020-05-11 14:32:07 +02:00
parent 22d2744c8c
commit 09c85fe8cb
4 changed files with 28 additions and 11 deletions

View File

@ -170,7 +170,7 @@ public class RequestController {
}
*/
/*
@GetMapping("/intern/articles/")
public String internArticles() {
return "intern/articles/index";
@ -180,6 +180,7 @@ public class RequestController {
public String internArticlesId() {
return "intern/articles/id";
}
*/
@GetMapping("/intern/customers/")
public String internCustomers() {

View File

@ -12,7 +12,7 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
@Controller
@RequestMapping("intern/listedArticles")
@RequestMapping("intern/articles")
public class InternArticleController {
@Autowired
private final ArticleRepository articleRepository = null;
@ -49,6 +49,26 @@ public class InternArticleController {
return "intern/listedArticles/id";
}
@PostMapping("/{id}")
public String newEmployee( Model model, @PathVariable String id) {
System.out.println("\n------ POST -----\n");
int articleid = Integer.parseInt(id);
ListedArticlesListIdTotal total = new ListedArticlesListIdTotal();
total.addArticle(articleRepository.findArticleById(articleid),
warehouseEntryRepository.getArticleStock(articleid).orElse(0));
model.addAttribute("ArticleID", total);
return "intern/listedArticles/id";
}
public static class ListedArticlesListTotals {

View File

@ -13,11 +13,7 @@
<ul>
<li><a th:href="@{/intern/}">Dashboard</a>
</li>
<li><a th:href="@{/intern/listedArticles/}">Gelistete Artikel</a>
<ul>
<li><a th:href="@{/intern/articles/}">Händlerangebote</a>
</li>
</ul>
<li><a th:href="@{/intern/articles/}">Gelistete Artikel</a>
</li>
<li><a th:href="@{/intern/accounting/}">Alle Buchungen</a>
<ul>
@ -38,7 +34,7 @@
<li><a th:href="@{/intern/suppliers/}">Lieferanten</a>
<ul>
<li><a th:href="@{/intern/supplierOrders/}">Bestellungen</a></li>
<li><a th:href="@{/intern/articles/}">&gt; Händlerangebote</a></li>
<li><a th:href="@{/intern/suppliers/articles/}">&gt; Händlerangebote</a></li>
</ul>
</li>

View File

@ -52,14 +52,14 @@
</thead>
<tbody>
<tr th:each="article : ${ListedArticles}">
<td><img th:src="${article.imgPath}" class="s"/></td>
<td><img th:src="@{/shop/articles/{id}/image.jpg(id=${article.id})}" class="s"/></td>
<td><span th:text="${article.title}"></span></td>
<td><span th:text="${article.price}"></span></td>
<td><span th:text="${article.price_netto}"></span></td>
<td><span th:text="${article.categorie}"></span></td>
<td><span th:text="${article.stock}"></span></td>
<td><a th:href="@{/intern/articles/{id}(id = ${article.offer_id})}" th:text="${article.offer_id}"></a></td>
<td><a th:href="@{/intern/listedArticles/{id}(id = ${article.id})}" th:text="${article.id}"></a></td>
<td><a th:href="@{/intern/suppliers/articles/{id}(id = ${article.offer_id})}" th:text="${article.offer_id}"></a></td>
<td><a th:href="@{/intern/articles/{id}(id = ${article.id})}" th:text="${article.id}"></a></td>
</tr>
</tbody>
</table>