Subversion Repositories SmartDukaan

Rev

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

Rev 7190 Rev 7200
Line 26... Line 26...
26
import in.shop2020.serving.auth.CRMAuthorizingRealm;
26
import in.shop2020.serving.auth.CRMAuthorizingRealm;
27
import in.shop2020.serving.model.ShipmentUpdate;
27
import in.shop2020.serving.model.ShipmentUpdate;
28
import in.shop2020.serving.services.AramexTrackingService;
28
import in.shop2020.serving.services.AramexTrackingService;
29
import in.shop2020.serving.services.BlueDartTrackingService;
29
import in.shop2020.serving.services.BlueDartTrackingService;
30
import in.shop2020.serving.services.DelhiveryTrackingService;
30
import in.shop2020.serving.services.DelhiveryTrackingService;
-
 
31
import in.shop2020.serving.services.RedExpressTrackingService;
31
import in.shop2020.thrift.clients.CRMClient;
32
import in.shop2020.thrift.clients.CRMClient;
32
import in.shop2020.thrift.clients.CatalogClient;
33
import in.shop2020.thrift.clients.CatalogClient;
33
import in.shop2020.thrift.clients.HelperClient;
34
import in.shop2020.thrift.clients.HelperClient;
34
import in.shop2020.thrift.clients.LogisticsClient;
35
import in.shop2020.thrift.clients.LogisticsClient;
35
import in.shop2020.thrift.clients.PaymentClient;
36
import in.shop2020.thrift.clients.PaymentClient;
Line 74... Line 75...
74
public class UserOrderInfoController extends BaseController {
75
public class UserOrderInfoController extends BaseController {
75
    private static Logger                  log                     = Logger.getLogger(Class.class);
76
    private static Logger                  log                     = Logger.getLogger(Class.class);
76
    private static BlueDartTrackingService blueDartTrackingService = new BlueDartTrackingService();
77
    private static BlueDartTrackingService blueDartTrackingService = new BlueDartTrackingService();
77
    private static AramexTrackingService aramexTrackingService     = new AramexTrackingService();
78
    private static AramexTrackingService aramexTrackingService     = new AramexTrackingService();
78
    private static DelhiveryTrackingService delhiveryTrackingService     = new DelhiveryTrackingService();
79
    private static DelhiveryTrackingService delhiveryTrackingService     = new DelhiveryTrackingService();
-
 
80
    private static RedExpressTrackingService redexpressTrackingService = new RedExpressTrackingService();
79
 
81
 
80
    private long                 orderId;
82
    private long                 orderId;
81
    private Order                order;
83
    private Order                order;
82
    private List<Payment>        payments;
84
    private List<Payment>        payments;
83
    private List<ShipmentUpdate> shipmentUpdates = new ArrayList<ShipmentUpdate>();
85
    private List<ShipmentUpdate> shipmentUpdates = new ArrayList<ShipmentUpdate>();
Line 152... Line 154...
152
                        shipmentUpdates = aramexTrackingService.getUpdates(order.getAirwaybill_no());
154
                        shipmentUpdates = aramexTrackingService.getUpdates(order.getAirwaybill_no());
153
                    }
155
                    }
154
                    else if (order.getLogistics_provider_id() == 3) {
156
                    else if (order.getLogistics_provider_id() == 3) {
155
                        shipmentUpdates = delhiveryTrackingService.getUpdates(order.getAirwaybill_no());
157
                        shipmentUpdates = delhiveryTrackingService.getUpdates(order.getAirwaybill_no());
156
                    }
158
                    }
-
 
159
                    else if (order.getLogistics_provider_id() == 6) {
-
 
160
                        shipmentUpdates = redexpressTrackingService.getUpdates(order.getAirwaybill_no());
-
 
161
                    }
157
                    else {
162
                    else {
158
                        shipmentUpdates = new ArrayList<ShipmentUpdate>();
163
                        shipmentUpdates = new ArrayList<ShipmentUpdate>();
159
                        log.error("Error : providerId = " + order.getLogistics_provider_id() + "for orderId : " + order.getId());
164
                        log.error("Error : providerId = " + order.getLogistics_provider_id() + "for orderId : " + order.getId());
160
                    }
165
                    }
161
                    return true;
166
                    return true;
Line 294... Line 299...
294
            log.error("Could not mark order for Cancellation, OrderId : " + orderId, e);
299
            log.error("Could not mark order for Cancellation, OrderId : " + orderId, e);
295
        }
300
        }
296
        return index();
301
        return index();
297
    }
302
    }
298
    
303
    
299
    public void getOrderConfirmationMail() throws IOException, TException, ConfigException {
304
    public void getOrderConfirmationMail() throws IOException, TException, ConfigException, TransactionServiceException {
-
 
305
    	TransactionClient transactionServiceClient = new TransactionClient();
-
 
306
    	order = transactionServiceClient.getClient().getOrder(orderId);
-
 
307
    	long source = order.getTransactionId();
300
    	String helper_service_server=ConfigClient.getClient().get("helper_service_server");
308
    	String helper_service_server=ConfigClient.getClient().get("helper_service_server");
301
    	String helper_service_server_port=ConfigClient.getClient().get("helper_service_server_port");
309
    	String helper_service_server_port=ConfigClient.getClient().get("helper_service_server_port");
302
    	HelperClient helperClient = new HelperClient(helper_service_server,helper_service_server_port);
310
    	HelperClient helperClient = new HelperClient(helper_service_server,helper_service_server_port);
303
    	String mail = helperClient.getClient().getOrderConfirmationMail(orderId);
311
    	String mail = helperClient.getClient().getOrderConfirmationMail(source);
304
    	File file = new File("temp");
312
    	File file = new File("temp");
-
 
313
    	
305
    	FileWriter writer = new FileWriter(file);
314
    	FileWriter writer = new FileWriter(file);
306
    	writer.append(mail);
315
    	writer.append(mail);
307
    	writer.close();
316
    	writer.close();
308
 
317
 
309
    	byte[] buffer = new byte[(int)file.length()];
318
    	byte[] buffer = new byte[(int)file.length()];