Subversion Repositories SmartDukaan

Rev

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

Rev 8544 Rev 9482
Line 7... Line 7...
7
import java.io.FileNotFoundException;
7
import java.io.FileNotFoundException;
8
import java.io.FileOutputStream;
8
import java.io.FileOutputStream;
9
import java.io.FileReader;
9
import java.io.FileReader;
10
import java.io.IOException;
10
import java.io.IOException;
11
import java.io.OutputStream;
11
import java.io.OutputStream;
-
 
12
import java.util.ArrayList;
12
import java.util.Arrays;
13
import java.util.Arrays;
13
import java.util.GregorianCalendar;
14
import java.util.GregorianCalendar;
14
import java.util.List;
15
import java.util.List;
15
import java.util.Map;
16
import java.util.Map;
16
 
17
 
Line 184... Line 185...
184
						// TODO Auto-generated catch block
185
						// TODO Auto-generated catch block
185
						e.printStackTrace();
186
						e.printStackTrace();
186
					}	
187
					}	
187
					//in.shop2020.model.v1.catalog.CatalogService.Client catalogClient   = catalogServiceClient.getClient();
188
					//in.shop2020.model.v1.catalog.CatalogService.Client catalogClient   = catalogServiceClient.getClient();
188
					in.shop2020.model.v1.inventory.InventoryService.Client inventoryClient = inventoryServiceClient.getClient();
189
					in.shop2020.model.v1.inventory.InventoryService.Client inventoryClient = inventoryServiceClient.getClient();
-
 
190
					List<AmazonFbaInventorySnapshot> allamazoninventory = new ArrayList<AmazonFbaInventorySnapshot>();
189
					try {
191
					try {
190
						while ((nextLine = reader.readNext()) != null) {
192
						while ((nextLine = reader.readNext()) != null) {
191
							// nextLine[] is an array of values from the line
193
							// nextLine[] is an array of values from the line
192
							//System.out.println(nextLine[0] +" "+ nextLine[1]+" " + nextLine[2]+" " + nextLine[3] +" "+ nextLine[4] +" " + nextLine[5]);
194
							//System.out.println(nextLine[0] +" "+ nextLine[1]+" " + nextLine[2]+" " + nextLine[3] +" "+ nextLine[4] +" " + nextLine[5]);
193
							if(nextLine[0].startsWith("FBA") && nextLine[4].equalsIgnoreCase("SELLABLE") ){
195
							if(nextLine[0].startsWith("FBA") && nextLine[4].equalsIgnoreCase("SELLABLE") ){
194
								//System.out.println("Item ID" + nextLine[0].replaceAll("FBA","") + "---"+"Inventory" + nextLine[5]);
196
								//System.out.println("Item ID" + nextLine[0].replaceAll("FBA","") + "---"+"Inventory" + nextLine[5]);
195
						//if(catalogClient.getAmazonItemDetails(Long.parseLong(nextLine[0].replaceAll("FBA",""))).getItemid()!=0){
197
						//if(catalogClient.getAmazonItemDetails(Long.parseLong(nextLine[0].replaceAll("FBA",""))).getItemid()!=0){
196
									AmazonFbaInventorySnapshot amazonfbainventorysnapshot = new AmazonFbaInventorySnapshot() ;
198
									AmazonFbaInventorySnapshot amazonfbainventorysnapshot = new AmazonFbaInventorySnapshot() ;
197
									amazonfbainventorysnapshot.setAvailability(Long.parseLong(nextLine[5]));
199
									amazonfbainventorysnapshot.setAvailability(Long.parseLong(nextLine[5]));
198
									amazonfbainventorysnapshot.setItem_id(Long.parseLong(nextLine[0].replaceAll("FBA","")));
200
									amazonfbainventorysnapshot.setItem_id(Long.parseLong(nextLine[0].replaceAll("FBA","")));
199
									inventoryClient.addOrUpdateAmazonFbaInventory(amazonfbainventorysnapshot);
201
									allamazoninventory.add(amazonfbainventorysnapshot); 
-
 
202
 
200
						//		}
203
						//		}
201
							}
204
							}
202
						}
205
						}
-
 
206
						inventoryClient.addOrUpdateAllAmazonFbaInventory(allamazoninventory);
203
					} catch (IOException e) {
207
					} catch (IOException e) {
204
						// TODO Auto-generated catch block
208
						// TODO Auto-generated catch block
205
						e.printStackTrace();
209
						e.printStackTrace();
206
					} catch (TException e) {
210
					} catch (TException e) {
207
						// TODO Auto-generated catch block
211
						// TODO Auto-generated catch block