| Line 117... |
Line 117... |
| 117 |
itemLoaderModel.setPreferredVendor((int) (row.getCell(i++).getNumericCellValue()));
|
117 |
itemLoaderModel.setPreferredVendor((int) (row.getCell(i++).getNumericCellValue()));
|
| 118 |
itemLoaderModel.setRisky(row.getCell(i++).getNumericCellValue() == 0 ? false : true);
|
118 |
itemLoaderModel.setRisky(row.getCell(i++).getNumericCellValue() == 0 ? false : true);
|
| 119 |
itemLoaderModel.setWeight(row.getCell(i++).getNumericCellValue());
|
119 |
itemLoaderModel.setWeight(row.getCell(i++).getNumericCellValue());
|
| 120 |
itemLoaderModel.setItemType((int) row.getCell(i++).getNumericCellValue());
|
120 |
itemLoaderModel.setItemType((int) row.getCell(i++).getNumericCellValue());
|
| 121 |
itemLoaderModel.setTaxRate(row.getCell(i++).getNumericCellValue() * 100);
|
121 |
itemLoaderModel.setTaxRate(row.getCell(i++).getNumericCellValue() * 100);
|
| - |
|
122 |
// optional trailing column: brand's own SKU/article code
|
| - |
|
123 |
Cell brandIdentifierCell = row.getCell(i++);
|
| - |
|
124 |
if (brandIdentifierCell != null) {
|
| - |
|
125 |
itemLoaderModel.setBrandIdentifier(
|
| - |
|
126 |
StringUtils.normalizeWhitespace(brandIdentifierCell.getStringCellValue()));
|
| - |
|
127 |
}
|
| 122 |
} catch (Throwable e) {
|
128 |
} catch (Throwable e) {
|
| 123 |
LOGGER.info(e.getCause());
|
129 |
LOGGER.info(e.getCause());
|
| 124 |
throw new ProfitMandiBusinessException("Field", "Field at row - " + row.getRowNum() + ", column - " + (i - 1),
|
130 |
throw new ProfitMandiBusinessException("Field", "Field at row - " + row.getRowNum() + ", column - " + (i - 1),
|
| 125 |
"Invalid field value at - " + ExcelUtils.toAlphabet(i - 1) + (row.getRowNum() + 1) + ", " + ExcelUtils.getCellValue(row.getCell(i - 1)));
|
131 |
"Invalid field value at - " + ExcelUtils.toAlphabet(i - 1) + (row.getRowNum() + 1) + ", " + ExcelUtils.getCellValue(row.getCell(i - 1)));
|
| 126 |
}
|
132 |
}
|
| Line 219... |
Line 225... |
| 219 |
item.setStartDate(itemLoaderModel.getStartDate());
|
225 |
item.setStartDate(itemLoaderModel.getStartDate());
|
| 220 |
item.setCategoryId(itemLoaderModel.getCategoryId());
|
226 |
item.setCategoryId(itemLoaderModel.getCategoryId());
|
| 221 |
item.setPreferredVendor(itemLoaderModel.getPreferredVendor());
|
227 |
item.setPreferredVendor(itemLoaderModel.getPreferredVendor());
|
| 222 |
item.setRisky(itemLoaderModel.isRisky());
|
228 |
item.setRisky(itemLoaderModel.isRisky());
|
| 223 |
item.setCatalogItemId(catalog.getId());
|
229 |
item.setCatalogItemId(catalog.getId());
|
| - |
|
230 |
if (itemLoaderModel.getBrandIdentifier() != null && !itemLoaderModel.getBrandIdentifier().isEmpty()) {
|
| - |
|
231 |
item.setBrandIdentifier(itemLoaderModel.getBrandIdentifier());
|
| - |
|
232 |
}
|
| 224 |
if (itemLoaderModel.getWeight() <= 0) {
|
233 |
if (itemLoaderModel.getWeight() <= 0) {
|
| 225 |
throw new ProfitMandiBusinessException("Weight", "0", "Weight should be greater than 0");
|
234 |
throw new ProfitMandiBusinessException("Weight", "0", "Weight should be greater than 0");
|
| 226 |
}
|
235 |
}
|
| 227 |
item.setWeight(itemLoaderModel.getWeight());
|
236 |
item.setWeight(itemLoaderModel.getWeight());
|
| 228 |
item.setStatus(status.PARTIALLY_ACTIVE);
|
237 |
item.setStatus(status.PARTIALLY_ACTIVE);
|