Subversion Repositories SmartDukaan

Rev

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

Rev 9864 Rev 9865
Line 83... Line 83...
83
	static{
83
	static{
84
		sdf = new java.text.SimpleDateFormat("yyyy-MM-dd-HH:mm:ss");
84
		sdf = new java.text.SimpleDateFormat("yyyy-MM-dd-HH:mm:ss");
85
		emailFromAddress = "build@shop2020.in";
85
		emailFromAddress = "build@shop2020.in";
86
		password = "cafe@nes";
86
		password = "cafe@nes";
87
		mailer = new GmailUtils();
87
		mailer = new GmailUtils();
88
		//sendTo = new String[]{"vikram.raghav@shop2020.in"};
88
		sendTo = new String[]{"vikram.raghav@shop2020.in"};
89
		sendTo = new String[]{ "sandeep.sachdeva@shop2020.in", "vikram.raghav@shop2020.in", "rajneesh.arora@shop2020.in",
89
		/*sendTo = new String[]{ "sandeep.sachdeva@shop2020.in", "vikram.raghav@shop2020.in", "rajneesh.arora@shop2020.in",
90
				"khushal.bhatia@shop2020.in","manoj.kumar@saholic.com","chaitnaya.vats@saholic.com",
90
				"khushal.bhatia@shop2020.in","manoj.kumar@saholic.com","chaitnaya.vats@saholic.com",
91
				"yukti.jain@shop2020.in","manisha.sharma@shop2020.in","chandan.kumar@shop2020.in","ankush.dhingra@shop2020.in","amar.kumar@shop2020.in"};
91
				"yukti.jain@shop2020.in","manisha.sharma@shop2020.in","chandan.kumar@shop2020.in","ankush.dhingra@shop2020.in","amar.kumar@shop2020.in"};
92
		itemIdpendingOrdersMap = new HashMap<Long,Long>();
92
		*/itemIdpendingOrdersMap = new HashMap<Long,Long>();
93
		CatalogClient catalogServiceClient = null;
93
		CatalogClient catalogServiceClient = null;
94
		try {
94
		try {
95
			catalogServiceClient = new CatalogClient();
95
			catalogServiceClient = new CatalogClient();
96
		} catch (TTransportException e1) {
96
		} catch (TTransportException e1) {
97
			// TODO Auto-generated catch block
97
			// TODO Auto-generated catch block
Line 718... Line 718...
718
			catalogServiceClient = new CatalogClient().getClient();
718
			catalogServiceClient = new CatalogClient().getClient();
719
		} catch (TTransportException e) {
719
		} catch (TTransportException e) {
720
			// TODO Auto-generated catch block
720
			// TODO Auto-generated catch block
721
			e.printStackTrace();
721
			e.printStackTrace();
722
		}
722
		}
723
		Client inventoryClient = new InventoryClient().getClient();
-
 
724
		FileInputStream fis = new FileInputStream("/root/code/trunk/SnapDealFeeds/SellerInventory.xls");
723
		FileInputStream fis = new FileInputStream("/root/code/trunk/SnapDealFeeds/SellerInventory.xls");
725
		Workbook hwb = new HSSFWorkbook(fis);
724
		Workbook hwb = new HSSFWorkbook(fis);
726
		Sheet sheet = hwb.getSheetAt(0);
725
		Sheet sheet = hwb.getSheetAt(0);
727
		Row row;
726
		Row row;
728
		int iterator=1;
727
		int iterator=1;
Line 861... Line 860...
861
		}
860
		}
862
		if(iterator > 1){
861
		if(iterator > 1){
863
			FileOutputStream fileOut = null;
862
			FileOutputStream fileOut = null;
864
			fis.close();
863
			fis.close();
865
			try {
864
			try {
866
				//System.out.println("Before writing file ");
865
				System.out.println("Before writing file ");
867
				fileOut = new FileOutputStream(SNAPDEAL_INVENTORY_SHEET);
866
				fileOut = new FileOutputStream(SNAPDEAL_INVENTORY_SHEET);
868
			} catch (FileNotFoundException e) {
867
			} catch (FileNotFoundException e) {
869
				// TODO Auto-generated catch block
868
				// TODO Auto-generated catch block
870
				e.printStackTrace();
869
				e.printStackTrace();
871
			}
870
			}
Line 880... Line 879...
880
			File file = new File(SNAPDEAL_INVENTORY_SHEET);
879
			File file = new File(SNAPDEAL_INVENTORY_SHEET);
881
			MultipartEntity mpEntity = new MultipartEntity();
880
			MultipartEntity mpEntity = new MultipartEntity();
882
			ContentBody cbFile = new FileBody(file,"application/vnd.ms-excel");
881
			ContentBody cbFile = new FileBody(file,"application/vnd.ms-excel");
883
			mpEntity.addPart("file", cbFile);
882
			mpEntity.addPart("file", cbFile);
884
			post.setEntity(mpEntity);
883
			post.setEntity(mpEntity);
-
 
884
			System.out.println("Before posting file");
885
			HttpResponse response = client.execute(post);
885
			HttpResponse response = client.execute(post);
886
			BufferedReader rd = null;
886
			BufferedReader rd = null;
887
			try {
887
			try {
888
				rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
888
				rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
889
			} catch (IllegalStateException e1) {
889
			} catch (IllegalStateException e1) {
Line 902... Line 902...
902
				}
902
				}
903
			} catch (IOException e) {
903
			} catch (IOException e) {
904
				// TODO Auto-generated catch block
904
				// TODO Auto-generated catch block
905
				e.printStackTrace();
905
				e.printStackTrace();
906
			}
906
			}
-
 
907
			System.out.println("posting response" + feedresponse);
907
			in.shop2020.model.v1.order.TransactionService.Client transactionClient = null;
908
			in.shop2020.model.v1.order.TransactionService.Client transactionClient = null;
908
			long lastSentInventoryTime = System.currentTimeMillis();
909
			long lastSentInventoryTime = System.currentTimeMillis();
909
			try {
910
			try {
910
				transactionClient = new TransactionClient("support_transaction_service_server_host","transaction_service_server_port").getClient();
911
				transactionClient = new TransactionClient("support_transaction_service_server_host","transaction_service_server_port").getClient();
911
				transactionClient.updateSourceDetailTimestamp(7, lastSentInventoryTime);
912
				transactionClient.updateSourceDetailTimestamp(7, lastSentInventoryTime);