Subversion Repositories SmartDukaan

Rev

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

Rev 8453 Rev 8460
Line 59... Line 59...
59
					Date date = istFormatter.parse(nextLine[2]);
59
					Date date = istFormatter.parse(nextLine[2]);
60
					SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
60
					SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
61
					Date date_key = dateFormat.parse(dateFormat.format(date));
61
					Date date_key = dateFormat.parse(dateFormat.format(date));
62
					System.out.println(nextLine[0]+" "+date_key+" "+ nextLine[11] +" " + nextLine[13] + " " + nextLine[14]);
62
					System.out.println(nextLine[0]+" "+date_key+" "+ nextLine[11] +" " + nextLine[13] + " " + nextLine[14]);
63
					Long itemid = Long.parseLong(nextLine[11].replaceAll("FBA",""));
63
					Long itemid = Long.parseLong(nextLine[11].replaceAll("FBA",""));
64
					
64
 
65
					Integer qty = new Integer(nextLine[14]);
65
					Integer qty = new Integer(nextLine[14]);
66
					Float itemSale = null;
66
					Float itemSale = null;
67
					if(nextLine[16].length()!=0){
67
					if(nextLine[16].length()!=0){
68
						itemSale = new Float(nextLine[16]);
68
						itemSale = new Float(nextLine[16]);
69
					}
69
					}
Line 181... Line 181...
181
					Long item_id = Long.parseLong(nextLine[1].replaceAll("FBA",""));
181
					Long item_id = Long.parseLong(nextLine[1].replaceAll("FBA",""));
182
					Double ourPrice = null;
182
					Double ourPrice = null;
183
					Double minFBAPrice= null;
183
					Double minFBAPrice= null;
184
					Double minMFNPrice= null;
184
					Double minMFNPrice= null;
185
					Double salePrice= null; 
185
					Double salePrice= null; 
186
					
186
 
187
					if(nextLine[30].length() >0){
187
					if(nextLine[30].length() >0){
188
						ourPrice = Double.parseDouble(nextLine[30]);
188
						ourPrice = Double.parseDouble(nextLine[30]);
189
						itemIdOurPriceMap.put(item_id,ourPrice);
189
						itemIdOurPriceMap.put(item_id,ourPrice);
190
					}
190
					}
191
					if(nextLine[31].length() >0){
191
					if(nextLine[31].length() >0){
Line 194... Line 194...
194
					}
194
					}
195
					if(nextLine[32].length() >0){
195
					if(nextLine[32].length() >0){
196
						minFBAPrice = Double.parseDouble(nextLine[32]);
196
						minFBAPrice = Double.parseDouble(nextLine[32]);
197
						itemIdminFBAPriceMap.put(item_id,minFBAPrice);
197
						itemIdminFBAPriceMap.put(item_id,minFBAPrice);
198
					}
198
					}
199
					if(nextLine[32].length() >0){
199
					if(nextLine[34].length() >0){
200
						minMFNPrice = Double.parseDouble(nextLine[34]);
200
						minMFNPrice = Double.parseDouble(nextLine[34]);
201
						itemIdminMFNPriceMap.put(item_id,minMFNPrice);
201
						itemIdminMFNPriceMap.put(item_id,minMFNPrice);
202
					}
202
					}
203
				}
203
				}
204
				count++;
204
				count++;
Line 225... Line 225...
225
					amazonfbasalessnapshot.setTotalOrderCount(entry1.getValue().getTotalOrderCount());
225
					amazonfbasalessnapshot.setTotalOrderCount(entry1.getValue().getTotalOrderCount());
226
					amazonfbasalessnapshot.setTotalSale(entry1.getValue().getTotalSale());
226
					amazonfbasalessnapshot.setTotalSale(entry1.getValue().getTotalSale());
227
					amazonfbasalessnapshot.setPromotionSale(entry1.getValue().getTotalPromotionSale());
227
					amazonfbasalessnapshot.setPromotionSale(entry1.getValue().getTotalPromotionSale());
228
					amazonfbasalessnapshot.setIsOutOfStock(oos);
228
					amazonfbasalessnapshot.setIsOutOfStock(oos);
229
					Amazonlisted amazon_item=null;
229
					Amazonlisted amazon_item=null;
230
					if(catalogClient.getAmazonItemDetails(item_id)!=null)
230
					if(catalogClient.getAmazonItemDetails(item_id)!=null){
231
						amazon_item = catalogClient.getAmazonItemDetails(item_id);
231
						amazon_item = catalogClient.getAmazonItemDetails(item_id);
-
 
232
					}
232
					else 
233
					else{ 
233
						continue;
234
						continue;
-
 
235
					}
234
					if(itemIdSalePriceMap.containsKey(item_id) && itemIdSalePriceMap.get(item_id)!=0){
236
					if(itemIdSalePriceMap.containsKey(item_id) && itemIdSalePriceMap.get(item_id)!=0){
235
						amazonfbasalessnapshot.setSalePrice(itemIdSalePriceMap.get(item_id));
237
						amazonfbasalessnapshot.setSalePrice(itemIdSalePriceMap.get(item_id));
236
					}
238
					}
237
					else{
239
					else{
238
						amazonfbasalessnapshot.setSalePrice(amazon_item.getFbaPrice());
240
						amazonfbasalessnapshot.setSalePrice(0.0);
239
					}
241
					}
240
					if(itemIdminMFNPriceMap.containsKey(item_id) && itemIdminMFNPriceMap.get(item_id)!=0){
242
					if(itemIdminMFNPriceMap.containsKey(item_id) && itemIdminMFNPriceMap.get(item_id)!=0){
241
						amazonfbasalessnapshot.setMinFbaPrice(itemIdminMFNPriceMap.get(item_id));
243
						amazonfbasalessnapshot.setMinMfnPrice(itemIdminMFNPriceMap.get(item_id));
242
					}
244
					}
243
					else{
245
					else{
244
						amazonfbasalessnapshot.setMinFbaPrice(0.0);
246
						amazonfbasalessnapshot.setMinMfnPrice(0.0);
245
					}
247
					}
246
					if(itemIdminMFNPriceMap.containsKey(item_id) && itemIdminMFNPriceMap.get(item_id)!=0){
248
					if(itemIdminFBAPriceMap.containsKey(item_id) && itemIdminFBAPriceMap.get(item_id)!=0){
247
						amazonfbasalessnapshot.setMinMfnPrice(itemIdminMFNPriceMap.get(item_id));
249
						amazonfbasalessnapshot.setMinFbaPrice(itemIdminFBAPriceMap.get(item_id));
248
					}
250
					}
249
					else{
251
					else{
250
						amazonfbasalessnapshot.setMinMfnPrice(0.0);
252
						amazonfbasalessnapshot.setMinFbaPrice(0.0);
251
					}
253
					}
252
					if(itemIdOurPriceMap.containsKey(item_id)){
254
					if(itemIdOurPriceMap.containsKey(item_id) && itemIdOurPriceMap.get(item_id)!=0){
253
						amazonfbasalessnapshot.setOurPrice(itemIdOurPriceMap.get(item_id));
255
						amazonfbasalessnapshot.setOurPrice(itemIdOurPriceMap.get(item_id));
254
					}
256
					}
255
					else{
257
					else{
256
						amazonfbasalessnapshot.setOurPrice(0);
258
						amazonfbasalessnapshot.setOurPrice(amazon_item.getFbaPrice());
257
					}
259
					}
258
					amazonfbasalessnapshot.setAmazonFbaInventory(inventory);
260
					amazonfbasalessnapshot.setAmazonFbaInventory(inventory);
259
					transactionClient.addOrUpdateAmazonFbaSalesSnapshot(amazonfbasalessnapshot);
261
					transactionClient.addOrUpdateAmazonFbaSalesSnapshot(amazonfbasalessnapshot);
260
				}
262
				}
261
			}
263
			}