Subversion Repositories SmartDukaan

Rev

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