Subversion Repositories SmartDukaan

Rev

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

Rev 7272 Rev 7293
Line 35... Line 35...
35
    private String pin;
35
    private String pin;
36
    private long date = -1;
36
    private long date = -1;
37
    private boolean isCODAvailable;
37
    private boolean isCODAvailable;
38
    private boolean isOTGAvailable;
38
    private boolean isOTGAvailable;
39
    private double sellingPrice;
39
    private double sellingPrice;
40
    private double minAdvanceAmount;
40
    private long minAdvanceAmount;
41
    private Map<String, String> response = new HashMap<String, String>();
41
    private Map<String, String> response = new HashMap<String, String>();
-
 
42
 
-
 
43
    private double maxSellingPrice;
-
 
44
 
-
 
45
    private double minSellingPrice;
42
    
46
    
43
    public EstimateController() {
47
    public EstimateController() {
44
        super();
48
        super();
45
    }
49
    }
46
    
50
    
Line 56... Line 60...
56
            isCODAvailable = logistincInfo.isCodAllowed();
60
            isCODAvailable = logistincInfo.isCodAllowed();
57
            isOTGAvailable = logistincInfo.isOtgAvailable();
61
            isOTGAvailable = logistincInfo.isOtgAvailable();
58
            catalogServiceClient = new CatalogClient();
62
            catalogServiceClient = new CatalogClient();
59
            StorePricing sp = catalogServiceClient.getClient().getStorePricing(itemId);
63
            StorePricing sp = catalogServiceClient.getClient().getStorePricing(itemId);
60
            sellingPrice = sp.getRecommendedPrice();
64
            sellingPrice = sp.getRecommendedPrice();
61
            minAdvanceAmount = sp.getMinAdvancePrice();
65
            minAdvanceAmount = logistincInfo.getProviderId();
-
 
66
            maxSellingPrice = sp.getMaxPrice();
-
 
67
            minSellingPrice = sp.getMinPrice();
62
            
68
            
63
        } catch (Exception e)   {
69
        } catch (Exception e)   {
64
            date = -1;
70
            date = -1;
65
            isCODAvailable = false;
71
            isCODAvailable = false;
66
            log.error("Unable to get estimate/COD availability for " + itemId, e);
72
            log.error("Unable to get estimate/COD availability for " + itemId, e);
67
        }
73
        }
68
        SimpleDateFormat dateformat = new SimpleDateFormat("dd/MM/yyyy");
74
        SimpleDateFormat dateformat = new SimpleDateFormat("dd MMMM yyyy");
69
        
75
        
70
        response.put("delivery_estimate", dateformat.format(new Date(date)));
76
        response.put("delivery_estimate", dateformat.format(new Date(date)));
71
        response.put("is_cod_available_for_location", Boolean.toString(isCODAvailable));
77
        response.put("is_cod_available_for_location", Boolean.toString(isCODAvailable));
72
        response.put("on_time_guarantee", Boolean.toString(isOTGAvailable));
78
        response.put("on_time_guarantee", Boolean.toString(isOTGAvailable));
73
        response.put("selling_price", Double.toString(sellingPrice));
79
        response.put("selling_price", Double.toString(sellingPrice));
74
        response.put("min_advance_amount", Double.toString(minAdvanceAmount));
80
        response.put("min_advance_amount", Long.toString(minAdvanceAmount));
75
        
81
        response.put("min_selling_price", Double.toString(minSellingPrice));
76
        
82
        response.put("max_selling_price", Double.toString(maxSellingPrice));
77
        return "index";
83
        return "index";
78
    }
84
    }
79
    
85
    
80
    public String show(){
86
    public String show(){
81
        StringTokenizer tokenizer = new StringTokenizer(this.id, "_");
87
        StringTokenizer tokenizer = new StringTokenizer(this.id, "_");