| Line 1... |
Line 1... |
| 1 |
package in.shop2020.support.controllers;
|
1 |
package in.shop2020.support.controllers;
|
| 2 |
|
2 |
|
| 3 |
import in.shop2020.model.v1.order.LineItem;
|
- |
|
| 4 |
import in.shop2020.model.v1.order.Order;
|
- |
|
| 5 |
import in.shop2020.model.v1.order.Transaction;
|
- |
|
| 6 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
3 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
| 7 |
import in.shop2020.model.v1.user.Address;
|
- |
|
| 8 |
import in.shop2020.model.v1.user.User;
|
4 |
import in.shop2020.model.v1.user.User;
|
| 9 |
import in.shop2020.model.v1.user.UserCommunication;
|
5 |
import in.shop2020.model.v1.user.UserCommunication;
|
| 10 |
import in.shop2020.model.v1.user.UserContextException;
|
6 |
import in.shop2020.model.v1.user.UserContextException;
|
| 11 |
import in.shop2020.model.v1.user.UserContextService.Client;
|
7 |
import in.shop2020.model.v1.user.UserContextService.Client;
|
| 12 |
import in.shop2020.payments.Payment;
|
- |
|
| 13 |
import in.shop2020.thrift.clients.PaymentServiceClient;
|
- |
|
| 14 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
- |
|
| 15 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
8 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
| 16 |
|
9 |
|
| 17 |
import java.io.BufferedReader;
|
- |
|
| 18 |
import java.io.ByteArrayOutputStream;
|
10 |
import java.io.ByteArrayOutputStream;
|
| 19 |
import java.io.IOException;
|
11 |
import java.io.IOException;
|
| 20 |
import java.io.UnsupportedEncodingException;
|
- |
|
| 21 |
import java.security.Principal;
|
- |
|
| 22 |
import java.text.DateFormat;
|
- |
|
| 23 |
import java.text.ParseException;
|
12 |
import java.text.ParseException;
|
| 24 |
import java.text.SimpleDateFormat;
|
- |
|
| 25 |
import java.util.Collections;
|
- |
|
| 26 |
import java.util.Date;
|
13 |
import java.util.Date;
|
| 27 |
import java.util.Enumeration;
|
- |
|
| 28 |
import java.util.HashMap;
|
- |
|
| 29 |
import java.util.List;
|
14 |
import java.util.List;
|
| 30 |
import java.util.Locale;
|
- |
|
| 31 |
import java.util.Map;
|
- |
|
| 32 |
|
15 |
|
| 33 |
import javax.servlet.RequestDispatcher;
|
- |
|
| 34 |
import javax.servlet.ServletInputStream;
|
- |
|
| 35 |
import javax.servlet.ServletOutputStream;
|
16 |
import javax.servlet.ServletOutputStream;
|
| 36 |
import javax.servlet.http.Cookie;
|
- |
|
| 37 |
import javax.servlet.http.HttpServletRequest;
|
- |
|
| 38 |
import javax.servlet.http.HttpServletResponse;
|
17 |
import javax.servlet.http.HttpServletResponse;
|
| 39 |
import javax.servlet.http.HttpSession;
|
- |
|
| 40 |
|
18 |
|
| 41 |
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
19 |
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
| 42 |
import org.apache.poi.ss.usermodel.Cell;
|
20 |
import org.apache.poi.ss.usermodel.Cell;
|
| 43 |
import org.apache.poi.ss.usermodel.CellStyle;
|
21 |
import org.apache.poi.ss.usermodel.CellStyle;
|
| 44 |
import org.apache.poi.ss.usermodel.CreationHelper;
|
22 |
import org.apache.poi.ss.usermodel.CreationHelper;
|
| 45 |
import org.apache.poi.ss.usermodel.Font;
|
23 |
import org.apache.poi.ss.usermodel.Font;
|
| 46 |
import org.apache.poi.ss.usermodel.Row;
|
24 |
import org.apache.poi.ss.usermodel.Row;
|
| 47 |
import org.apache.poi.ss.usermodel.Sheet;
|
25 |
import org.apache.poi.ss.usermodel.Sheet;
|
| 48 |
import org.apache.poi.ss.usermodel.Workbook;
|
26 |
import org.apache.poi.ss.usermodel.Workbook;
|
| 49 |
import org.apache.poi.ss.util.CellRangeAddress;
|
27 |
import org.apache.poi.ss.util.CellRangeAddress;
|
| 50 |
import org.apache.struts2.interceptor.ServletRequestAware;
|
- |
|
| 51 |
import org.apache.struts2.interceptor.ServletResponseAware;
|
28 |
import org.apache.struts2.interceptor.ServletResponseAware;
|
| 52 |
import org.apache.thrift.TException;
|
29 |
import org.apache.thrift.TException;
|
| 53 |
|
30 |
|
| 54 |
public class UserCommunicationsController implements ServletResponseAware, ServletRequestAware{
|
31 |
public class UserCommunicationsController implements ServletResponseAware{
|
| 55 |
|
32 |
|
| 56 |
private HttpServletRequest request;
|
- |
|
| 57 |
private HttpServletResponse response;
|
33 |
private HttpServletResponse response;
|
| 58 |
|
34 |
|
| 59 |
private String errorMsg = "";
|
35 |
private String errorMsg = "";
|
| 60 |
|
36 |
|
| 61 |
@Override
|
37 |
@Override
|
| 62 |
public void setServletRequest(HttpServletRequest req) {
|
- |
|
| 63 |
this.request = req;
|
- |
|
| 64 |
}
|
- |
|
| 65 |
|
- |
|
| 66 |
@Override
|
- |
|
| 67 |
public void setServletResponse(HttpServletResponse res) {
|
38 |
public void setServletResponse(HttpServletResponse res) {
|
| 68 |
this.response = res;
|
39 |
this.response = res;
|
| 69 |
}
|
40 |
}
|
| 70 |
|
41 |
|
| 71 |
public String index() {
|
42 |
public String index() {
|
| Line 199... |
Line 170... |
| 199 |
if (userComm.getCommunicationType() != null) {
|
170 |
if (userComm.getCommunicationType() != null) {
|
| 200 |
commContentRow.createCell(8).setCellValue(
|
171 |
commContentRow.createCell(8).setCellValue(
|
| 201 |
userComm.getCommunicationType().name());
|
172 |
userComm.getCommunicationType().name());
|
| 202 |
}
|
173 |
}
|
| 203 |
commContentRow.createCell(9).setCellValue(userComm.getAirwaybillNo());
|
174 |
commContentRow.createCell(9).setCellValue(userComm.getAirwaybillNo());
|
| 204 |
commContentRow.createCell(10).setCellValue(userComm.getCommunication_timestamp());
|
175 |
commContentRow.createCell(10).setCellValue(new Date(userComm.getCommunication_timestamp()));
|
| 205 |
commContentRow.getCell(10).setCellStyle(dateCellStyle);
|
176 |
commContentRow.getCell(10).setCellStyle(dateCellStyle);
|
| 206 |
commContentRow.createCell(11).setCellValue(userComm.getProductName());
|
177 |
commContentRow.createCell(11).setCellValue(userComm.getProductName());
|
| 207 |
commContentRow.createCell(12).setCellValue(userComm.getReplyTo());
|
178 |
commContentRow.createCell(12).setCellValue(userComm.getReplyTo());
|
| 208 |
commContentRow.createCell(13).setCellValue(userComm.getSubject());
|
179 |
commContentRow.createCell(13).setCellValue(userComm.getSubject());
|
| 209 |
commContentRow.createCell(14).setCellValue(userComm.getMessage());
|
180 |
commContentRow.createCell(14).setCellValue(userComm.getMessage());
|