Subversion Repositories SmartDukaan

Rev

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

Rev 10114 Rev 10156
Line 403... Line 403...
403
		}
403
		}
404
 
404
 
405
		if (t_mpItem.getCurrentSp()< t_mpItem.getMinimumPossibleSp()){
405
		if (t_mpItem.getCurrentSp()< t_mpItem.getMinimumPossibleSp()){
406
			sendAlert(t_mpItem.getItemId(),t_mpItem.getCurrentSp(),t_mpItem.getMinimumPossibleSp());
406
			sendAlert(t_mpItem.getItemId(),t_mpItem.getCurrentSp(),t_mpItem.getMinimumPossibleSp());
407
		}
407
		}
-
 
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());
408
		return "flipkart-update-result";
409
		return "flipkart-update-result";
409
	}
410
	}
410
 
411
 
411
 
412
 
412
	public boolean compareParameters(MarketplaceItems mpItem, FlipkartItem flipkartItem, Warehouse warehouse,double weight) throws TException, JSONException, CatalogServiceException{
413
	public boolean compareParameters(MarketplaceItems mpItem, FlipkartItem flipkartItem, Warehouse warehouse,double weight) throws TException, JSONException, CatalogServiceException{
Line 724... Line 725...
724
		File file = new File("/tmp/flipkart-bulk-upload-template.xls");
725
		File file = new File("/tmp/flipkart-bulk-upload-template.xls");
725
		HSSFWorkbook hwb=new HSSFWorkbook();
726
		HSSFWorkbook hwb=new HSSFWorkbook();
726
		HSSFSheet sheet =  hwb.createSheet("Flipkart-Listings");
727
		HSSFSheet sheet =  hwb.createSheet("Flipkart-Listings");
727
		HSSFRow rowhead=   sheet.createRow((short)0);
728
		HSSFRow rowhead=   sheet.createRow((short)0);
728
		rowhead.createCell((short) 0).setCellValue("ITEM-ID");
729
		rowhead.createCell((short) 0).setCellValue("ITEM-ID");
-
 
730
		rowhead.createCell((short) 1).setCellValue("CATEGORY CODE");
729
		rowhead.createCell((short) 1).setCellValue("PRODUCT");
731
		rowhead.createCell((short) 2).setCellValue("PRODUCT");
730
		rowhead.createCell((short) 2).setCellValue("WAREHOUSE-ID");
732
		rowhead.createCell((short) 3).setCellValue("WAREHOUSE-ID");
731
		rowhead.createCell((short) 3).setCellValue("EXCEPTIONAL-PRICE");
733
		rowhead.createCell((short) 4).setCellValue("EXCEPTIONAL-PRICE");
732
		rowhead.createCell((short) 4).setCellValue("FLIPKART-LISTED");
734
		rowhead.createCell((short) 5).setCellValue("FLIPKART-LISTED");
733
		rowhead.createCell((short) 5).setCellValue("TRANSFER-PRICE");
735
		rowhead.createCell((short) 6).setCellValue("TRANSFER-PRICE");
734
		rowhead.createCell((short) 6).setCellValue("SELLING-PRICE");
736
		rowhead.createCell((short) 7).setCellValue("SELLING-PRICE");
735
		rowhead.createCell((short) 7).setCellValue("LOWEST POSSIBLE SP");
737
		rowhead.createCell((short) 8).setCellValue("LOWEST POSSIBLE SP");
736
		rowhead.createCell((short) 8).setCellValue("LOWEST POSSIBLE TP");
738
		rowhead.createCell((short) 9).setCellValue("LOWEST POSSIBLE TP");
737
		rowhead.createCell((short) 9).setCellValue("OTHER COST");
739
		rowhead.createCell((short) 10).setCellValue("OTHER COST");
738
		rowhead.createCell((short) 10).setCellValue("COURIER-COST");
740
		rowhead.createCell((short) 11).setCellValue("COURIER-COST");
-
 
741
		rowhead.createCell((short) 12).setCellValue("COMMISION PERCENTAGE");
739
		rowhead.createCell((short) 11).setCellValue("COMMISION");
742
		rowhead.createCell((short) 13).setCellValue("COMMISION VALUE");
-
 
743
		rowhead.createCell((short) 14).setCellValue("SERVICE TAX RATE");
740
		rowhead.createCell((short) 12).setCellValue("SERVICE-TAX");
744
		rowhead.createCell((short) 15).setCellValue("SERVICE-TAX VALUE");
741
		rowhead.createCell((short) 13).setCellValue("Suppress Inventory Feed");
745
		rowhead.createCell((short) 16).setCellValue("Suppress Inventory Feed");
742
		rowhead.createCell((short) 14).setCellValue("Suppress Price Feed");
746
		rowhead.createCell((short) 17).setCellValue("Suppress Price Feed");
743
		rowhead.createCell((short) 15).setCellValue("AUTO FAVOURITE");
747
		rowhead.createCell((short) 18).setCellValue("AUTO FAVOURITE");
744
		rowhead.createCell((short) 16).setCellValue("MANUAL FAVOURITE");
748
		rowhead.createCell((short) 19).setCellValue("MANUAL FAVOURITE");
745
		rowhead.createCell((short) 17).setCellValue("AUTO INCREMENT");
749
		rowhead.createCell((short) 20).setCellValue("AUTO INCREMENT");
746
		rowhead.createCell((short) 18).setCellValue("AUTO DECREMENT");
750
		rowhead.createCell((short) 21).setCellValue("AUTO DECREMENT");
747
		rowhead.createCell((short) 19).setCellValue("Max NLC");
751
		rowhead.createCell((short) 22).setCellValue("Max NLC");
748
		rowhead.createCell((short) 20).setCellValue("SKU @ Flipkart");
752
		rowhead.createCell((short) 23).setCellValue("SKU @ Flipkart");
749
		rowhead.createCell((short) 21).setCellValue("Flipkart Serial Number");
753
		rowhead.createCell((short) 24).setCellValue("Flipkart Serial Number");
750
		Client catalogClient = null;
754
		Client catalogClient = null;
751
		List<FlipkartItemDetails> flipkartItems = null;
755
		List<FlipkartItemDetails> flipkartItems = null;
752
		try {
756
		try {
753
			catalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
757
			catalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
754
			flipkartItems = catalogClient.getAllFkItems();
758
			flipkartItems = catalogClient.getAllFkItems();
Line 758... Line 762...
758
		int iterator=1;
762
		int iterator=1;
759
		Item item;
763
		Item item;
760
		MarketplaceItems marketplaceItem;
764
		MarketplaceItems marketplaceItem;
761
		for(FlipkartItemDetails fkItem:flipkartItems){
765
		for(FlipkartItemDetails fkItem:flipkartItems){
762
			marketplaceItem = catalogClient.getMarketplacedetailsForItem(fkItem.getItem_id(), 8);
766
			marketplaceItem = catalogClient.getMarketplacedetailsForItem(fkItem.getItem_id(), 8);
-
 
767
			MarketplacePercentage mpCosting = catalogClient.getCostingForMarketplace(8, fkItem.getItem_id());
763
			HSSFRow row = sheet.createRow((short)iterator);
768
			HSSFRow row = sheet.createRow((short)iterator);
764
			row.createCell((short) 0).setCellValue(fkItem.getItem_id());
769
			row.createCell((short) 0).setCellValue(fkItem.getItem_id());
-
 
770
			row.createCell((short) 1).setCellValue(fkItem.getCategory());
765
			row.createCell((short) 1).setCellValue(getVaildName(fkItem.getBrand())+" "+getVaildName(fkItem.getModel_name())+" "+getVaildName(fkItem.getModel_number())+" "+getVaildName(fkItem.getColor()));
771
			row.createCell((short) 2).setCellValue(getVaildName(fkItem.getBrand())+" "+getVaildName(fkItem.getModel_name())+" "+getVaildName(fkItem.getModel_number())+" "+getVaildName(fkItem.getColor()));
766
			row.createCell((short) 2).setCellValue(fkItem.getWarehouseId());
772
			row.createCell((short) 3).setCellValue(fkItem.getWarehouseId());
767
			row.createCell((short) 3).setCellValue(roundTwoDecimals(fkItem.getExceptionPrice()));
773
			row.createCell((short) 4).setCellValue(roundTwoDecimals(fkItem.getExceptionPrice()));
768
			if(fkItem.isIsListedOnFlipkart()){
774
			if(fkItem.isIsListedOnFlipkart()){
769
				row.createCell((short) 4).setCellValue(1);
775
				row.createCell((short) 5).setCellValue(1);
770
			}
776
			}
771
			else{
777
			else{
772
				row.createCell((short) 4).setCellValue(0);
778
				row.createCell((short) 5).setCellValue(0);
773
			}
779
			}
774
			row.createCell((short) 5).setCellValue(roundTwoDecimals(marketplaceItem.getCurrentTp()));
780
			row.createCell((short) 6).setCellValue(roundTwoDecimals(marketplaceItem.getCurrentTp()));
775
			row.createCell((short) 6).setCellValue(roundTwoDecimals(marketplaceItem.getCurrentSp()));
781
			row.createCell((short) 7).setCellValue(roundTwoDecimals(marketplaceItem.getCurrentSp()));
776
			row.createCell((short) 7).setCellValue(roundTwoDecimals(marketplaceItem.getMinimumPossibleSp()));
782
			row.createCell((short) 8).setCellValue(roundTwoDecimals(marketplaceItem.getMinimumPossibleSp()));
777
			row.createCell((short) 8).setCellValue(roundTwoDecimals(marketplaceItem.getMinimumPossibleTp()));
783
			row.createCell((short) 9).setCellValue(roundTwoDecimals(marketplaceItem.getMinimumPossibleTp()));
778
			row.createCell((short) 9).setCellValue(roundTwoDecimals(marketplaceItem.getOtherCost()));
784
			row.createCell((short) 10).setCellValue(roundTwoDecimals(marketplaceItem.getOtherCost()));
779
			row.createCell((short) 10).setCellValue(marketplaceItem.getCourierCost());
785
			row.createCell((short) 11).setCellValue(marketplaceItem.getCourierCost());
-
 
786
			row.createCell((short) 12).setCellValue(roundTwoDecimals(mpCosting.getCommission()));
780
			row.createCell((short) 11).setCellValue(roundTwoDecimals(fkItem.getCommission()));
787
			row.createCell((short) 13).setCellValue(roundTwoDecimals(fkItem.getCommission()));
-
 
788
			row.createCell((short) 14).setCellValue(roundTwoDecimals(mpCosting.getServiceTax()));
781
			row.createCell((short) 12).setCellValue(roundTwoDecimals(fkItem.getServiceTax()));
789
			row.createCell((short) 15).setCellValue(roundTwoDecimals(fkItem.getServiceTax()));
782
			if(fkItem.isSuppressInventoryFeed()){
790
			if(fkItem.isSuppressInventoryFeed()){
783
				row.createCell((short) 13).setCellValue(1);
791
				row.createCell((short) 16).setCellValue(1);
784
			}
792
			}
785
			else{
793
			else{
786
				row.createCell((short) 13).setCellValue(0);
794
				row.createCell((short) 16).setCellValue(0);
787
			}
795
			}
788
			if(fkItem.isSuppressPriceFeed()){
796
			if(fkItem.isSuppressPriceFeed()){
789
				row.createCell((short) 14).setCellValue(1);
797
				row.createCell((short) 17).setCellValue(1);
790
			}
798
			}
791
			else{
799
			else{
792
				row.createCell((short) 14).setCellValue(0);
800
				row.createCell((short) 17).setCellValue(0);
793
			}
801
			}
794
			if(marketplaceItem.isAutoFavourite()){
802
			if(marketplaceItem.isAutoFavourite()){
795
				row.createCell((short) 15).setCellValue(1);
803
				row.createCell((short) 18).setCellValue(1);
796
			}
804
			}
797
			else{
805
			else{
798
				row.createCell((short) 15).setCellValue(0);
806
				row.createCell((short) 18).setCellValue(0);
799
			}
807
			}
800
			if(marketplaceItem.isManualFavourite()){
808
			if(marketplaceItem.isManualFavourite()){
801
				row.createCell((short) 16).setCellValue(1);
809
				row.createCell((short) 19).setCellValue(1);
802
			}
810
			}
803
			else{
811
			else{
804
				row.createCell((short) 16).setCellValue(0);
812
				row.createCell((short) 19).setCellValue(0);
805
			}
813
			}
806
			if(marketplaceItem.isAutoIncrement()){
814
			if(marketplaceItem.isAutoIncrement()){
807
				row.createCell((short) 17).setCellValue(1);
815
				row.createCell((short) 20).setCellValue(1);
808
			}
816
			}
809
			else{
817
			else{
810
				row.createCell((short) 17).setCellValue(0);
818
				row.createCell((short) 20).setCellValue(0);
811
			}
819
			}
812
			if(marketplaceItem.isAutoDecrement()){
820
			if(marketplaceItem.isAutoDecrement()){
813
				row.createCell((short) 18).setCellValue(1);
821
				row.createCell((short) 21).setCellValue(1);
814
			}
822
			}
815
			else{
823
			else{
816
				row.createCell((short) 18).setCellValue(0);
824
				row.createCell((short) 21).setCellValue(0);
817
			}
825
			}
818
			row.createCell((short) 19).setCellValue(fkItem.getMaxNlc());
826
			row.createCell((short) 22).setCellValue(fkItem.getMaxNlc());
819
			row.createCell((short) 20).setCellValue(fkItem.getSkuAtFlipkart());
827
			row.createCell((short) 23).setCellValue(fkItem.getSkuAtFlipkart());
820
			row.createCell((short) 21).setCellValue(fkItem.getFlipkartSerialNumber());
828
			row.createCell((short) 24).setCellValue(fkItem.getFlipkartSerialNumber());
821
			iterator++;
829
			iterator++;
822
		}
830
		}
823
 
831
 
824
		FileOutputStream fileOut = null;
832
		FileOutputStream fileOut = null;
825
		try {
833
		try {