Subversion Repositories SmartDukaan

Rev

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

Rev 5909 Rev 6153
Line 1... Line 1...
1
package in.shop2020.serving.controllers;
1
package in.shop2020.serving.controllers;
2
 
2
 
-
 
3
import in.shop2020.model.v1.order.RechargeType;
3
import in.shop2020.serving.auth.CRMAuthorizingRealm;
4
import in.shop2020.serving.auth.CRMAuthorizingRealm;
-
 
5
import in.shop2020.thrift.clients.TransactionClient;
4
import in.shop2020.util.CRMConstants;
6
import in.shop2020.util.CRMConstants;
5
import in.shop2020.util.CRMConstants.CODCancelMatrix;
7
import in.shop2020.util.CRMConstants.CODCancelMatrix;
6
 
8
 
7
import java.text.SimpleDateFormat;
9
import java.text.SimpleDateFormat;
8
import java.util.Date;
10
import java.util.Date;
Line 37... Line 39...
37
    protected static final String EDIT_NEW = "editNew";
39
    protected static final String EDIT_NEW = "editNew";
38
    protected static final String EDIT = "edit";
40
    protected static final String EDIT = "edit";
39
    protected static final String SHOW = "show";
41
    protected static final String SHOW = "show";
40
    protected static final String OPEN = "open";
42
    protected static final String OPEN = "open";
41
    protected static final String EXCEPTION = "exception";
43
    protected static final String EXCEPTION = "exception";
-
 
44
    
-
 
45
    static Map<Long, String> providersMap;
42
 
46
 
43
    protected final SimpleDateFormat SDF = new SimpleDateFormat("dd MMM, yyyy hh:mm a");
47
    protected final SimpleDateFormat SDF = new SimpleDateFormat("dd MMM, yyyy hh:mm a");
44
 
48
 
45
    protected HttpServletResponse response;
49
    protected HttpServletResponse response;
46
    protected HttpServletRequest request;
50
    protected HttpServletRequest request;
Line 65... Line 69...
65
    public void setSession(Map<String, Object> sessionMap) {
69
    public void setSession(Map<String, Object> sessionMap) {
66
        this.session = request.getSession();
70
        this.session = request.getSession();
67
        this.sessionMap = sessionMap;
71
        this.sessionMap = sessionMap;
68
    }
72
    }
69
    
73
    
-
 
74
    static {
-
 
75
        TransactionClient tcl;
-
 
76
        try {
-
 
77
            tcl = new TransactionClient();
-
 
78
            providersMap = tcl.getClient().getServiceProviders(RechargeType.MOBILE);
-
 
79
            providersMap.putAll(tcl.getClient().getServiceProviders(RechargeType.DTH));
-
 
80
        } catch (Exception e) {
-
 
81
            log.error("Could not get providers", e);
-
 
82
        }
-
 
83
    }
-
 
84
    
70
    /**
85
    /**
71
     * Utility method to convert a date to a readable format 
86
     * Utility method to convert a date to a readable format 
72
     */
87
     */
73
    public String convertDate(Long date) {
88
    public String convertDate(Long date) {
74
        if (date == null || date == 0) {
89
        if (date == null || date == 0) {