| Line 1... |
Line 1... |
| 1 |
package in.shop2020.hotspot.dashbaord.server;
|
1 |
package in.shop2020.hotspot.dashbaord.server;
|
| 2 |
|
2 |
|
| 3 |
import in.shop2020.hotspot.dashbaord.shared.actions.Order;
|
3 |
import in.shop2020.hotspot.dashbaord.shared.actions.Order;
|
| 4 |
import in.shop2020.hotspot.dashbaord.shared.actions.OrderType;
|
4 |
import in.shop2020.hotspot.dashbaord.shared.actions.OrderType;
|
| - |
|
5 |
import in.shop2020.hotspot.dashbaord.shared.actions.ReturnOrder;
|
| 5 |
import in.shop2020.model.v1.order.Alert;
|
6 |
import in.shop2020.model.v1.order.Alert;
|
| 6 |
import in.shop2020.model.v1.order.LineItem;
|
7 |
import in.shop2020.model.v1.order.LineItem;
|
| 7 |
import in.shop2020.model.v1.order.OrderStatus;
|
8 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 8 |
import in.shop2020.model.v1.order.TransactionService.Client;
|
9 |
import in.shop2020.model.v1.order.TransactionService.Client;
|
| 9 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
10 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
| Line 133... |
Line 134... |
| 133 |
t_order.getPickupRequestNo());
|
134 |
t_order.getPickupRequestNo());
|
| 134 |
return order;
|
135 |
return order;
|
| 135 |
}
|
136 |
}
|
| 136 |
|
137 |
|
| 137 |
/**
|
138 |
/**
|
| - |
|
139 |
* Queries the transction server to get the list of all return orders that
|
| - |
|
140 |
* have to be processed.
|
| - |
|
141 |
*
|
| - |
|
142 |
* @return A list of all return orders to be processed.
|
| - |
|
143 |
*/
|
| - |
|
144 |
public static List<ReturnOrder> getReturnOrders(long warehouseId){
|
| - |
|
145 |
List<ReturnOrder> retOrders = new ArrayList<ReturnOrder>();
|
| - |
|
146 |
try{
|
| - |
|
147 |
TransactionServiceClient client = new TransactionServiceClient();
|
| - |
|
148 |
Client c = client.getClient();
|
| - |
|
149 |
List<in.shop2020.model.v1.order.ReturnOrder> tRetOrders = c.getReturnOrders(warehouseId, 0L, new Date().getTime());
|
| - |
|
150 |
for(in.shop2020.model.v1.order.ReturnOrder retOrder : tRetOrders){
|
| - |
|
151 |
retOrders.add(getReturnOrderFromThriftRO(retOrder));
|
| - |
|
152 |
}
|
| - |
|
153 |
}catch(Exception e){
|
| - |
|
154 |
e.printStackTrace();
|
| - |
|
155 |
}
|
| - |
|
156 |
return retOrders;
|
| - |
|
157 |
}
|
| - |
|
158 |
|
| - |
|
159 |
private static ReturnOrder getReturnOrderFromThriftRO(in.shop2020.model.v1.order.ReturnOrder tRetOrder){
|
| - |
|
160 |
ReturnOrder retOrder = new ReturnOrder(tRetOrder.getOrderId(), tRetOrder.getWarehouseId(),
|
| - |
|
161 |
tRetOrder.getItemId(), tRetOrder.getProductGroup(), tRetOrder.getBrand(), tRetOrder.getModelName(), tRetOrder.getModelNumber(), tRetOrder.getColor(), tRetOrder.getInvoiceNumber(), tRetOrder.getJacketNumber(), tRetOrder.getTotalPrice(), tRetOrder.getTransferPrice(), false, tRetOrder.getCreatedAt());
|
| - |
|
162 |
return retOrder;
|
| - |
|
163 |
}
|
| - |
|
164 |
|
| - |
|
165 |
/**
|
| 138 |
* This method maps a given type to a list of statuses.
|
166 |
* This method maps a given type to a list of statuses.
|
| 139 |
*
|
167 |
*
|
| 140 |
* @param type
|
168 |
* @param type
|
| 141 |
* The type of orders to fetch.
|
169 |
* The type of orders to fetch.
|
| 142 |
* @return The list of Thrift statuses associated with a particular order
|
170 |
* @return The list of Thrift statuses associated with a particular order
|