Subversion Repositories SmartDukaan

Rev

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

Rev 10053 Rev 10058
Line 56... Line 56...
56
		String[] sendTo = new String[]{"vikram.raghav@shop2020.in"};
56
		String[] sendTo = new String[]{"vikram.raghav@shop2020.in"};
57
		/*String[] sendTo = new String[]{ "sandeep.sachdeva@shop2020.in", "vikram.raghav@shop2020.in", "rajneesh.arora@shop2020.in",
57
		/*String[] sendTo = new String[]{ "sandeep.sachdeva@shop2020.in", "vikram.raghav@shop2020.in", "rajneesh.arora@shop2020.in",
58
				"khushal.bhatia@shop2020.in","manoj.kumar@saholic.com","chaitnaya.vats@saholic.com",
58
				"khushal.bhatia@shop2020.in","manoj.kumar@saholic.com","chaitnaya.vats@saholic.com",
59
				"yukti.jain@shop2020.in","manoj.pal@shop2020.in","chandan.kumar@shop2020.in","ankush.dhingra@shop2020.in","amar.kumar@shop2020.in"};
59
				"yukti.jain@shop2020.in","manoj.pal@shop2020.in","chandan.kumar@shop2020.in","ankush.dhingra@shop2020.in","amar.kumar@shop2020.in"};
60
		*/
60
		*/
61
		Map<Long,Long> itemInventoryMap = FetchInventoryAtFlipkart();
61
		Map<String,Long> itemInventoryMap = FetchInventoryAtFlipkart();
62
		in.shop2020.model.v1.catalog.CatalogService.Client catalogClient = new CatalogClient().getClient();
62
		in.shop2020.model.v1.catalog.CatalogService.Client catalogClient = new CatalogClient().getClient();
63
		List<FlipkartItem> flipkartItems = catalogClient.getAllFlipkartItems();
63
		List<FlipkartItem> flipkartItems = catalogClient.getAllFlipkartItems();
64
		List<Item> aliveItems;
64
		List<Item> aliveItems;
65
		try{
65
		try{
66
			aliveItems = catalogClient.getAllAliveItems();
66
			aliveItems = catalogClient.getAllAliveItems();
Line 131... Line 131...
131
			mailer.sendSSLMessage(sendTo,"Flipkart Inventory Reconcillation ", emailFromAddress, password, text);
131
			mailer.sendSSLMessage(sendTo,"Flipkart Inventory Reconcillation ", emailFromAddress, password, text);
132
		} catch (MessagingException e) {
132
		} catch (MessagingException e) {
133
			e.printStackTrace();
133
			e.printStackTrace();
134
		}
134
		}
135
	}
135
	}
136
	public static Map<Long, Long> FetchInventoryAtFlipkart() throws ClientProtocolException, IOException{
136
	public static Map<String, Long> FetchInventoryAtFlipkart() throws ClientProtocolException, IOException{
137
		Map<Long,Long> itemInventoryMap = new HashMap<Long,Long>();
137
		Map<String,Long> itemInventoryMap = new HashMap<String,Long>();
138
		HttpClient client = new DefaultHttpClient();
138
		HttpClient client = new DefaultHttpClient();
139
		HttpPost post = new HttpPost("https://seller.flipkart.com/login");
139
		HttpPost post = new HttpPost("https://seller.flipkart.com/login");
140
		BufferedReader rd= null;
140
		BufferedReader rd= null;
141
		List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
141
		List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
142
		nameValuePairs.add(new BasicNameValuePair("authName",
142
		nameValuePairs.add(new BasicNameValuePair("authName",
Line 164... Line 164...
164
				continue;
164
				continue;
165
			row.getCell(6).setCellType(Cell.CELL_TYPE_STRING);
165
			row.getCell(6).setCellType(Cell.CELL_TYPE_STRING);
166
			row.getCell(15).setCellType(Cell.CELL_TYPE_STRING);
166
			row.getCell(15).setCellType(Cell.CELL_TYPE_STRING);
167
			System.out.println("SKU " + row.getCell(6).getStringCellValue() + " " + "Quantity "+ row.getCell(15).getStringCellValue());
167
			System.out.println("SKU " + row.getCell(6).getStringCellValue() + " " + "Quantity "+ row.getCell(15).getStringCellValue());
168
			if(!row.getCell(15).getStringCellValue().equals("")){
168
			if(!row.getCell(15).getStringCellValue().equals("")){
169
				itemInventoryMap.put(Long.parseLong(row.getCell(6).getStringCellValue()), Long.parseLong(row.getCell(15).getStringCellValue()));
169
				itemInventoryMap.put(row.getCell(6).getStringCellValue(), Long.parseLong(row.getCell(15).getStringCellValue()));
170
			}
170
			}
171
			else{
171
			else{
172
				itemInventoryMap.put(Long.parseLong(row.getCell(6).getStringCellValue()),0L);
172
				itemInventoryMap.put(row.getCell(6).getStringCellValue(),0L);
173
			}
173
			}
174
		}
174
		}
175
		return itemInventoryMap;
175
		return itemInventoryMap;
176
	}
176
	}
177
	static String getProductName(Item item){
177
	static String getProductName(Item item){