Subversion Repositories SmartDukaan

Rev

Rev 507 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 507 Rev 649
Line 25... Line 25...
25
	private static Log log = LogFactory.getLog(EstimateController.class);
25
	private static Log log = LogFactory.getLog(EstimateController.class);
26
	
26
	
27
	private String id;
27
	private String id;
28
	private long itemId;
28
	private long itemId;
29
	private String pincode;
29
	private String pincode;
30
	private long hours = 72;
30
	private long days = 3;
31
	public EstimateController() {
31
	public EstimateController() {
32
		super();
32
		super();
33
	}
33
	}
34
    
34
    
35
    // GET /logout
35
    // GET /logout
36
    public HttpHeaders show() throws Exception {
36
    public HttpHeaders show() throws Exception {
37
    	LogisticsServiceClient logisticsServiceClient;
37
    	LogisticsServiceClient logisticsServiceClient;
38
    	try {
38
    	try {
39
			logisticsServiceClient = new LogisticsServiceClient();
39
			logisticsServiceClient = new LogisticsServiceClient();
40
			Client logisticsClient = logisticsServiceClient.getClient();
40
			Client logisticsClient = logisticsServiceClient.getClient();
41
			hours = logisticsClient.getLogisticsEstimation(itemId, pincode, 1).getShippingTime();
41
			days = logisticsClient.getLogisticsEstimation(itemId, pincode).getDeliveryTime();
42
		} catch (Exception e) {
42
		} catch (Exception e) {
43
			// TODO Auto-generated catch block
43
			// TODO Auto-generated catch block
44
			e.printStackTrace();
44
			e.printStackTrace();
45
		}    	
45
		}    	
46
    	return new DefaultHttpHeaders("index");
46
    	return new DefaultHttpHeaders("index");
Line 56... Line 56...
56
        this.pincode = tokenizer.nextToken();
56
        this.pincode = tokenizer.nextToken();
57
        this.itemId = Long.parseLong(tokenizer.nextToken());
57
        this.itemId = Long.parseLong(tokenizer.nextToken());
58
    }
58
    }
59
 
59
 
60
    public long getEstimatedTime() {
60
    public long getEstimatedTime() {
61
    	return hours;
61
    	return days;
62
    }
62
    }
63
}
63
}