Rev 2830 | Blame | Last modification | View Log | RSS feed
package in.shop2020.serving.controllers;import in.shop2020.model.v1.user.UserCommunication;import in.shop2020.thrift.clients.UserClient;import java.text.SimpleDateFormat;import java.util.Date;import java.util.HashMap;import java.util.Map;import java.util.TimeZone;import org.apache.log4j.Logger;/*** @author vikas**/@SuppressWarnings("serial")public class UserCommunicationInfoController extends BaseController {private static Logger log = Logger.getLogger(Class.class);private long userId;private long commId;private Map<String, String> userCommunication;public UserCommunicationInfoController(){super();}public String index() throws Exception {UserClient userServiceClient = new UserClient();in.shop2020.model.v1.user.UserContextService.Client userClient = userServiceClient.getClient();UserCommunication comm = userClient.getUserCommunicationById(commId);SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");sdf.setTimeZone(TimeZone.getTimeZone("IST"));userCommunication = new HashMap<String, String>();userCommunication.put("airwaybillno", comm.getAirwaybillNo());userCommunication.put("time", sdf.format(new Date(comm.getCommunication_timestamp())));userCommunication.put("commtype", comm.getCommunicationType().name());userCommunication.put("message", comm.getMessage());userCommunication.put("orderid", Long.toString(comm.getOrderId()));userCommunication.put("productname", comm.getProductName());userCommunication.put("subject", comm.getSubject());return "index";}public void setUserId(String userId) {try {this.userId = Long.parseLong(userId);}catch (NumberFormatException e) {log.error(e);}}public Long getUserId() {return userId;}public void setCommId(String commId) {try {this.commId = Long.parseLong(commId);}catch (NumberFormatException e) {log.error(e);}}public Map<String, String> getUserCommunication() {return userCommunication;}}