Subversion Repositories SmartDukaan

Rev

Rev 1744 | Rev 1891 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1494 vikas 1
package in.shop2020.support.controllers;
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;
7
import in.shop2020.model.v1.user.Address;
8
import in.shop2020.model.v1.user.User;
1608 vikas 9
import in.shop2020.model.v1.user.UserCommunication;
1494 vikas 10
import in.shop2020.model.v1.user.UserContextService.Client;
11
import in.shop2020.payments.Payment;
12
import in.shop2020.thrift.clients.PaymentServiceClient;
13
import in.shop2020.thrift.clients.TransactionServiceClient;
14
import in.shop2020.thrift.clients.UserContextServiceClient;
15
 
16
import java.io.ByteArrayOutputStream;
17
import java.io.IOException;
18
import java.text.ParseException;
1608 vikas 19
import java.util.Collections;
1494 vikas 20
import java.util.Date;
1608 vikas 21
import java.util.HashMap;
1494 vikas 22
import java.util.List;
23
import java.util.Map;
24
 
25
import javax.servlet.ServletOutputStream;
26
import javax.servlet.http.HttpServletRequest;
27
import javax.servlet.http.HttpServletResponse;
28
 
29
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
30
import org.apache.poi.ss.usermodel.Cell;
31
import org.apache.poi.ss.usermodel.CellStyle;
1738 vikas 32
import org.apache.poi.ss.usermodel.CreationHelper;
1494 vikas 33
import org.apache.poi.ss.usermodel.Font;
34
import org.apache.poi.ss.usermodel.Row;
35
import org.apache.poi.ss.usermodel.Sheet;
36
import org.apache.poi.ss.usermodel.Workbook;
37
import org.apache.poi.ss.util.CellRangeAddress;
38
import org.apache.struts2.interceptor.ServletRequestAware;
39
import org.apache.struts2.interceptor.ServletResponseAware;
40
 
41
public class UserOrdersController implements ServletResponseAware, ServletRequestAware{
42
 
1738 vikas 43
	//private static final DateFormat DATE_TIME_FORMAT = new SimpleDateFormat("yyyy/MM/dd HH:mm");
1608 vikas 44
 
1494 vikas 45
	private HttpServletRequest request;
46
	private HttpServletResponse response;
47
 
48
	private String errorMsg = "";
49
 
50
	@Override
51
	public void setServletRequest(HttpServletRequest req) {
52
		this.request = req;
53
	}
54
 
55
	@Override
56
	public void setServletResponse(HttpServletResponse res) {
57
		this.response = res;
58
	}
59
 
60
	public String index()	{
61
		return "report";
62
	}
63
 
64
	public String show(){
65
		return "report";
66
	}
67
 
68
	// Handles the POST request (Form Submission)
69
	public String create(){
70
		try	{
71
			//Formatting Form input parameters
72
			String email = request.getParameter("email");
73
			String orderid = request.getParameter("orderid");
74
 
75
			TransactionServiceClient transactionServiceClient = new TransactionServiceClient();
76
			in.shop2020.model.v1.order.TransactionService.Client transactionClient = transactionServiceClient.getClient();
77
 
78
			UserContextServiceClient userContextServiceClient = new UserContextServiceClient();
79
			Client userClient = userContextServiceClient.getClient();
80
 
81
			PaymentServiceClient paymentServiceClient = new PaymentServiceClient();
82
			in.shop2020.payments.PaymentService.Client paymentClient = paymentServiceClient.getClient();
1608 vikas 83
 
1494 vikas 84
			User user = null;
85
			if (email != null && !email.isEmpty()) {
86
				user = userClient.getUserByEmail(email);
87
				if(user.getUserId() == -1){
88
				    errorMsg = "No user for this id.";
89
					return "report";
90
				}
91
			}
92
			else {
1498 vikas 93
				try {
94
				    user = userClient.getUserById(transactionClient.getOrder(Long.parseLong(orderid)).getCustomer_id());
95
				} catch (NumberFormatException e)	{
96
					errorMsg = "Order Id should be a number.";
97
					return "report";
98
				}
1494 vikas 99
			}
100
 
101
			if (user == null) {
102
				errorMsg = "Could not find user.";
103
				return "report";
104
			}
105
 
1608 vikas 106
			//Retrieving all user communications
107
			List<UserCommunication> userCommunications = userClient.getUserCommunicationByUser(user.getUserId());
108
 
109
			//Retrieving all the transactions
110
			List <Transaction> transactions = transactionClient.getTransactionsForCustomer(user.getUserId(), 0, (new Date()).getTime(), null);
111
			Collections.reverse(transactions);
1494 vikas 112
 
113
			//Retrieving all the payments 
1608 vikas 114
			List <Payment> payments = paymentClient.getPaymentsForUser(user.getUserId(), 0,
115
					(new Date()).getTime(), null, 0);
116
 
117
			Map<Long, Payment> txnIdToPaymentMap = new HashMap<Long, Payment>();
118
			for(Payment payment : payments) {
119
				txnIdToPaymentMap.put(payment.getMerchantTxnId(), payment);
120
			}
121
 
1494 vikas 122
			// Preparing XLS file for output
123
			response.setContentType("application/vnd.ms-excel");
124
 
125
			response.setHeader("Content-disposition", "inline; filename=user-orders" + ".xls");
126
 
127
			ServletOutputStream sos;
128
			try {
1608 vikas 129
				ByteArrayOutputStream baos = getSpreadSheetData(user,
1738 vikas 130
						transactions, txnIdToPaymentMap, userCommunications, userClient);
1494 vikas 131
				sos = response.getOutputStream();
132
				baos.writeTo(sos);
133
				sos.flush();
134
			} catch (IOException e) {
135
				errorMsg = "Failed to write to response.";
136
				e.printStackTrace();
137
			}
138
 
139
		} catch (ParseException e)	{
1498 vikas 140
			errorMsg = e.getMessage();
1494 vikas 141
			e.printStackTrace();
142
		} catch (TransactionServiceException e)	{
1498 vikas 143
			errorMsg = e.getMessage();
1494 vikas 144
			e.printStackTrace();
145
		} catch (Exception e)	{
1498 vikas 146
			errorMsg = e.getMessage();
1494 vikas 147
			e.printStackTrace();
148
		}
149
		return "report";
150
	}
151
 
152
	// Prepares the XLS worksheet object and fills in the data with proper formatting
1608 vikas 153
	private ByteArrayOutputStream getSpreadSheetData(User user,
154
			List<Transaction> transactions,
155
			Map<Long, Payment> txnIdToPaymentMap,
156
			List<UserCommunication> userCommunications,
1738 vikas 157
			Client userClient) 
1608 vikas 158
	{
159
	    ByteArrayOutputStream baosXLS = new ByteArrayOutputStream();
1494 vikas 160
 
1608 vikas 161
		Workbook wb = new HSSFWorkbook();
1494 vikas 162
 
163
	    Font font = wb.createFont();
164
	    font.setBoldweight(Font.BOLDWEIGHT_BOLD);
165
	    CellStyle style = wb.createCellStyle();
166
	    style.setFont(font);
167
 
1738 vikas 168
	    CreationHelper createHelper = wb.getCreationHelper();
169
	    CellStyle dateCellStyle = wb.createCellStyle();
170
	    dateCellStyle.setDataFormat(createHelper.createDataFormat().getFormat("DD/MM/YYYY HH:MM"));
171
 
172
	    createUserSheet(user, userCommunications, wb, style, dateCellStyle);
173
	    createTransactionSheet(transactions, txnIdToPaymentMap, wb, style, dateCellStyle);
1494 vikas 174
 
175
		// Write the workbook to the output stream
176
		try {
177
			wb.write(baosXLS);
178
			baosXLS.close();
179
		} catch (IOException e) {
180
			e.printStackTrace();
181
		}		
182
		return baosXLS;
183
	}
184
 
1738 vikas 185
	private void createTransactionSheet(List<Transaction> transactions, Map<Long, Payment> txnIdToPaymentMap, Workbook wb, CellStyle style, CellStyle dateCellStyle) {
1494 vikas 186
		// TRANSACTION SHEET
1608 vikas 187
	    Sheet transactionSheet = wb.createSheet("Transactions and Payments");
1494 vikas 188
	    short transactionSerialNo = 0;
189
 
190
	    Row orderTitleRow = transactionSheet.createRow(transactionSerialNo ++);
191
	    Cell orderTitleCell = orderTitleRow.createCell(0);
1608 vikas 192
	    orderTitleCell.setCellValue("User Transactions and Payments");
1494 vikas 193
	    orderTitleCell.setCellStyle(style);
194
 
195
	    transactionSheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 6));
196
 
197
	    transactionSheet.createRow(transactionSerialNo ++);
198
 
199
	    Row orderHeaderRow = transactionSheet.createRow(transactionSerialNo ++);
200
	    orderHeaderRow.createCell(0).setCellValue("Transaction Id");
201
	    orderHeaderRow.createCell(1).setCellValue("Transaction Date");
202
	    orderHeaderRow.createCell(2).setCellValue("Transaction Status");
203
	    orderHeaderRow.createCell(3).setCellValue("Order Id");
204
	    orderHeaderRow.createCell(4).setCellValue("Billing Number");
205
	    orderHeaderRow.createCell(5).setCellValue("Billing Date");
206
	    orderHeaderRow.createCell(6).setCellValue("Order Status");
1608 vikas 207
 
1494 vikas 208
	    orderHeaderRow.createCell(7).setCellValue("Brand");
209
	    orderHeaderRow.createCell(8).setCellValue("Model Name");
210
	    orderHeaderRow.createCell(9).setCellValue("Model Number");
211
	    orderHeaderRow.createCell(10).setCellValue("Color");
212
	    orderHeaderRow.createCell(11).setCellValue("Quantity");
213
	    orderHeaderRow.createCell(12).setCellValue("Unit Price");
214
	    orderHeaderRow.createCell(13).setCellValue("Total Price");
1608 vikas 215
 
1494 vikas 216
	    orderHeaderRow.createCell(14).setCellValue("User Id");
217
	    orderHeaderRow.createCell(15).setCellValue("Name");
218
	    orderHeaderRow.createCell(16).setCellValue("Address1");
219
	    orderHeaderRow.createCell(17).setCellValue("Address2");
1738 vikas 220
	    orderHeaderRow.createCell(18).setCellValue("City");
1494 vikas 221
	    orderHeaderRow.createCell(19).setCellValue("State");
222
	    orderHeaderRow.createCell(20).setCellValue("Pin Code");
223
	    orderHeaderRow.createCell(21).setCellValue("Mobile Number");
224
	    orderHeaderRow.createCell(22).setCellValue("email");
1608 vikas 225
 
1494 vikas 226
	    orderHeaderRow.createCell(23).setCellValue("Airway Bill No.");
227
	    orderHeaderRow.createCell(24).setCellValue("Billed By");
228
	    orderHeaderRow.createCell(25).setCellValue("Receiver");
229
	    orderHeaderRow.createCell(26).setCellValue("Tracking Id");
230
	    orderHeaderRow.createCell(27).setCellValue("Accepted Timestamp");
231
	    orderHeaderRow.createCell(28).setCellValue("Delivery Timestamp");
232
	    orderHeaderRow.createCell(29).setCellValue("Expected Delivery Time");
1608 vikas 233
 
234
	    orderHeaderRow.createCell(30).setCellValue("Payment Id");
235
	    orderHeaderRow.createCell(31).setCellValue("Payment Status");
236
	    orderHeaderRow.createCell(32).setCellValue("Gateway Payment Id");
237
	    orderHeaderRow.createCell(33).setCellValue("Gateway Transaction Date");
238
	    orderHeaderRow.createCell(34).setCellValue("Gateway Txn Id");
239
	    orderHeaderRow.createCell(35).setCellValue("Gateway Txn Status");
240
	    orderHeaderRow.createCell(36).setCellValue("Reference Code");
241
	    orderHeaderRow.createCell(37).setCellValue("Gateway Id");
242
	    orderHeaderRow.createCell(38).setCellValue("Amount");
243
	    orderHeaderRow.createCell(39).setCellValue("Description");
244
	    orderHeaderRow.createCell(40).setCellValue("Auth Code");
245
	    orderHeaderRow.createCell(41).setCellValue("Error Code");
1494 vikas 246
 
1738 vikas 247
	    for (int i=0; i<42 ;i++) {
248
            orderHeaderRow.getCell(i).setCellStyle(style);
249
        }
250
 
1494 vikas 251
	    for(Transaction transaction : transactions)	{
252
	    	List<Order> orders = transaction.getOrders();
253
	    	Date transactionDate = new Date(transaction.getCreatedOn());
254
	    	long transactionId = transaction.getId();
255
	    	String transactionStatus = transaction.getStatusDescription();
256
	    	for(Order order : orders)	{
257
		    	transactionSerialNo ++;
258
		    	Row contentRow = transactionSheet.createRow(transactionSerialNo);
259
			    LineItem lineItem = order.getLineitems().get(0);
1608 vikas 260
			    Payment payment = txnIdToPaymentMap.get(transactionId);
1494 vikas 261
 
262
			    contentRow.createCell(0).setCellValue(transactionId);
1738 vikas 263
			    contentRow.createCell(1).setCellValue(transactionDate);
264
			    contentRow.getCell(1).setCellStyle(dateCellStyle);
1494 vikas 265
			    contentRow.createCell(2).setCellValue(transactionStatus);
266
			    contentRow.createCell(3).setCellValue(order.getId());
267
			    contentRow.createCell(4).setCellValue(order.getInvoice_number());
1744 vikas 268
			    contentRow.createCell(5).setCellValue(new Date(order.getBilling_timestamp()));
1738 vikas 269
			    contentRow.getCell(5).setCellStyle(dateCellStyle);
1494 vikas 270
			    contentRow.createCell(6).setCellValue(order.getStatusDescription());
1608 vikas 271
 
1494 vikas 272
			    contentRow.createCell(7).setCellValue(getValueForEmptyString(lineItem.getBrand()));
273
			    contentRow.createCell(8).setCellValue(getValueForEmptyString(lineItem.getModel_name()));
274
			    contentRow.createCell(9).setCellValue(getValueForEmptyString(lineItem.getModel_number()));
275
			    contentRow.createCell(10).setCellValue(getValueForEmptyString(lineItem.getColor()));
276
			    contentRow.createCell(11).setCellValue(lineItem.getQuantity());
277
			    contentRow.createCell(12).setCellValue(lineItem.getUnit_price());
278
			    contentRow.createCell(13).setCellValue(lineItem.getTotal_price());
1608 vikas 279
 
1494 vikas 280
			    contentRow.createCell(14).setCellValue(order.getCustomer_id());
281
			    contentRow.createCell(15).setCellValue(order.getCustomer_name());
282
			    contentRow.createCell(16).setCellValue(order.getCustomer_address1());
283
			    contentRow.createCell(17).setCellValue(order.getCustomer_address2());
284
			    contentRow.createCell(18).setCellValue(order.getCustomer_city());
285
			    contentRow.createCell(19).setCellValue(order.getCustomer_state());
286
			    contentRow.createCell(20).setCellValue(order.getCustomer_pincode());
287
			    contentRow.createCell(21).setCellValue(order.getCustomer_mobilenumber());
288
			    contentRow.createCell(22).setCellValue(order.getCustomer_email());
1608 vikas 289
 
1494 vikas 290
			    contentRow.createCell(23).setCellValue(order.getAirwaybill_no());
291
			    contentRow.createCell(24).setCellValue(order.getBilled_by());
292
			    contentRow.createCell(25).setCellValue(order.getReceiver());
293
			    contentRow.createCell(26).setCellValue(order.getTracking_id());
1744 vikas 294
			    contentRow.createCell(27).setCellValue(new Date(order.getAccepted_timestamp()));
1738 vikas 295
			    contentRow.getCell(27).setCellStyle(dateCellStyle);
1744 vikas 296
			    contentRow.createCell(28).setCellValue(new Date(order.getDelivery_timestamp()));
1738 vikas 297
			    contentRow.getCell(28).setCellStyle(dateCellStyle);
1744 vikas 298
			    contentRow.createCell(29).setCellValue(new Date(order.getExpected_delivery_time()));
1738 vikas 299
			    contentRow.getCell(29).setCellStyle(dateCellStyle);
1608 vikas 300
 
301
				if (payment != null) {
302
					contentRow.createCell(30).setCellValue(payment.getPaymentId());
303
					contentRow.createCell(31).setCellValue(payment.getStatus().name());
304
					contentRow.createCell(32).setCellValue(payment.getGatewayPaymentId());
305
					contentRow.createCell(33).setCellValue(payment.getGatewayTxnDate());
306
					contentRow.createCell(34).setCellValue(payment.getGatewayTxnId());
307
					contentRow.createCell(35).setCellValue(payment.getGatewayTxnStatus());
308
					contentRow.createCell(36).setCellValue(payment.getReferenceCode());
309
					contentRow.createCell(37).setCellValue(payment.getGatewayId());
310
					contentRow.createCell(38).setCellValue(payment.getAmount());
311
					contentRow.createCell(39).setCellValue(payment.getDescription());
312
					contentRow.createCell(40).setCellValue(payment.getAuthCode());
313
					contentRow.createCell(41).setCellValue(payment.getErrorCode());
314
				}
1494 vikas 315
		    }
316
	    }
317
	}
318
 
319
	private String getValueForEmptyString(String s){
320
		if(s==null || s.equals(""))
321
			return "-";
322
		else
323
			return s; 
324
	}
325
 
1738 vikas 326
	private void createUserSheet(User user, List<UserCommunication> userCommunications, Workbook wb, CellStyle style, CellStyle dateCellStyle) {
1494 vikas 327
	    Sheet userSheet = wb.createSheet("User");
328
	    short userSerialNo = 0;
329
    	// Create the header row and put all the titles in it. Rows are 0 based.
330
 
331
	    Row titleRow = userSheet.createRow(userSerialNo++);
332
	    Cell titleCell = titleRow.createCell(0);
333
	    titleCell.setCellValue("User Details");
334
	    titleCell.setCellStyle(style);
335
 
336
	    userSheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 6));
337
 
338
	    Row userHeaderRow = userSheet.createRow(userSerialNo++);
339
	    userHeaderRow.createCell(0).setCellValue("Name");
340
	    userHeaderRow.createCell(1).setCellValue("Email");
341
	    userHeaderRow.createCell(2).setCellValue("Communication Email");
342
	    userHeaderRow.createCell(3).setCellValue("Date Of Birth");
343
	    userHeaderRow.createCell(4).setCellValue("Mobile Number");
344
	    userHeaderRow.createCell(5).setCellValue("Sex");
345
	    userHeaderRow.createCell(6).setCellValue("User Id");
1738 vikas 346
	    for (int i=0; i<7 ;i++) {
347
            userHeaderRow.getCell(i).setCellStyle(style);
348
        }
1494 vikas 349
 
350
	    Row userContentRow = userSheet.createRow(userSerialNo++);
351
 
352
    	userContentRow.createCell(0).setCellValue(user.getName());
353
    	userContentRow.createCell(1).setCellValue(user.getEmail());
354
    	userContentRow.createCell(2).setCellValue(user.getCommunicationEmail());
355
    	userContentRow.createCell(3).setCellValue(user.getDateOfBirth());
356
    	userContentRow.createCell(4).setCellValue(user.getMobileNumber());
357
    	userContentRow.createCell(5).setCellValue(user.getSex().name());
358
    	userContentRow.createCell(6).setCellValue(user.getUserId());
359
 
1498 vikas 360
    	userSerialNo+=2;
361
		Row addressHeaderRow = userSheet.createRow(userSerialNo++);
362
	    addressHeaderRow.createCell(0).setCellValue("Name");
363
	    addressHeaderRow.createCell(1).setCellValue("Line1");
364
	    addressHeaderRow.createCell(2).setCellValue("Line2");
365
	    addressHeaderRow.createCell(3).setCellValue("City");
366
	    addressHeaderRow.createCell(4).setCellValue("State");
367
	    addressHeaderRow.createCell(5).setCellValue("Pincode");
368
	    addressHeaderRow.createCell(6).setCellValue("Phone");
1738 vikas 369
	    for (int i=0; i<7 ;i++) {
370
            addressHeaderRow.getCell(i).setCellStyle(style);
371
        }
1498 vikas 372
 
1514 vikas 373
		List<Address> user_addresses = user.getAddresses();
374
		if (user_addresses != null && !user_addresses.isEmpty()) {
375
			for (Address address : user.getAddresses()) {
376
				if (user.getDefaultAddressId() == address.getId()) {
377
					userContentRow = userSheet.createRow(userSerialNo);
378
					userSheet.addMergedRegion(new CellRangeAddress(
379
							userSerialNo, userSerialNo, 0, 6));
380
					userContentRow.createCell(0)
381
							.setCellValue("Primary Address");
1738 vikas 382
					userContentRow.getCell(0).setCellStyle(style);
1514 vikas 383
 
384
					userSerialNo++;
385
					userContentRow = userSheet.createRow(userSerialNo);
386
					userContentRow.createCell(0)
387
							.setCellValue(address.getName());
388
					userContentRow.createCell(1).setCellValue(
389
							address.getLine1());
390
					userContentRow.createCell(2).setCellValue(
391
							address.getLine2());
392
					userContentRow.createCell(3)
393
							.setCellValue(address.getCity());
394
					userContentRow.createCell(4).setCellValue(
395
							address.getState());
396
					userContentRow.createCell(5).setCellValue(address.getPin());
397
					userContentRow.createCell(6).setCellValue(
398
							address.getPhone());
399
					userSerialNo += 3;
400
				}
1494 vikas 401
			}
1514 vikas 402
 
403
			userContentRow = userSheet.createRow(userSerialNo);
404
			userSheet.addMergedRegion(new CellRangeAddress(userSerialNo,
405
					userSerialNo, 0, 6));
406
			userContentRow.createCell(0).setCellValue("Other Addresses");
1738 vikas 407
			userContentRow.getCell(0).setCellStyle(style);
1514 vikas 408
 
409
			for (Address address : user.getAddresses()) {
410
				if (user.getDefaultAddressId() != address.getId()) {
411
					userSerialNo++;
412
					userContentRow = userSheet.createRow(userSerialNo);
413
					userContentRow.createCell(0)
414
							.setCellValue(address.getName());
415
					userContentRow.createCell(1).setCellValue(
416
							address.getLine1());
417
					userContentRow.createCell(2).setCellValue(
418
							address.getLine2());
419
					userContentRow.createCell(3)
420
							.setCellValue(address.getCity());
421
					userContentRow.createCell(4).setCellValue(
422
							address.getState());
423
					userContentRow.createCell(5).setCellValue(address.getPin());
424
					userContentRow.createCell(6).setCellValue(
425
							address.getPhone());
426
				}
1494 vikas 427
			}
428
 
429
 
1608 vikas 430
			userSerialNo+=2;
431
			userContentRow = userSheet.createRow(userSerialNo);
432
			userSheet.addMergedRegion(new CellRangeAddress(userSerialNo,
433
					userSerialNo, 0, 6));
434
			userContentRow.createCell(0).setCellValue("User Communication");
1738 vikas 435
			userContentRow.getCell(0).setCellStyle(style);
1608 vikas 436
			userSerialNo++;
437
			Row commHeaderRow = userSheet.createRow(userSerialNo);
438
		    commHeaderRow.createCell(0).setCellValue("Order Id");
439
		    commHeaderRow.createCell(1).setCellValue("Communication Type");
440
		    commHeaderRow.createCell(2).setCellValue("AirwayBill No");
441
		    commHeaderRow.createCell(3).setCellValue("TimeStamp");
442
		    commHeaderRow.createCell(4).setCellValue("Product Name");
443
		    commHeaderRow.createCell(5).setCellValue("Reply To");
444
		    commHeaderRow.createCell(6).setCellValue("Subject");
445
		    commHeaderRow.createCell(7).setCellValue("Message");
1738 vikas 446
		    for (int i=0; i<8 ;i++) {
447
	            commHeaderRow.getCell(i).setCellStyle(style);
448
	        }
1608 vikas 449
 
450
			for( UserCommunication userComm : userCommunications) {
451
				userSerialNo++;
452
				userContentRow = userSheet.createRow(userSerialNo);
453
				userContentRow.createCell(0).setCellValue(userComm.getOrderId());
454
				if (userComm.getCommunicationType() != null) {
455
					userContentRow.createCell(1).setCellValue(userComm.getCommunicationType().name());
456
				}
457
				userContentRow.createCell(2).setCellValue(userComm.getAirwaybillNo());
1744 vikas 458
				userContentRow.createCell(3).setCellValue(new Date(userComm.getCommunication_timestamp()));
459
				userContentRow.getCell(3).setCellStyle(dateCellStyle);
1608 vikas 460
				userContentRow.createCell(4).setCellValue(userComm.getProductName());
461
				userContentRow.createCell(5).setCellValue(userComm.getReplyTo());
462
				userContentRow.createCell(6).setCellValue(userComm.getSubject());
463
				userContentRow.createCell(7).setCellValue(userComm.getMessage());
1494 vikas 464
			}
1608 vikas 465
		}
1494 vikas 466
	}
1608 vikas 467
 
1494 vikas 468
	public String getErrorMsg() {
469
		return errorMsg;
470
	}
1608 vikas 471
}