Subversion Repositories SmartDukaan

Rev

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

Rev 8886 Rev 8887
Line 168... Line 168...
168
		File fileToCreate = new File("/tmp/", "Snapdeal-bulk-upload.xls");
168
		File fileToCreate = new File("/tmp/", "Snapdeal-bulk-upload.xls");
169
		FileUtils.copyFile(this.file, fileToCreate);
169
		FileUtils.copyFile(this.file, fileToCreate);
170
		FileInputStream iFile = new FileInputStream(new File(file.getAbsolutePath()));
170
		FileInputStream iFile = new FileInputStream(new File(file.getAbsolutePath()));
171
		HSSFWorkbook workbook = new HSSFWorkbook(iFile);
171
		HSSFWorkbook workbook = new HSSFWorkbook(iFile);
172
		HSSFSheet sheet = workbook.getSheetAt(0);
172
		HSSFSheet sheet = workbook.getSheetAt(0);
173
		Client CatalogClient=null;
173
		Client catalogClient=null;
174
		StringBuilder sb = new StringBuilder();
174
		StringBuilder sb = new StringBuilder();
175
		try {
175
		try {
176
			//CatalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
176
			catalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
177
			CatalogClient = new CatalogClient().getClient();
-
 
178
		} catch (TTransportException e) {
177
		} catch (TTransportException e) {
179
			// TODO Auto-generated catch block
178
			// TODO Auto-generated catch block
180
			e.printStackTrace();
179
			e.printStackTrace();
181
		}
180
		}
182
		for (int iterator=(sheet.getFirstRowNum()+1);iterator<=sheet.getLastRowNum();iterator++){
181
		for (int iterator=(sheet.getFirstRowNum()+1);iterator<=sheet.getLastRowNum();iterator++){
Line 185... Line 184...
185
			if (checkEmptyString(sheet.getRow(iterator).getCell(0))){
184
			if (checkEmptyString(sheet.getRow(iterator).getCell(0))){
186
				continue;
185
				continue;
187
			}
186
			}
188
			else {
187
			else {
189
				sku=(long) sheet.getRow(iterator).getCell(0).getNumericCellValue();
188
				sku=(long) sheet.getRow(iterator).getCell(0).getNumericCellValue();
190
				snapdealItem = CatalogClient.getSnapdealItem(sku);
189
				snapdealItem = catalogClient.getSnapdealItem(sku);
191
				if(snapdealItem.getItem_id()==0){
190
				if(snapdealItem.getItem_id()==0){
192
					snapdealItem = new SnapdealItem();
191
					snapdealItem = new SnapdealItem();
193
					snapdealItem.setItem_id(sku); 
192
					snapdealItem.setItem_id(sku); 
194
				}
193
				}
195
			}
194
			}