Subversion Repositories SmartDukaan

Rev

Rev 15032 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15032 Rev 15704
Line 158... Line 158...
158
				///Fetch report only if it is ready
158
				///Fetch report only if it is ready
159
				if(requestIdreportIdmap.get(requestId)!=null){
159
				if(requestIdreportIdmap.get(requestId)!=null){
160
					requestreport.setReportId( requestIdreportIdmap.get(requestId) );
160
					requestreport.setReportId( requestIdreportIdmap.get(requestId) );
161
					OutputStream report=null;
161
					OutputStream report=null;
162
					try {
162
					try {
163
						report = new FileOutputStream( "/home/amazoninventoryreport.csv" );
163
						report = new FileOutputStream( "/tmp/amazoninventoryreport.csv" );
164
					} catch (FileNotFoundException e) {
164
					} catch (FileNotFoundException e) {
165
						// TODO Auto-generated catch block
165
						// TODO Auto-generated catch block
166
						e.printStackTrace();
166
						e.printStackTrace();
167
					}
167
					}
168
					requestreport.setReportOutputStream( report );
168
					requestreport.setReportOutputStream( report );
169
					GetReportSample.invokeGetReport(service, requestreport);
169
					GetReportSample.invokeGetReport(service, requestreport);
170
					//System.out.println("Report ready please check");
170
					//System.out.println("Report ready please check");
171
					BufferedReader reader = null;
171
					BufferedReader reader = null;
172
					try {
172
					try {
173
						reader = new BufferedReader(new FileReader("/home/amazoninventoryreport.csv"));
173
						reader = new BufferedReader(new FileReader("/tmp/amazoninventoryreport.csv"));
174
					} catch (FileNotFoundException e1) {
174
					} catch (FileNotFoundException e1) {
175
						// TODO Auto-generated catch block
175
						// TODO Auto-generated catch block
176
						e1.printStackTrace();
176
						e1.printStackTrace();
177
					}
177
					}
178
					String[] nextLine = null;
178
					String[] nextLine = null;
Line 265... Line 265...
265
                                else{
265
                                else{
266
                                    amazonfbainventorysnapshot.setInbound(0);
266
                                    amazonfbainventorysnapshot.setInbound(0);
267
                                }
267
                                }
268
                                allamazoninventory.add(amazonfbainventorysnapshot); 
268
                                allamazoninventory.add(amazonfbainventorysnapshot); 
269
                            }
269
                            }
-
 
270
							else if(nextLine[0].startsWith("FBD")){
-
 
271
                                AmazonFbaInventorySnapshot amazonfbainventorysnapshot = new AmazonFbaInventorySnapshot() ;
-
 
272
                                if(!nextLine[10].isEmpty())
-
 
273
                                    amazonfbainventorysnapshot.setAvailability(Long.parseLong(nextLine[10]));
-
 
274
                                else{
-
 
275
                                    amazonfbainventorysnapshot.setAvailability(0);
-
 
276
                                }
-
 
277
                                try{
-
 
278
                                amazonfbainventorysnapshot.setItem_id(Long.parseLong(nextLine[0].replaceAll("FBD","")));
-
 
279
                                }
-
 
280
                                catch(Exception e){
-
 
281
                                    continue;
-
 
282
                                }
-
 
283
                                amazonfbainventorysnapshot.setLocation(AmazonFCWarehouseLocation.Delhi);
-
 
284
                                if(nextLine[12].length()>0){
-
 
285
                                    amazonfbainventorysnapshot.setReserved(Long.parseLong(nextLine[12]));
-
 
286
                                }
-
 
287
                                else{
-
 
288
                                    amazonfbainventorysnapshot.setReserved(0);
-
 
289
                                }
-
 
290
                                if(nextLine[11].length()>0){
-
 
291
                                    amazonfbainventorysnapshot.setUnfulfillable(Long.parseLong(nextLine[11]));
-
 
292
                                }
-
 
293
                                else{
-
 
294
                                    amazonfbainventorysnapshot.setUnfulfillable(0);
-
 
295
                                }
-
 
296
                                if(nextLine[16].length()>0){
-
 
297
                                    amazonfbainventorysnapshot.setInbound(Long.parseLong(nextLine[16]));
-
 
298
                                }
-
 
299
                                else{
-
 
300
                                    amazonfbainventorysnapshot.setInbound(0);
-
 
301
                                }
-
 
302
                                allamazoninventory.add(amazonfbainventorysnapshot); 
-
 
303
                            }
-
 
304
						
270
							else{
305
							else{
271
								continue;
306
								continue;
272
							}
307
							}
273
						}
308
						}
274
						try{
309
						try{