Subversion Repositories SmartDukaan

Rev

Rev 9332 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9332 Rev 9333
Line 107... Line 107...
107
        Client invClient = isc.getClient();
107
        Client invClient = isc.getClient();
108
        in.shop2020.model.v1.catalog.CatalogService.Client catClient = csc.getClient(); 
108
        in.shop2020.model.v1.catalog.CatalogService.Client catClient = csc.getClient(); 
109
        Sheet sheet = wb.getSheetAt(0);
109
        Sheet sheet = wb.getSheetAt(0);
110
        Row firstRow = sheet.getRow(0);
110
        Row firstRow = sheet.getRow(0);
111
        logger.info("Last row number is:" + sheet.getLastRowNum());
111
        logger.info("Last row number is:" + sheet.getLastRowNum());
112
        int successful = 0, failed = 0;
112
        int successful = 0;
113
        for (Row row : sheet) {
113
        for (Row row : sheet) {
114
            if(row.equals(firstRow))
114
            if(row.equals(firstRow))
115
                continue;
115
                continue;
116
            logger.info("Row no. " + row.getRowNum());
116
            logger.info("Row no. " + row.getRowNum());
117
            long itemId = (long)row.getCell(0).getNumericCellValue();
117
            long itemId = (long)row.getCell(0).getNumericCellValue();
Line 134... Line 134...
134
            	pricing.setDealerPrice(dealerPrice);
134
            	pricing.setDealerPrice(dealerPrice);
135
            	pricing.setMop(mop);
135
            	pricing.setMop(mop);
136
            	invClient.addVendorItemPricing(pricing);
136
            	invClient.addVendorItemPricing(pricing);
137
            	successful++;
137
            	successful++;
138
            } catch (Exception e) {
138
            } catch (Exception e) {
139
            	failed++;
-
 
140
            	addActionError(e.getMessage());
139
            	addActionError("Item Id is :" + itemId + " Reason is :" + e.getMessage());
141
			}
140
			}
142
        }
141
        }
143
        addActionMessage("Updated pricing for " + successful + " items");
142
        addActionMessage("Updated pricing for " + successful + " items");
144
        addActionError("Unable to update " + failed + " items and received following errors.");
-
 
145
        return "authsuccess";
143
        return "authsuccess";
146
	}
144
	}
147
 
145
 
148
	public File getPricingFile() {
146
	public File getPricingFile() {
149
        return pricingFile;
147
        return pricingFile;