Subversion Repositories SmartDukaan

Rev

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

Rev 9821 Rev 9824
Line 296... Line 296...
296
				for(Entry<String, Double> entry:updatedSkuMap.entrySet()){
296
				for(Entry<String, Double> entry:updatedSkuMap.entrySet()){
297
					toUpdateSkuMap.remove(entry.getKey());
297
					toUpdateSkuMap.remove(entry.getKey());
298
				}
298
				}
299
				for(Entry<String, Double> entry:toUpdateSkuMap.entrySet()){
299
				for(Entry<String, Double> entry:toUpdateSkuMap.entrySet()){
300
					notUpdatedMailBody.append("<tr>" + "<td>" + currentPricesMap.get(entry.getKey()).getProductName() + "</td>"
300
					notUpdatedMailBody.append("<tr>" + "<td>" + currentPricesMap.get(entry.getKey()).getProductName() + "</td>"
301
					+"<td>" + snapdealItemMap.get(entry.getKey()).getItem_id() + "</td>"
301
							+"<td>" + snapdealItemMap.get(entry.getKey()).getItem_id() + "</td>"
-
 
302
							+"<td>" + snapdealItemMap.get(entry.getKey()).getSkuAtSnapdeal() + "</td>"
302
					+"<td>" + currentPricesMap.get(entry.getKey()).getSellingPrice() + "</td>" 
303
							+"<td>" + currentPricesMap.get(entry.getKey()).getSellingPrice() + "</td>" 
303
					+"<td>" + entry.getValue() +"</td>");
304
							+"<td>" + entry.getValue() +"</td>");
304
					
305
 
305
				}
306
				}
306
				String text = "<html><table border=\"1\" align=\"center\">" 
307
				String text = "<html><table border=\"1\" align=\"center\">" 
307
								+ tableHeader  
308
					+ tableHeader  
308
								+ notUpdatedMailBody.toString() + "</table></html>";
309
					+ notUpdatedMailBody.toString() + "</table></html>";
309
								
310
 
310
				System.out.println("SKUs not updated");
311
				System.out.println("SKUs not updated");
311
				try {
312
				try {
312
					mailer.sendSSLMessage(sendTo,"Snapdeal Item Prices were not updated "+ sdf.format(System.currentTimeMillis()),emailFromAddress, password, text);
313
					mailer.sendSSLMessage(sendTo,"Snapdeal Item Prices were not updated "+ sdf.format(System.currentTimeMillis()),emailFromAddress, password, text);
313
				} catch (MessagingException e) {
314
				} catch (MessagingException e) {
314
					// TODO Auto-generated catch block
315
					// TODO Auto-generated catch block
315
					e.printStackTrace();
316
					e.printStackTrace();
316
				}
317
				}
317
				
318
 
318
			}
319
			}
319
			if(updatedSkuMap.size()>0){
320
			if(updatedSkuMap.size()>0){
320
				StringBuffer updatedMailBody =new StringBuffer();
321
				StringBuffer updatedMailBody =new StringBuffer();
321
				for(Entry<String, Double> entry:updatedSkuMap.entrySet()){
322
				for(Entry<String, Double> entry:updatedSkuMap.entrySet()){
322
					updatedMailBody.append("<tr>" + "<td>" + currentPricesMap.get(entry.getKey()).getProductName() + "</td>"
323
					updatedMailBody.append("<tr>" + "<td>" + currentPricesMap.get(entry.getKey()).getProductName() + "</td>"
323
							+"<td>" + snapdealItemMap.get(entry.getKey()).getItem_id() + "</td>"
324
							+"<td>" + snapdealItemMap.get(entry.getKey()).getItem_id() + "</td>"
-
 
325
							+"<td>" + snapdealItemMap.get(entry.getKey()).getSkuAtSnapdeal() + "</td>"
324
							+"<td>" + currentPricesMap.get(entry.getKey()).getSellingPrice() + "</td>" 
326
							+"<td>" + currentPricesMap.get(entry.getKey()).getSellingPrice() + "</td>" 
325
							+"<td>" + entry.getValue() +"</td>");
327
							+"<td>" + entry.getValue() +"</td>");
-
 
328
					updatedItems.add(snapdealItemMap.get(entry.getKey()).getItem_id());
326
				}
329
				}
327
				try {
330
				try {
328
					catalogClient.updateMarketPlacePriceUpdateStatus(updatedItems,time,7);
331
					catalogClient.updateMarketPlacePriceUpdateStatus(updatedItems,time,7);
329
				} catch (TException e) {
332
				} catch (TException e) {
330
					try {
333
					try {
Line 337... Line 340...
337
					e.printStackTrace();
340
					e.printStackTrace();
338
				}
341
				}
339
				String text = "<html><table border=\"1\" align=\"center\">" 
342
				String text = "<html><table border=\"1\" align=\"center\">" 
340
					+ tableHeader  
343
					+ tableHeader  
341
					+ updatedMailBody.toString() + "</table></html>";
344
					+ updatedMailBody.toString() + "</table></html>";
342
	
345
 
343
				try {
346
				try {
344
					System.out.println("Snapdeal Item Prices updated Successfully");
347
					System.out.println("Snapdeal Item Prices updated Successfully");
345
					if(updatedSkuMap.size()==1){
348
					if(updatedSkuMap.size()==1){
346
						mailer.sendSSLMessage(sendTo,updatedSkuMap.size()+" Snapdeal Item Price updated Successfully "+ sdf.format(System.currentTimeMillis()), emailFromAddress, password,text);
349
						mailer.sendSSLMessage(sendTo,updatedSkuMap.size()+" Snapdeal Item Price updated Successfully "+ sdf.format(System.currentTimeMillis()), emailFromAddress, password,text);
347
					}
350
					}
Line 358... Line 361...
358
				System.out.println("Prices are same as the snapdeal prices");
361
				System.out.println("Prices are same as the snapdeal prices");
359
				mailer.sendSSLMessage(sendTo,"No changes in Snapdeal Item Prices "+ sdf.format(System.currentTimeMillis()),"No change in Snapdeal Prices to be update ", emailFromAddress, password, new ArrayList<File>());
362
				mailer.sendSSLMessage(sendTo,"No changes in Snapdeal Item Prices "+ sdf.format(System.currentTimeMillis()),"No change in Snapdeal Prices to be update ", emailFromAddress, password, new ArrayList<File>());
360
			} catch (MessagingException e) {
363
			} catch (MessagingException e) {
361
				e.printStackTrace();
364
				e.printStackTrace();
362
			}
365
			}
363
		
366
 
364
		}
367
		}
365
 
368
 
366
	}
369
	}
367
 
370
 
368
 
371