| Line 14... |
Line 14... |
| 14 |
import org.apache.struts2.convention.annotation.InterceptorRefs;
|
14 |
import org.apache.struts2.convention.annotation.InterceptorRefs;
|
| 15 |
import org.apache.thrift.TException;
|
15 |
import org.apache.thrift.TException;
|
| 16 |
import org.apache.thrift.transport.TTransportException;
|
16 |
import org.apache.thrift.transport.TTransportException;
|
| 17 |
import org.json.JSONArray;
|
17 |
import org.json.JSONArray;
|
| 18 |
|
18 |
|
| 19 |
import in.shop2020.content.BulkContentUploadResult;
|
- |
|
| 20 |
import in.shop2020.model.v1.order.Order;
|
19 |
import in.shop2020.model.v1.order.Order;
|
| 21 |
import in.shop2020.model.v1.order.OrderStatus;
|
20 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 22 |
import in.shop2020.model.v1.order.RefundType;
|
21 |
import in.shop2020.model.v1.order.RefundType;
|
| 23 |
import in.shop2020.model.v1.order.ReplacementShippingType;
|
22 |
import in.shop2020.model.v1.order.ReplacementShippingType;
|
| 24 |
import in.shop2020.model.v1.order.ReturnAction;
|
23 |
import in.shop2020.model.v1.order.ReturnAction;
|
| Line 33... |
Line 32... |
| 33 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
32 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
| 34 |
import in.shop2020.model.v1.user.Address;
|
33 |
import in.shop2020.model.v1.user.Address;
|
| 35 |
import in.shop2020.model.v1.user.AddressType;
|
34 |
import in.shop2020.model.v1.user.AddressType;
|
| 36 |
import in.shop2020.model.v1.user.User;
|
35 |
import in.shop2020.model.v1.user.User;
|
| 37 |
import in.shop2020.model.v1.user.UserContextException;
|
36 |
import in.shop2020.model.v1.user.UserContextException;
|
| - |
|
37 |
import in.shop2020.payments.Payment;
|
| - |
|
38 |
import in.shop2020.payments.PaymentException;
|
| - |
|
39 |
import in.shop2020.thrift.clients.PaymentClient;
|
| 38 |
import in.shop2020.thrift.clients.TransactionClient;
|
40 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 39 |
import in.shop2020.thrift.clients.UserClient;
|
41 |
import in.shop2020.thrift.clients.UserClient;
|
| 40 |
|
42 |
|
| 41 |
@InterceptorRefs({
|
43 |
@InterceptorRefs({
|
| 42 |
@InterceptorRef("myDefault"),
|
44 |
@InterceptorRef("myDefault"),
|
| Line 178... |
Line 180... |
| 178 |
setReturnPickupRequest(t_retuenPickuprequest);
|
180 |
setReturnPickupRequest(t_retuenPickuprequest);
|
| 179 |
setReturnOrderInfoList(transactionServiceClient.getAllReturnOrdersForReturnPickupRequest(t_retuenPickuprequest.getId()));
|
181 |
setReturnOrderInfoList(transactionServiceClient.getAllReturnOrdersForReturnPickupRequest(t_retuenPickuprequest.getId()));
|
| 180 |
return "pick-up-index";
|
182 |
return "pick-up-index";
|
| 181 |
}
|
183 |
}
|
| 182 |
|
184 |
|
| 183 |
public String refundReceivedOrder() throws NumberFormatException, TransactionServiceException, TException{
|
185 |
public String refundReceivedOrder() throws NumberFormatException, TransactionServiceException, TException, PaymentException{
|
| 184 |
transactionServiceClient = new TransactionClient().getClient();
|
186 |
transactionServiceClient = new TransactionClient().getClient();
|
| 185 |
returnOrderInfo = transactionServiceClient.getReturnOrderInfo(Long.valueOf(returnOrderId));
|
187 |
returnOrderInfo = transactionServiceClient.getReturnOrderInfo(Long.valueOf(returnOrderId));
|
| 186 |
returnOrderInfo.setRefundType(RefundType.findByValue(Integer.valueOf(refundType)));
|
188 |
returnOrderInfo.setRefundType(RefundType.findByValue(Integer.valueOf(refundType)));
|
| 187 |
returnOrderInfo.setRefundedBy(getAgentName());
|
189 |
returnOrderInfo.setRefundedBy(getAgentName());
|
| 188 |
if (returnOrderInfo.getRefundType() == RefundType.INIT){
|
190 |
if (returnOrderInfo.getRefundType() == RefundType.INIT){
|
| 189 |
setResult("Illegal refund type");
|
191 |
setResult("Illegal refund type");
|
| 190 |
return "result";
|
192 |
return "result";
|
| 191 |
}
|
193 |
}
|
| - |
|
194 |
in.shop2020.model.v1.order.Order t_order = transactionServiceClient.getOrder(returnOrderInfo.getOrderId());
|
| - |
|
195 |
PaymentClient paymentServiceClient = new PaymentClient();
|
| - |
|
196 |
List<Payment> orderPayments =null;
|
| - |
|
197 |
if(!t_order.isCod()){
|
| - |
|
198 |
orderPayments =paymentServiceClient.getClient()
|
| - |
|
199 |
.getPaymentForTxnId(t_order.getTransactionId());
|
| - |
|
200 |
}
|
| - |
|
201 |
|
| - |
|
202 |
|
| 192 |
List<in.shop2020.model.v1.order.Attribute> attrList = new ArrayList<in.shop2020.model.v1.order.Attribute>();
|
203 |
List<in.shop2020.model.v1.order.Attribute> attrList = new ArrayList<in.shop2020.model.v1.order.Attribute>();
|
| 193 |
in.shop2020.model.v1.order.Attribute attr1 = new in.shop2020.model.v1.order.Attribute();
|
204 |
in.shop2020.model.v1.order.Attribute attr1 = new in.shop2020.model.v1.order.Attribute();
|
| 194 |
attr1.setName("Refund_Option");
|
205 |
attr1.setName("Refund_Option");
|
| 195 |
in.shop2020.model.v1.order.Attribute attr2 = new in.shop2020.model.v1.order.Attribute();
|
206 |
in.shop2020.model.v1.order.Attribute attr2 = new in.shop2020.model.v1.order.Attribute();
|
| 196 |
attr2.setName("Refund_Amount");
|
207 |
attr2.setName("Refund_Amount");
|
| Line 380... |
Line 391... |
| 380 |
info.put("productUsable",Long.valueOf(productUsable)==1?"true":"false");
|
391 |
info.put("productUsable",Long.valueOf(productUsable)==1?"true":"false");
|
| 381 |
String serialNumberValues = "";
|
392 |
String serialNumberValues = "";
|
| 382 |
for(String s : serialNumbers){
|
393 |
for(String s : serialNumbers){
|
| 383 |
serialNumberValues = serialNumberValues+s.trim()+",";
|
394 |
serialNumberValues = serialNumberValues+s.trim()+",";
|
| 384 |
}
|
395 |
}
|
| - |
|
396 |
info.put("SerialNumbers", serialNumberValues);
|
| 385 |
returnOrderMap.put(returnOrderInfo.getId(), info);
|
397 |
returnOrderMap.put(returnOrderInfo.getId(), info);
|
| 386 |
boolean receiveResult = transactionServiceClient.receiveReturnPickup(returnOrderMap, 0l);
|
398 |
boolean receiveResult = transactionServiceClient.receiveReturnPickup(returnOrderMap, 0l);
|
| 387 |
setResult(String.valueOf(receiveResult));
|
399 |
setResult(String.valueOf(receiveResult));
|
| 388 |
return "result";
|
400 |
return "result";
|
| 389 |
}
|
401 |
}
|