Subversion Repositories SmartDukaan

Rev

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

Rev 33172 Rev 33173
Line 40... Line 40...
40
    TagListingRepository tagListingRepository;
40
    TagListingRepository tagListingRepository;
41
    @Autowired
41
    @Autowired
42
    WalletService walletService;
42
    WalletService walletService;
43
    @Autowired
43
    @Autowired
44
    UserRepository userRepository;
44
    UserRepository userRepository;
45
    @Autowired
-
 
46
    ExcelUtils excelUtils;
-
 
47
 
45
 
48
    public void parseBulkOrders(MultipartFile file) throws Exception {
46
    public void parseBulkOrders(MultipartFile file) throws Exception {
49
        XSSFWorkbook myWorkBook = new XSSFWorkbook(file.getInputStream());
47
        XSSFWorkbook myWorkBook = new XSSFWorkbook(file.getInputStream());
50
 
48
 
51
        myWorkBook.setMissingCellPolicy(Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
49
        myWorkBook.setMissingCellPolicy(Row.MissingCellPolicy.RETURN_BLANK_AS_NULL);
Line 113... Line 111...
113
            bulkOrderModel.setItemId((int) row.getCell(i++).getNumericCellValue());
111
            bulkOrderModel.setItemId((int) row.getCell(i++).getNumericCellValue());
114
            bulkOrderModel.setQuantity((int) row.getCell(i++).getNumericCellValue());
112
            bulkOrderModel.setQuantity((int) row.getCell(i++).getNumericCellValue());
115
        } catch (Throwable e) {
113
        } catch (Throwable e) {
116
            LOGGER.info(e.getCause());
114
            LOGGER.info(e.getCause());
117
            throw new ProfitMandiBusinessException("Field", "Field at row - " + row.getRowNum() + ", column - " + (i - 1),
115
            throw new ProfitMandiBusinessException("Field", "Field at row - " + row.getRowNum() + ", column - " + (i - 1),
118
                    "Invalid field value at - " + excelUtils.toAlphabet(i - 1) + (row.getRowNum() + 1) + ", " + excelUtils.getCellValue(row.getCell(i - 1)));
116
                    "Invalid field value at - " + ExcelUtils.toAlphabet(i - 1) + (row.getRowNum() + 1) + ", " + ExcelUtils.getCellValue(row.getCell(i - 1)));
119
        }
117
        }
120
        LOGGER.info(bulkOrderModel);
118
        LOGGER.info(bulkOrderModel);
121
        return bulkOrderModel;
119
        return bulkOrderModel;
122
    }
120
    }
123
 
121