| 2830 |
vikas |
1 |
package in.shop2020.serving.controllers;
|
|
|
2 |
|
|
|
3 |
import in.shop2020.model.v1.user.UserCommunication;
|
| 3128 |
rajveer |
4 |
import in.shop2020.thrift.clients.UserClient;
|
| 2830 |
vikas |
5 |
|
|
|
6 |
import java.text.SimpleDateFormat;
|
|
|
7 |
import java.util.Date;
|
|
|
8 |
import java.util.HashMap;
|
|
|
9 |
import java.util.Map;
|
|
|
10 |
import java.util.TimeZone;
|
|
|
11 |
|
|
|
12 |
import org.apache.log4j.Logger;
|
|
|
13 |
|
|
|
14 |
/**
|
|
|
15 |
* @author vikas
|
|
|
16 |
*
|
|
|
17 |
*/
|
|
|
18 |
@SuppressWarnings("serial")
|
|
|
19 |
public class UserCommunicationInfoController extends BaseController {
|
|
|
20 |
private static Logger log = Logger.getLogger(Class.class);
|
|
|
21 |
private long userId;
|
|
|
22 |
private long commId;
|
|
|
23 |
private Map<String, String> userCommunication;
|
|
|
24 |
|
|
|
25 |
public UserCommunicationInfoController(){
|
|
|
26 |
super();
|
|
|
27 |
}
|
|
|
28 |
|
|
|
29 |
public String index() throws Exception {
|
| 3128 |
rajveer |
30 |
UserClient userServiceClient = new UserClient();
|
|
|
31 |
in.shop2020.model.v1.user.UserContextService.Client userClient = userServiceClient.getClient();
|
| 2830 |
vikas |
32 |
|
|
|
33 |
UserCommunication comm = userClient.getUserCommunicationById(commId);
|
|
|
34 |
|
|
|
35 |
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
36 |
sdf.setTimeZone(TimeZone.getTimeZone("IST"));
|
|
|
37 |
|
|
|
38 |
userCommunication = new HashMap<String, String>();
|
|
|
39 |
|
|
|
40 |
userCommunication.put("airwaybillno", comm.getAirwaybillNo());
|
|
|
41 |
userCommunication.put("time", sdf.format(new Date(comm.getCommunication_timestamp())));
|
|
|
42 |
userCommunication.put("commtype", comm.getCommunicationType().name());
|
|
|
43 |
userCommunication.put("message", comm.getMessage());
|
|
|
44 |
userCommunication.put("orderid", Long.toString(comm.getOrderId()));
|
|
|
45 |
userCommunication.put("productname", comm.getProductName());
|
|
|
46 |
userCommunication.put("subject", comm.getSubject());
|
|
|
47 |
return "index";
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
public void setUserId(String userId) {
|
|
|
51 |
try {
|
|
|
52 |
this.userId = Long.parseLong(userId);
|
|
|
53 |
}
|
|
|
54 |
catch (NumberFormatException e) {
|
|
|
55 |
log.error(e);
|
|
|
56 |
}
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
public Long getUserId() {
|
|
|
60 |
return userId;
|
|
|
61 |
}
|
|
|
62 |
|
|
|
63 |
public void setCommId(String commId) {
|
|
|
64 |
try {
|
|
|
65 |
this.commId = Long.parseLong(commId);
|
|
|
66 |
}
|
|
|
67 |
catch (NumberFormatException e) {
|
|
|
68 |
log.error(e);
|
|
|
69 |
}
|
|
|
70 |
}
|
|
|
71 |
|
|
|
72 |
public Map<String, String> getUserCommunication() {
|
|
|
73 |
return userCommunication;
|
|
|
74 |
}
|
|
|
75 |
}
|