Subversion Repositories SmartDukaan

Rev

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

Rev 11890 Rev 21934
Line 1... Line 1...
1
package in.shop2020.serving.controllers;
1
package in.shop2020.serving.controllers;
2
 
2
 
3
import in.shop2020.model.v1.user.Address;
3
import in.shop2020.model.v1.user.Address;
-
 
4
import in.shop2020.model.v1.user.Counter;
4
import in.shop2020.model.v1.user.PrivateDealUser;
5
import in.shop2020.model.v1.user.PrivateDealUser;
5
import in.shop2020.model.v1.user.User;
6
import in.shop2020.model.v1.user.User;
6
import in.shop2020.model.v1.user.UserCommunicationException;
7
import in.shop2020.model.v1.user.UserCommunicationException;
7
import in.shop2020.model.v1.user.UserContextService.Client;
-
 
8
import in.shop2020.util.DesEncrypter;
-
 
9
import in.shop2020.thrift.clients.HelperClient;
8
import in.shop2020.thrift.clients.HelperClient;
10
import in.shop2020.thrift.clients.UserClient;
9
import in.shop2020.thrift.clients.UserClient;
11
 
10
 
12
import java.util.ArrayList;
11
import java.util.ArrayList;
13
import java.util.List;
12
import java.util.List;
14
import java.util.Random;
13
import java.util.Random;
15
 
14
 
16
import org.apache.log4j.Logger;
15
import org.apache.log4j.Logger;
17
import org.apache.shiro.SecurityUtils;
16
import org.apache.shiro.SecurityUtils;
18
import org.apache.thrift.TException;
-
 
19
import org.apache.thrift.transport.TTransportException;
-
 
20
 
17
 
21
/**
18
/**
22
 * @author vikas
19
 * @author vikas
23
 *
20
 *
24
 */
21
 */
Line 30... Line 27...
30
    private User user;
27
    private User user;
31
    private List<Address> userAddresses;
28
    private List<Address> userAddresses;
32
    private Address primaryAdddress;
29
    private Address primaryAdddress;
33
    private String trustLevelDelta;
30
    private String trustLevelDelta;
34
    private PrivateDealUser privateDealUser;
31
    private PrivateDealUser privateDealUser;
-
 
32
    private boolean documentVerified=false;
-
 
33
    private String gstin = "Unregistered";
-
 
34
    private Counter counter= null;
-
 
35
    
-
 
36
 
35
    private String isPrivateDealUserActive;
37
	private String isPrivateDealUserActive;
36
    private static final String chars = "abcdefghijklmonpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
38
    private static final String chars = "abcdefghijklmonpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
37
    private static final Random random = new Random();
39
    private static final Random random = new Random();
38
    private static final int LENGTH = 10;
40
    private static final int LENGTH = 10;
39
 
41
 
40
 
42
 
Line 54... Line 56...
54
        if (user.getDefaultAddressId() != 0) {
56
        if (user.getDefaultAddressId() != 0) {
55
            primaryAdddress = userClient.getAddressById(user.getDefaultAddressId());
57
            primaryAdddress = userClient.getAddressById(user.getDefaultAddressId());
56
        }
58
        }
57
 
59
 
58
        setPrivateDealUser(userClient.getPrivateDealUser(userId));
60
        setPrivateDealUser(userClient.getPrivateDealUser(userId));
-
 
61
        Counter c = userClient.getCounterByUserId(userId);
-
 
62
        if(c.getId()!=0) {
-
 
63
        	this.counter = c;
-
 
64
        	if(c.getGstIn() != null ) {
-
 
65
        		this.gstin = c.getGstIn();
-
 
66
        	}
-
 
67
        	this.documentVerified = c.isDocumentVerified();
-
 
68
        	
-
 
69
        }
59
 
70
 
60
        return INDEX;
71
        return INDEX;
61
    }
72
    }
62
 
73
 
63
    public String update() throws Exception {
74
    public String update() throws Exception {
Line 183... Line 194...
183
    }
194
    }
184
 
195
 
185
    public String getIsPrivateDealUserActive() {
196
    public String getIsPrivateDealUserActive() {
186
        return isPrivateDealUserActive;
197
        return isPrivateDealUserActive;
187
    }
198
    }
-
 
199
 
-
 
200
	public void setCounter(Counter counter) {
-
 
201
		this.counter = counter;
-
 
202
	}
-
 
203
 
-
 
204
	public Counter getCounter() {
-
 
205
		return counter;
-
 
206
	}
-
 
207
	
-
 
208
	public boolean isDocumentVerified() {
-
 
209
		return documentVerified;
-
 
210
	}
-
 
211
 
-
 
212
	public void setDocumentVerified(boolean documentVerified) {
-
 
213
		this.documentVerified = documentVerified;
-
 
214
	}
-
 
215
 
-
 
216
	public String getGstin() {
-
 
217
		return gstin;
-
 
218
	}
-
 
219
 
-
 
220
	public void setGstin(String gstin) {
-
 
221
		this.gstin = gstin;
-
 
222
	}
-
 
223
    
-
 
224
    
188
}
225
}
189
226