Subversion Repositories SmartDukaan

Rev

Rev 33172 | Rev 33346 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33172 Rev 33173
Line 47... Line 47...
47
    StateGstRateRepository stateGstRateRepository;
47
    StateGstRateRepository stateGstRateRepository;
48
 
48
 
49
    @Autowired
49
    @Autowired
50
    VendorItemPricingRepository vendorItemPricingRepository;
50
    VendorItemPricingRepository vendorItemPricingRepository;
51
 
51
 
52
    @Autowired
-
 
53
    ExcelUtils excelUtils;
-
 
54
 
52
 
55
    private static final Logger LOGGER = LogManager.getLogger(ItemLoaderService.class);
53
    private static final Logger LOGGER = LogManager.getLogger(ItemLoaderService.class);
56
 
54
 
57
    public void parse(MultipartFile file) throws Exception {
55
    public void parse(MultipartFile file) throws Exception {
58
        XSSFWorkbook myWorkBook = new XSSFWorkbook(file.getInputStream());
56
        XSSFWorkbook myWorkBook = new XSSFWorkbook(file.getInputStream());
Line 108... Line 106...
108
            itemLoaderModel.setItemType((int) row.getCell(i++).getNumericCellValue());
106
            itemLoaderModel.setItemType((int) row.getCell(i++).getNumericCellValue());
109
            itemLoaderModel.setTaxRate(row.getCell(i++).getNumericCellValue() * 100);
107
            itemLoaderModel.setTaxRate(row.getCell(i++).getNumericCellValue() * 100);
110
        } catch (Throwable e) {
108
        } catch (Throwable e) {
111
            LOGGER.info(e.getCause());
109
            LOGGER.info(e.getCause());
112
            throw new ProfitMandiBusinessException("Field", "Field at row - " + row.getRowNum() + ", column - " + (i - 1),
110
            throw new ProfitMandiBusinessException("Field", "Field at row - " + row.getRowNum() + ", column - " + (i - 1),
113
                    "Invalid field value at - " + excelUtils.toAlphabet(i - 1) + (row.getRowNum() + 1) + ", " + excelUtils.getCellValue(row.getCell(i - 1)));
111
                    "Invalid field value at - " + ExcelUtils.toAlphabet(i - 1) + (row.getRowNum() + 1) + ", " + ExcelUtils.getCellValue(row.getCell(i - 1)));
114
        }
112
        }
115
        return itemLoaderModel;
113
        return itemLoaderModel;
116
    }
114
    }
117
 
115
 
118
    @Autowired
116
    @Autowired