Subversion Repositories SmartDukaan

Rev

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

Rev 10186 Rev 10268
Line 12... Line 12...
12
import in.shop2020.model.v1.inventory.ItemInventory;
12
import in.shop2020.model.v1.inventory.ItemInventory;
13
import in.shop2020.model.v1.inventory.OOSStatus;
13
import in.shop2020.model.v1.inventory.OOSStatus;
14
import in.shop2020.model.v1.inventory.Warehouse;
14
import in.shop2020.model.v1.inventory.Warehouse;
15
import in.shop2020.model.v1.inventory.WarehouseType;
15
import in.shop2020.model.v1.inventory.WarehouseType;
16
import in.shop2020.support.utils.ReportsUtils;
16
import in.shop2020.support.utils.ReportsUtils;
-
 
17
import in.shop2020.support.utils.UpdateFlipkartPricing;
-
 
18
import in.shop2020.support.utils.UpdateSDPricingUsingPanel;
17
import in.shop2020.thrift.clients.CatalogClient;
19
import in.shop2020.thrift.clients.CatalogClient;
18
import in.shop2020.thrift.clients.InventoryClient;
20
import in.shop2020.thrift.clients.InventoryClient;
19
import in.shop2020.thrift.clients.TransactionClient;
21
import in.shop2020.thrift.clients.TransactionClient;
20
import in.shop2020.utils.GmailUtils;
22
import in.shop2020.utils.GmailUtils;
21
import javax.mail.MessagingException;
23
import javax.mail.MessagingException;
Line 361... Line 363...
361
		MarketplacePercentage mpCosting = catalogClient.getCostingForMarketplace(8, Long.valueOf(itemId));
363
		MarketplacePercentage mpCosting = catalogClient.getCostingForMarketplace(8, Long.valueOf(itemId));
362
		if (mpCosting.getSource()==0){
364
		if (mpCosting.getSource()==0){
363
			throw new CatalogServiceException();
365
			throw new CatalogServiceException();
364
		}
366
		}
365
		MarketplaceItems mpItem = catalogClient.getMarketplacedetailsForItem(Long.valueOf(itemId),8);
367
		MarketplaceItems mpItem = catalogClient.getMarketplacedetailsForItem(Long.valueOf(itemId),8);
-
 
368
		double oldPrice = mpItem.getCurrentSp();
366
		mpItem.setEmiFee(mpCosting.getEmiFee());
369
		mpItem.setEmiFee(mpCosting.getEmiFee());
367
		mpItem.setReturnProvision(mpCosting.getReturnProvision());
370
		mpItem.setReturnProvision(mpCosting.getReturnProvision());
368
		mpItem.setClosingFee(mpCosting.getClosingFee());
371
		mpItem.setClosingFee(mpCosting.getClosingFee());
369
		mpItem.setServiceTax(mpCosting.getServiceTax());
372
		mpItem.setServiceTax(mpCosting.getServiceTax());
370
		mpItem.setCommission(mpCosting.getCommission());
373
		mpItem.setCommission(mpCosting.getCommission());
Line 395... Line 398...
395
			return "flipkart-update-result";
398
			return "flipkart-update-result";
396
		}
399
		}
397
		else{
400
		else{
398
			setComparsionResult("1");
401
			setComparsionResult("1");
399
		}
402
		}
400
 
-
 
-
 
403
		Long timestamp = System.currentTimeMillis();
401
		if(!catalogClient.addOrUpdateFlipkartItem(flipkartItem)){
404
		if(!catalogClient.addOrUpdateFlipkartItem(flipkartItem)){
402
			throw new CatalogServiceException();
405
			throw new CatalogServiceException();
403
		}
406
		}
404
 
407
 
405
		if (t_mpItem.getCurrentSp()< t_mpItem.getMinimumPossibleSp()){
408
		if (t_mpItem.getCurrentSp()< t_mpItem.getMinimumPossibleSp()){
406
			sendAlert(t_mpItem.getItemId(),t_mpItem.getCurrentSp(),t_mpItem.getMinimumPossibleSp());
409
			sendAlert(t_mpItem.getItemId(),t_mpItem.getCurrentSp(),t_mpItem.getMinimumPossibleSp());
407
		}
410
		}
408
		logger.info("\nUpdate Method Item Id "+itemId+"\nSelling Price "+sellingPrice+"\nWarehouse Id "+warehouseId+"\nMax Nlc "+maxNlc+"\nUpdated By: "+session.getAttribute(ReportsUtils.USER_NAME).toString());
411
		logger.info("\nUpdate Method Item Id "+itemId+"\nSelling Price "+sellingPrice+"\nWarehouse Id "+warehouseId+"\nMax Nlc "+maxNlc+"\nUpdated By: "+session.getAttribute(ReportsUtils.USER_NAME).toString());
-
 
412
		if(oldPrice != t_mpItem.getCurrentSp() && Boolean.valueOf(isListedOnFlipkart) && Boolean.valueOf(isSuppressInventoryFeed)){
-
 
413
			UpdateFlipkartPricing updateFlipkartPricing = new UpdateFlipkartPricing(Float.valueOf(sellingPrice),fkItemCode,item,timestamp);
-
 
414
			updateFlipkartPricing.start();
-
 
415
		}
409
		return "flipkart-update-result";
416
		return "flipkart-update-result";
410
	}
417
	}
411
 
418
 
412
 
419
 
413
	public boolean compareParameters(MarketplaceItems mpItem, FlipkartItem flipkartItem, Warehouse warehouse,double weight) throws TException, JSONException, CatalogServiceException{
420
	public boolean compareParameters(MarketplaceItems mpItem, FlipkartItem flipkartItem, Warehouse warehouse,double weight) throws TException, JSONException, CatalogServiceException{
Line 605... Line 612...
605
		}
612
		}
606
		else{
613
		else{
607
			setComparsionResult("1");
614
			setComparsionResult("1");
608
		}
615
		}
609
		flipkartItem.setMarketplaceItems(t_mpItem);
616
		flipkartItem.setMarketplaceItems(t_mpItem);
-
 
617
		Long timestamp = System.currentTimeMillis();
610
		boolean result = catalogClient.addOrUpdateFlipkartItem(flipkartItem);
618
		boolean result = catalogClient.addOrUpdateFlipkartItem(flipkartItem);
611
		if(!result){
619
		if(!result){
612
			throw new CatalogServiceException();
620
			throw new CatalogServiceException();
613
		}
621
		}
614
		if (t_mpItem.getCurrentSp()< t_mpItem.getMinimumPossibleSp()){
622
		if (t_mpItem.getCurrentSp()< t_mpItem.getMinimumPossibleSp()){
615
			sendAlert(t_mpItem.getItemId(),t_mpItem.getCurrentSp(),t_mpItem.getMinimumPossibleSp());
623
			sendAlert(t_mpItem.getItemId(),t_mpItem.getCurrentSp(),t_mpItem.getMinimumPossibleSp());
616
		}
624
		}
-
 
625
		if(Boolean.valueOf(isListedOnFlipkart) && Boolean.valueOf(isSuppressInventoryFeed)){
-
 
626
			UpdateFlipkartPricing updateFlipkartPricing = new UpdateFlipkartPricing(Float.valueOf(sellingPrice),fkItemCode,item,timestamp);
-
 
627
			updateFlipkartPricing.start();
-
 
628
		}
617
		return "flipkart-update-result";
629
		return "flipkart-update-result";
618
	}
630
	}
619
 
631
 
620
 
632
 
621
	public String getAddNewItemForm(){
633
	public String getAddNewItemForm(){