| Line 77... |
Line 77... |
| 77 |
row.getCell(LISTING_ID_INDEX).setCellType(Cell.CELL_TYPE_STRING);
|
77 |
row.getCell(LISTING_ID_INDEX).setCellType(Cell.CELL_TYPE_STRING);
|
| 78 |
String listingId = row.getCell(LISTING_ID_INDEX).getStringCellValue();
|
78 |
String listingId = row.getCell(LISTING_ID_INDEX).getStringCellValue();
|
| 79 |
Long itemId = new Double(row.getCell(ITEM_ID_INDEX).getNumericCellValue()).longValue();
|
79 |
Long itemId = new Double(row.getCell(ITEM_ID_INDEX).getNumericCellValue()).longValue();
|
| 80 |
String listingName = row.getCell(LISTING_NAME_INDEX).getStringCellValue();
|
80 |
String listingName = row.getCell(LISTING_NAME_INDEX).getStringCellValue();
|
| 81 |
Long price = new Double(row.getCell(PRICE_INDEX).getNumericCellValue()).longValue();
|
81 |
Long price = new Double(row.getCell(PRICE_INDEX).getNumericCellValue()).longValue();
|
| - |
|
82 |
Date expiryDate = null;
|
| - |
|
83 |
try {
|
| 82 |
//TODO Test getDateCellValue
|
84 |
//TODO Test getDateCellValue
|
| 83 |
//row.getCell(EXPIRY_DATE_INDEX).setCellType(Cell.CELL_TYPE_STRING);
|
85 |
//row.getCell(EXPIRY_DATE_INDEX).setCellType(Cell.CELL_TYPE_STRING);
|
| 84 |
//String expiryDateString = row.getCell(EXPIRY_DATE_INDEX).getStringCellValue();
|
86 |
String expiryDateString = row.getCell(EXPIRY_DATE_INDEX).getStringCellValue();
|
| 85 |
//Date expiryDate = sdf.parse(expiryDateString);
|
87 |
expiryDate = sdf.parse(expiryDateString);
|
| - |
|
88 |
} catch (Exception e) {
|
| - |
|
89 |
logger.warn("Error in updating expiry timestamp for Ebay Listing", e);
|
| - |
|
90 |
}
|
| 86 |
Double subsidy = row.getCell(SUBSIDY_INDEX).getNumericCellValue();
|
91 |
Double subsidy = row.getCell(SUBSIDY_INDEX).getNumericCellValue();
|
| 87 |
Cell warehouseCell = row.getCell(DEFAULT_WAREHOUSE_INDEX);
|
92 |
Cell warehouseCell = row.getCell(DEFAULT_WAREHOUSE_INDEX);
|
| 88 |
if(warehouseCell != null && warehouseCell.getCellType() != Cell.CELL_TYPE_BLANK) {
|
93 |
if(warehouseCell != null && warehouseCell.getCellType() != Cell.CELL_TYPE_BLANK) {
|
| 89 |
warehouseId = new Double(row.getCell(DEFAULT_WAREHOUSE_INDEX).getNumericCellValue()).longValue();
|
94 |
warehouseId = new Double(row.getCell(DEFAULT_WAREHOUSE_INDEX).getNumericCellValue()).longValue();
|
| 90 |
} else {
|
95 |
} else {
|
| Line 95... |
Line 100... |
| 95 |
EbayItem ebayItem = new EbayItem();
|
100 |
EbayItem ebayItem = new EbayItem();
|
| 96 |
ebayItem.setEbayListingId(listingId);
|
101 |
ebayItem.setEbayListingId(listingId);
|
| 97 |
ebayItem.setItemId(itemId);
|
102 |
ebayItem.setItemId(itemId);
|
| 98 |
ebayItem.setListingName(listingName);
|
103 |
ebayItem.setListingName(listingName);
|
| 99 |
ebayItem.setListingPrice(price);
|
104 |
ebayItem.setListingPrice(price);
|
| - |
|
105 |
try {
|
| 100 |
//ebayItem.setListingExpiryDate(expiryDate.getTime());
|
106 |
ebayItem.setListingExpiryDate(expiryDate.getTime());
|
| - |
|
107 |
} catch (Exception e) {
|
| - |
|
108 |
logger.warn("Error while setting expiry time for Ebay Listing", e);
|
| - |
|
109 |
}
|
| 101 |
ebayItem.setSubsidy(subsidy);
|
110 |
ebayItem.setSubsidy(subsidy);
|
| 102 |
ebayItem.setDefaultWarehouseId(warehouseId);
|
111 |
ebayItem.setDefaultWarehouseId(warehouseId);
|
| 103 |
catalogClient.addEbayItem(ebayItem);
|
112 |
catalogClient.addEbayItem(ebayItem);
|
| 104 |
|
113 |
|
| 105 |
successfullyProcessedNumRows++;
|
114 |
successfullyProcessedNumRows++;
|