| Line 25... |
Line 25... |
| 25 |
|
25 |
|
| 26 |
public class ProductLabelGenerator{
|
26 |
public class ProductLabelGenerator{
|
| 27 |
private static Logger logger = LoggerFactory
|
27 |
private static Logger logger = LoggerFactory
|
| 28 |
.getLogger(ProductLabelGenerator.class);
|
28 |
.getLogger(ProductLabelGenerator.class);
|
| 29 |
|
29 |
|
| 30 |
public static ByteArrayOutputStream generatePdfLabelSheet(String itemId, String itemNumber) throws IOException{
|
30 |
public static String generatePdfLabelSheet(String itemId, String itemNumber) throws IOException{
|
| 31 |
ByteArrayOutputStream baosPDF = null;
|
31 |
ByteArrayOutputStream baosPDF = null;
|
| 32 |
try {
|
32 |
try {
|
| 33 |
CatalogClient cClient = new CatalogClient();
|
33 |
CatalogClient cClient = new CatalogClient();
|
| 34 |
in.shop2020.model.v1.catalog.CatalogService.Client catalogClient = cClient.getClient();
|
34 |
in.shop2020.model.v1.catalog.CatalogService.Client catalogClient = cClient.getClient();
|
| 35 |
Item item = catalogClient.getItem(Long.parseLong(itemId));
|
35 |
Item item = catalogClient.getItem(Long.parseLong(itemId));
|
| Line 97... |
Line 97... |
| 97 |
String tmpDir = System.getProperty("java.io.tmpdir");
|
97 |
String tmpDir = System.getProperty("java.io.tmpdir");
|
| 98 |
String filename = tmpDir + "/item-" + itemId +"-" +System.currentTimeMillis() + ".pdf";
|
98 |
String filename = tmpDir + "/item-" + itemId +"-" +System.currentTimeMillis() + ".pdf";
|
| 99 |
File f = new File(filename);
|
99 |
File f = new File(filename);
|
| 100 |
FileOutputStream fos = new FileOutputStream(f);
|
100 |
FileOutputStream fos = new FileOutputStream(f);
|
| 101 |
baosPDF.writeTo(fos);
|
101 |
baosPDF.writeTo(fos);
|
| 102 |
return baosPDF;
|
102 |
return filename;
|
| 103 |
}
|
103 |
}
|
| 104 |
/*
|
104 |
/*
|
| 105 |
public static void main(String[] args) throws IOException{
|
105 |
public static void main(String[] args) throws IOException{
|
| 106 |
ByteArrayOutputStream baosPDF = null;
|
106 |
ByteArrayOutputStream baosPDF = null;
|
| 107 |
long itemId = 18267L;
|
107 |
long itemId = 18267L;
|