Subversion Repositories SmartDukaan

Rev

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

Rev 10226 Rev 10228
Line 350... Line 350...
350
	public String update() throws NumberFormatException, TException, InventoryServiceException, CatalogServiceException, JSONException{
350
	public String update() throws NumberFormatException, TException, InventoryServiceException, CatalogServiceException, JSONException{
351
		Client catalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
351
		Client catalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
352
		//Client catalogClientProd = new CatalogClient().getClient();
352
		//Client catalogClientProd = new CatalogClient().getClient();
353
		Long timestamp = System.currentTimeMillis();
353
		Long timestamp = System.currentTimeMillis();
354
		SnapdealItem snapdealItem = catalogClient.getSnapdealItem(Long.valueOf(itemId));
354
		SnapdealItem snapdealItem = catalogClient.getSnapdealItem(Long.valueOf(itemId));
-
 
355
		Double oldPrice = snapdealItem.getSellingPrice(); 
355
		Item item = catalogClient.getItem(Long.valueOf(itemId));
356
		Item item = catalogClient.getItem(Long.valueOf(itemId));
356
		MarketplacePercentage mpCosting = catalogClient.getCostingForMarketplace(7, Long.valueOf(itemId));
357
		MarketplacePercentage mpCosting = catalogClient.getCostingForMarketplace(7, Long.valueOf(itemId));
357
		if (mpCosting.getSource()==0){
358
		if (mpCosting.getSource()==0){
358
			throw new CatalogServiceException();
359
			throw new CatalogServiceException();
359
		}
360
		}
Line 402... Line 403...
402
 
403
 
403
		if (t_mpItem.getCurrentSp()< t_mpItem.getMinimumPossibleSp()){
404
		if (t_mpItem.getCurrentSp()< t_mpItem.getMinimumPossibleSp()){
404
			sendAlert(t_mpItem.getItemId(),t_mpItem.getCurrentSp(),t_mpItem.getMinimumPossibleSp());
405
			sendAlert(t_mpItem.getItemId(),t_mpItem.getCurrentSp(),t_mpItem.getMinimumPossibleSp());
405
		}
406
		}
406
		logger.info("\nUpdate Method Item Id "+itemId+"\nSelling Price "+sellingPrice+"\nWarehouse Id "+warehouseId+"\nMax Nlc "+maxNlc+"\nUpdated By: "+session.getAttribute(ReportsUtils.USER_NAME).toString());
407
		logger.info("\nUpdate Method Item Id "+itemId+"\nSelling Price "+sellingPrice+"\nWarehouse Id "+warehouseId+"\nMax Nlc "+maxNlc+"\nUpdated By: "+session.getAttribute(ReportsUtils.USER_NAME).toString());
407
		if(snapdealItem.getSellingPrice()!=Double.valueOf(sellingPrice)){
408
		if(oldPrice!=Double.valueOf(sellingPrice)){
408
			logger.info("Calling Method to update price at snapdeal");
409
			logger.info("Calling Method to update price at snapdeal");
409
			UpdateSDPricingUsingPanel updatePriceOnSnapdeal = new UpdateSDPricingUsingPanel(Float.valueOf(sellingPrice),supc,item,timestamp);
410
			UpdateSDPricingUsingPanel updatePriceOnSnapdeal = new UpdateSDPricingUsingPanel(Float.valueOf(sellingPrice),supc,item,timestamp);
410
			logger.info("Calling Thread to update price at snapdeal");
411
			logger.info("Calling Thread to update price at snapdeal");
411
			updatePriceOnSnapdeal.start();	
412
			updatePriceOnSnapdeal.start();	
412
		}
413
		}