2020-04-29 22:44:16 +02:00
package org.hso.ecommerce.controller.intern.suppliers ;
2020-04-28 22:41:29 +02:00
2020-05-16 22:48:20 +02:00
import java.util.ArrayList ;
import java.util.List ;
2020-04-28 22:41:29 +02:00
import org.springframework.stereotype.Controller ;
2020-05-15 11:57:20 +02:00
import org.springframework.ui.Model ;
import org.springframework.web.bind.annotation.GetMapping ;
2020-05-16 22:48:40 +02:00
import org.springframework.web.bind.annotation.PathVariable ;
2020-05-15 11:57:20 +02:00
import org.springframework.web.bind.annotation.RequestMapping ;
2020-05-16 22:48:40 +02:00
import org.springframework.web.bind.annotation.RequestParam ;
2020-04-28 22:41:29 +02:00
@Controller
2020-05-15 14:14:29 +02:00
@RequestMapping ( " /intern/ " )
2020-05-01 10:48:12 +02:00
public class SupplierOfferController {
2020-05-15 14:14:29 +02:00
2020-05-15 20:57:56 +02:00
@GetMapping ( " supplierOffers " )
public String internListedArticles ( Model model ) {
2020-05-15 14:14:29 +02:00
2020-05-16 22:48:20 +02:00
List < UImodelOfferedArticle > totals = new ArrayList < UImodelOfferedArticle > ( ) ;
/ *
* for ( Article article : articleRepository . findAll ( ) ) { UImodelArticles tmp =
* new UImodelArticles ( ) ; tmp . addListedArticle ( article ,
* warehouseEntryRepository . getArticleStock ( article . id ) . orElse ( 0 ) ) ;
* totals . add ( tmp ) ; }
* /
UImodelOfferedArticle tmp01 = new UImodelOfferedArticle ( ) ;
UImodelOfferedArticle tmp02 = new UImodelOfferedArticle ( ) ;
UImodelOfferedArticle tmp03 = new UImodelOfferedArticle ( ) ;
tmp01 . addData ( " Title01 " , " manufacturer01 " , " articlenumber01 " , " supplierName01 " , 4884 , " 42,42 € " , " ads01 " , 5 ) ;
tmp02 . addData ( " Title02 " , " manufacturer02 " , " articlenumber02 " , " supplierName02 " , 4884 , " 42,42 € " , " ads02 " , 6 ) ;
tmp03 . addData ( " Title03 " , " manufacturer03 " , " articlenumber03 " , " supplierName03 " , 4884 , " 42,42 € " , " ads03 " , 7 ) ;
totals . add ( tmp01 ) ;
totals . add ( tmp02 ) ;
totals . add ( tmp03 ) ;
model . addAttribute ( " OfferedArticles " , totals ) ;
2020-05-15 11:57:20 +02:00
return " intern/offeredArticles/index " ;
2020-05-16 22:48:20 +02:00
}
public class UImodelOfferedArticle {
String title ;
String manufacturer ;
String articlenumber ;
String supplierName ;
int supplierId ;
String price ;
String ads ;
int listedArticleId ;
public String getTitle ( ) {
return title ;
}
public void setTitle ( String title ) {
this . title = title ;
}
public String getManufacturer ( ) {
return manufacturer ;
}
public void setManufacturer ( String manufacturer ) {
this . manufacturer = manufacturer ;
}
public String getArticlenumber ( ) {
return articlenumber ;
}
public void setArticlenumber ( String articlenumber ) {
this . articlenumber = articlenumber ;
}
public String getSupplierName ( ) {
return supplierName ;
}
public void setSupplierName ( String supplierName ) {
this . supplierName = supplierName ;
}
public int getSupplierId ( ) {
return supplierId ;
}
public void setSupplierId ( int supplierId ) {
this . supplierId = supplierId ;
}
public String getPrice ( ) {
return price ;
}
public void setPrice ( String price ) {
this . price = price ;
}
public String getAds ( ) {
return ads ;
}
public void setAds ( String ads ) {
this . ads = ads ;
}
public int getListedArticleId ( ) {
return listedArticleId ;
}
public void setListedArticleId ( int listedArticleId ) {
this . listedArticleId = listedArticleId ;
}
public void addData ( String title , String manufacturer , String articlenumber , String supplierName ,
int supplierId , String price , String ads , int listedArticleId ) {
this . title = title ;
this . manufacturer = manufacturer ;
this . articlenumber = articlenumber ;
this . supplierName = supplierName ;
this . supplierId = supplierId ;
this . price = price ;
this . ads = ads ;
this . listedArticleId = listedArticleId ;
}
2020-05-15 14:14:29 +02:00
2020-05-15 11:57:20 +02:00
}
2020-05-15 14:14:29 +02:00
2020-04-28 22:41:29 +02:00
}