| Line 5... |
Line 5... |
| 5 |
import in.shop2020.hotspot.dashbaord.shared.actions.ReturnOrder;
|
5 |
import in.shop2020.hotspot.dashbaord.shared.actions.ReturnOrder;
|
| 6 |
import in.shop2020.model.v1.order.Alert;
|
6 |
import in.shop2020.model.v1.order.Alert;
|
| 7 |
import in.shop2020.model.v1.order.LineItem;
|
7 |
import in.shop2020.model.v1.order.LineItem;
|
| 8 |
import in.shop2020.model.v1.order.OrderStatus;
|
8 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 9 |
import in.shop2020.model.v1.order.TransactionService.Client;
|
9 |
import in.shop2020.model.v1.order.TransactionService.Client;
|
| 10 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
10 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 11 |
|
11 |
|
| 12 |
import java.util.ArrayList;
|
12 |
import java.util.ArrayList;
|
| 13 |
import java.util.Date;
|
13 |
import java.util.Date;
|
| 14 |
import java.util.List;
|
14 |
import java.util.List;
|
| 15 |
|
15 |
|
| Line 37... |
Line 37... |
| 37 |
public static List<Order> getOrders(OrderType type, long warehouseId){
|
37 |
public static List<Order> getOrders(OrderType type, long warehouseId){
|
| 38 |
List<OrderStatus> statuses = getStatuses(type);
|
38 |
List<OrderStatus> statuses = getStatuses(type);
|
| 39 |
|
39 |
|
| 40 |
List<Order> orders = new ArrayList<Order>();
|
40 |
List<Order> orders = new ArrayList<Order>();
|
| 41 |
try{
|
41 |
try{
|
| 42 |
TransactionServiceClient client = new TransactionServiceClient();
|
42 |
TransactionClient client = new TransactionClient();
|
| 43 |
Client c = client.getClient();
|
43 |
Client c = client.getClient();
|
| 44 |
|
44 |
|
| 45 |
List<in.shop2020.model.v1.order.Order> t_orders = new ArrayList<in.shop2020.model.v1.order.Order>();
|
45 |
List<in.shop2020.model.v1.order.Order> t_orders = new ArrayList<in.shop2020.model.v1.order.Order>();
|
| 46 |
if(statuses.isEmpty()){
|
46 |
if(statuses.isEmpty()){
|
| 47 |
t_orders.addAll(c.getAllOrders(null, 0L, new Date().getTime(), warehouseId));
|
47 |
t_orders.addAll(c.getAllOrders(null, 0L, new Date().getTime(), warehouseId));
|
| Line 87... |
Line 87... |
| 87 |
* @return True if everything goes fine, false otherwise.
|
87 |
* @return True if everything goes fine, false otherwise.
|
| 88 |
*/
|
88 |
*/
|
| 89 |
public static boolean markOrdersAsManifested(long warehouseId, String providerId, boolean cod){
|
89 |
public static boolean markOrdersAsManifested(long warehouseId, String providerId, boolean cod){
|
| 90 |
try {
|
90 |
try {
|
| 91 |
long provider_id = Long.parseLong(providerId);
|
91 |
long provider_id = Long.parseLong(providerId);
|
| 92 |
TransactionServiceClient client = new TransactionServiceClient();
|
92 |
TransactionClient client = new TransactionClient();
|
| 93 |
Client c = client.getClient();
|
93 |
Client c = client.getClient();
|
| 94 |
return c.markOrdersAsManifested(warehouseId, provider_id, cod);
|
94 |
return c.markOrdersAsManifested(warehouseId, provider_id, cod);
|
| 95 |
}catch(Exception e){
|
95 |
}catch(Exception e){
|
| 96 |
e.printStackTrace();
|
96 |
e.printStackTrace();
|
| 97 |
return false;
|
97 |
return false;
|
| Line 151... |
Line 151... |
| 151 |
* @return A list of all return orders to be processed.
|
151 |
* @return A list of all return orders to be processed.
|
| 152 |
*/
|
152 |
*/
|
| 153 |
public static List<ReturnOrder> getReturnOrders(long warehouseId){
|
153 |
public static List<ReturnOrder> getReturnOrders(long warehouseId){
|
| 154 |
List<ReturnOrder> retOrders = new ArrayList<ReturnOrder>();
|
154 |
List<ReturnOrder> retOrders = new ArrayList<ReturnOrder>();
|
| 155 |
try{
|
155 |
try{
|
| 156 |
TransactionServiceClient client = new TransactionServiceClient();
|
156 |
TransactionClient client = new TransactionClient();
|
| 157 |
Client c = client.getClient();
|
157 |
Client c = client.getClient();
|
| 158 |
List<in.shop2020.model.v1.order.ReturnOrder> tRetOrders = c.getReturnOrders(warehouseId, 0L, new Date().getTime());
|
158 |
List<in.shop2020.model.v1.order.ReturnOrder> tRetOrders = c.getReturnOrders(warehouseId, 0L, new Date().getTime());
|
| 159 |
for(in.shop2020.model.v1.order.ReturnOrder retOrder : tRetOrders){
|
159 |
for(in.shop2020.model.v1.order.ReturnOrder retOrder : tRetOrders){
|
| 160 |
retOrders.add(getReturnOrderFromThriftRO(retOrder));
|
160 |
retOrders.add(getReturnOrderFromThriftRO(retOrder));
|
| 161 |
}
|
161 |
}
|