Subversion Repositories SmartDukaan

Rev

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

Rev 7741 Rev 7753
Line 131... Line 131...
131
		Map<Long,String> amazonOrderMap = new HashMap<Long,String>();
131
		Map<Long,String> amazonOrderMap = new HashMap<Long,String>();
132
		for (int iterator=sheet.getFirstRowNum();iterator<=sheet.getLastRowNum();iterator++){
132
		for (int iterator=sheet.getFirstRowNum();iterator<=sheet.getLastRowNum();iterator++){
133
			TransactionClient tcl = new TransactionClient();
133
			TransactionClient tcl = new TransactionClient();
134
			List<AmazonOrder> orders = tcl.getClient().getAmazonOrderByAmazonOrderId(sheet.getRow(iterator).getCell(0).getStringCellValue());
134
			List<AmazonOrder> orders = tcl.getClient().getAmazonOrderByAmazonOrderId(sheet.getRow(iterator).getCell(0).getStringCellValue());
135
			for (AmazonOrder order : orders){
135
			for (AmazonOrder order : orders){
136
				if (StringUtils.equals(order.getStatus(), "Acknowledgement-Sent")){
136
				if (StringUtils.equals(order.getStatus(), "Order-Payment-Success")){
137
					amazonOrderMap.put(order.getOrderId(), sheet.getRow(iterator).getCell(1).getStringCellValue());
137
					amazonOrderMap.put(order.getOrderId(), sheet.getRow(iterator).getCell(1).getStringCellValue());
138
				}
138
				}
139
			}
139
			}
140
		}
140
		}
141
		TransactionClient tcl = new TransactionClient();
141
		TransactionClient tcl = new TransactionClient();
Line 192... Line 192...
192
		LogisticsClient logisticsClient = new LogisticsClient();
192
		LogisticsClient logisticsClient = new LogisticsClient();
193
		return logisticsClient.getClient().getLogisticsInfo("110001", Long.valueOf(itemId), DeliveryType.COD, PickUpType.COURIER).getShippingTime();
193
		return logisticsClient.getClient().getLogisticsInfo("110001", Long.valueOf(itemId), DeliveryType.COD, PickUpType.COURIER).getShippingTime();
194
 
194
 
195
	}
195
	}
196
 
196
 
197
	public  Map<Long, Item> getAliveItemMap() throws TException{
197
	public  Map<Long, Item> getAliveItemMap() throws TTransportException{
198
		Client CatalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
198
		Client CatalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
-
 
199
		List<Item> itemList = null;
-
 
200
		int retry=0;
-
 
201
		while(true){
-
 
202
		try {
-
 
203
			if (retry==3)
-
 
204
				break;
199
		List<Item> itemList = CatalogClient.getAllAliveItems();
205
			itemList = CatalogClient.getAllAliveItems();
-
 
206
			break;
-
 
207
		} catch (TException e) {
-
 
208
			retry++;
-
 
209
			e.printStackTrace();
-
 
210
		}
-
 
211
		}
200
		Map<Long, Item> itemMap = new HashMap<Long, Item>();
212
		Map<Long, Item> itemMap = new HashMap<Long, Item>();
201
		for (Item o : itemList) {
213
		for (Item o : itemList) {
202
			itemMap.put((Long) o.getId(), o);
214
			itemMap.put((Long) o.getId(), o);
203
		}
215
		}
204
		return itemMap;
216
		return itemMap;