Subversion Repositories SmartDukaan

Rev

Rev 6791 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6791 Rev 7217
Line 135... Line 135...
135
            e.printStackTrace();
135
            e.printStackTrace();
136
        }
136
        }
137
        return "index";
137
        return "index";
138
    }
138
    }
139
    
139
    
-
 
140
    
-
 
141
    private Date getCorrectedDate(Date uf){
-
 
142
    	Calendar cal = Calendar.getInstance();  
-
 
143
        cal.setTime(uf);	
-
 
144
        cal.set(Calendar.HOUR_OF_DAY, 0);  
-
 
145
        cal.set(Calendar.MINUTE, 0);  
-
 
146
        cal.set(Calendar.SECOND, 0);  
-
 
147
        cal.set(Calendar.MILLISECOND, 0);
-
 
148
        return cal.getTime();
-
 
149
    }
-
 
150
      
-
 
151
      
-
 
152
  
-
 
153
    
140
    private ByteArrayOutputStream getSpreadSheetData() {
154
    private ByteArrayOutputStream getSpreadSheetData() {
141
        ByteArrayOutputStream baosXLS = new ByteArrayOutputStream();
155
        ByteArrayOutputStream baosXLS = new ByteArrayOutputStream();
142
 
156
 
143
        Workbook wb = new HSSFWorkbook();
157
        Workbook wb = new HSSFWorkbook();
144
 
158
 
Line 243... Line 257...
243
            commContentRow.createCell(3).setCellValue(order.getAirwaybill_no());
257
            commContentRow.createCell(3).setCellValue(order.getAirwaybill_no());
244
            commContentRow.createCell(4).setCellValue(order.getCustomer_pincode());
258
            commContentRow.createCell(4).setCellValue(order.getCustomer_pincode());
245
            commContentRow.createCell(5).setCellValue(order.getCustomer_city());
259
            commContentRow.createCell(5).setCellValue(order.getCustomer_city());
246
            commContentRow.createCell(6).setCellValue(logisticProviderMap.get(order.getLogistics_provider_id()));
260
            commContentRow.createCell(6).setCellValue(logisticProviderMap.get(order.getLogistics_provider_id()));
247
            
261
            
248
            commContentRow.createCell(7).setCellValue(new Date(order.getCreated_timestamp()));
262
            commContentRow.createCell(7).setCellValue(getCorrectedDate(new Date(order.getCreated_timestamp())));
249
            commContentRow.getCell(7).setCellStyle(dateCellStyle);
263
            commContentRow.getCell(7).setCellStyle(dateCellStyle);
250
            
264
            
251
            commContentRow.createCell(8).setCellValue(new Date(order.getPromised_shipping_time()));
265
            commContentRow.createCell(8).setCellValue(getCorrectedDate(new Date(order.getPromised_shipping_time())));
252
            commContentRow.getCell(8).setCellStyle(dateCellStyle);
266
            commContentRow.getCell(8).setCellStyle(dateCellStyle);
253
            
267
            
254
            commContentRow.createCell(9).setCellValue(new Date(order.getShipping_timestamp()));
268
            commContentRow.createCell(9).setCellValue(getCorrectedDate(new Date(order.getShipping_timestamp())));
255
            commContentRow.getCell(9).setCellStyle(dateCellStyle);
269
            commContentRow.getCell(9).setCellStyle(dateCellStyle);
256
            
270
            
257
            if (order.getFirst_attempt_timestamp() != 0) {
271
            if (order.getFirst_attempt_timestamp() != 0) {
258
                commContentRow.createCell(10).setCellValue(new Date(order.getFirst_attempt_timestamp()));
272
                commContentRow.createCell(10).setCellValue(getCorrectedDate(new Date(order.getFirst_attempt_timestamp())));
259
                commContentRow.getCell(10).setCellStyle(dateCellStyle);
273
                commContentRow.getCell(10).setCellStyle(dateCellStyle);
260
            } else {
274
            } else {
261
                commContentRow.createCell(10).setCellValue("N/A");
275
                commContentRow.createCell(10).setCellValue("N/A");
262
            }
276
            }
263
            
277
            
264
            commContentRow.createCell(11).setCellValue(new Date(order.getPromised_delivery_time()));
278
            commContentRow.createCell(11).setCellValue(getCorrectedDate(new Date(order.getPromised_delivery_time())));
265
            commContentRow.getCell(11).setCellStyle(dateCellStyle);
279
            commContentRow.getCell(11).setCellStyle(dateCellStyle);
266
            
280
            
267
            commContentRow.createCell(12).setCellValue(new Date(order.getExpected_delivery_time()));
281
            commContentRow.createCell(12).setCellValue(getCorrectedDate(new Date(order.getExpected_delivery_time())));
268
            commContentRow.getCell(12).setCellStyle(dateCellStyle);
282
            commContentRow.getCell(12).setCellStyle(dateCellStyle);
269
            
283
            
270
            commContentRow.createCell(13).setCellValue(new Date(order.getCourier_delivery_time()));
284
            commContentRow.createCell(13).setCellValue(getCorrectedDate(new Date(order.getCourier_delivery_time())));
271
            commContentRow.getCell(13).setCellStyle(dateCellStyle);
285
            commContentRow.getCell(13).setCellStyle(dateCellStyle);
272
 
286
 
273
            if (order.getDelivery_timestamp() != 0) {
287
            if (order.getDelivery_timestamp() != 0) {
274
                //When our courier partners declare a shipment as RTO we mark that time as delivered timestamp in our DB.
288
                //When our courier partners declare a shipment as RTO we mark that time as delivered timestamp in our DB.
275
                commContentRow.createCell(14).setCellValue(new Date(order.getDelivery_timestamp()));//This is actually RTO Declare date.
289
                commContentRow.createCell(14).setCellValue(getCorrectedDate(new Date(order.getDelivery_timestamp())));//This is actually RTO Declare date.
276
                commContentRow.getCell(14).setCellStyle(dateCellStyle);
290
                commContentRow.getCell(14).setCellStyle(dateCellStyle);
277
            } else {
291
            } else {
278
                commContentRow.createCell(14).setCellValue("N/A");
292
                commContentRow.createCell(14).setCellValue("N/A");
279
            }
293
            }
280
            
294
            
281
            if (order.getReceived_return_timestamp() != 0) {
295
            if (order.getReceived_return_timestamp() != 0) {
282
                commContentRow.createCell(15).setCellValue(new Date(order.getReceived_return_timestamp()));
296
                commContentRow.createCell(15).setCellValue(getCorrectedDate(new Date(order.getReceived_return_timestamp())));
283
                commContentRow.getCell(15).setCellStyle(dateCellStyle);
297
                commContentRow.getCell(15).setCellStyle(dateCellStyle);
284
            } else {
298
            } else {
285
                commContentRow.createCell(15).setCellValue("N/A");
299
                commContentRow.createCell(15).setCellValue("N/A");
286
            }
300
            }
287
            
301
            
288
            if (order.getRefund_timestamp() != 0) {
302
            if (order.getRefund_timestamp() != 0) {
289
                commContentRow.createCell(16).setCellValue(new Date(order.getRefund_timestamp()));
303
                commContentRow.createCell(16).setCellValue(getCorrectedDate(new Date(order.getRefund_timestamp())));
290
                commContentRow.getCell(16).setCellStyle(dateCellStyle);
304
                commContentRow.getCell(16).setCellStyle(dateCellStyle);
291
            } else {
305
            } else {
292
                commContentRow.createCell(16).setCellValue("N/A");
306
                commContentRow.createCell(16).setCellValue("N/A");
293
            }
307
            }
294
            
308
            
295
            if (order.getReship_timestamp() != 0) {
309
            if (order.getReship_timestamp() != 0) {
296
                commContentRow.createCell(17).setCellValue(new Date(order.getReship_timestamp()));
310
                commContentRow.createCell(17).setCellValue(getCorrectedDate(new Date(order.getReship_timestamp())));
297
                commContentRow.getCell(17).setCellStyle(dateCellStyle);
311
                commContentRow.getCell(17).setCellStyle(dateCellStyle);
298
            } else {
312
            } else {
299
                commContentRow.createCell(17).setCellValue("N/A");
313
                commContentRow.createCell(17).setCellValue("N/A");
300
            }
314
            }
301
            
315
            
Line 394... Line 408...
394
            commContentRow.createCell(3).setCellValue(order.getAirwaybill_no());
408
            commContentRow.createCell(3).setCellValue(order.getAirwaybill_no());
395
            commContentRow.createCell(4).setCellValue(order.getCustomer_pincode());
409
            commContentRow.createCell(4).setCellValue(order.getCustomer_pincode());
396
            commContentRow.createCell(5).setCellValue(order.getCustomer_city());
410
            commContentRow.createCell(5).setCellValue(order.getCustomer_city());
397
            commContentRow.createCell(6).setCellValue(logisticProviderMap.get(order.getLogistics_provider_id()));
411
            commContentRow.createCell(6).setCellValue(logisticProviderMap.get(order.getLogistics_provider_id()));
398
            
412
            
399
            commContentRow.createCell(7).setCellValue(new Date(order.getCreated_timestamp()));
413
            commContentRow.createCell(7).setCellValue(getCorrectedDate(new Date(order.getCreated_timestamp())));
400
            commContentRow.getCell(7).setCellStyle(dateCellStyle);
414
            commContentRow.getCell(7).setCellStyle(dateCellStyle);
401
            
415
            
402
            if (order.getPromised_shipping_time() != 0) {
416
            if (order.getPromised_shipping_time() != 0) {
403
                commContentRow.createCell(8).setCellValue(new Date(order.getPromised_shipping_time()));
417
                commContentRow.createCell(8).setCellValue(getCorrectedDate(new Date(order.getPromised_shipping_time())));
404
                commContentRow.getCell(8).setCellStyle(dateCellStyle);
418
                commContentRow.getCell(8).setCellStyle(dateCellStyle);
405
            } else {
419
            } else {
406
                commContentRow.createCell(8).setCellValue("N/A");
420
                commContentRow.createCell(8).setCellValue("N/A");
407
            }
421
            }
408
            
422
            
409
            commContentRow.createCell(9).setCellValue(new Date(order.getShipping_timestamp()));
423
            commContentRow.createCell(9).setCellValue(getCorrectedDate(new Date(order.getShipping_timestamp())));
410
            commContentRow.getCell(9).setCellStyle(dateCellStyle);
424
            commContentRow.getCell(9).setCellStyle(dateCellStyle);
411
            
425
            
412
            if (order.getFirst_attempt_timestamp() != 0) {
426
            if (order.getFirst_attempt_timestamp() != 0) {
413
                commContentRow.createCell(10).setCellValue(new Date(order.getFirst_attempt_timestamp()));
427
                commContentRow.createCell(10).setCellValue(getCorrectedDate(new Date(order.getFirst_attempt_timestamp())));
414
                commContentRow.getCell(10).setCellStyle(dateCellStyle);
428
                commContentRow.getCell(10).setCellStyle(dateCellStyle);
415
            } else {
429
            } else {
416
                commContentRow.createCell(10).setCellValue("N/A");
430
                commContentRow.createCell(10).setCellValue("N/A");
417
            }
431
            }
418
            
432
            
419
            commContentRow.createCell(11).setCellValue(new Date(order.getPromised_delivery_time()));
433
            commContentRow.createCell(11).setCellValue(getCorrectedDate(new Date(order.getPromised_delivery_time())));
420
            commContentRow.getCell(11).setCellStyle(dateCellStyle);
434
            commContentRow.getCell(11).setCellStyle(dateCellStyle);
421
            
435
            
422
            if (order.getDelivery_timestamp() != 0) { 
436
            if (order.getDelivery_timestamp() != 0) { 
423
                commContentRow.createCell(12).setCellValue(new Date(order.getExpected_delivery_time()));
437
                commContentRow.createCell(12).setCellValue(getCorrectedDate(new Date(order.getExpected_delivery_time())));
424
                commContentRow.getCell(12).setCellStyle(dateCellStyle);
438
                commContentRow.getCell(12).setCellStyle(dateCellStyle);
425
            } else {
439
            } else {
426
                commContentRow.createCell(12).setCellValue("N/A");
440
                commContentRow.createCell(12).setCellValue("N/A");
427
            }
441
            }
428
            
442
            
429
            if (order.getDelivery_timestamp() != 0) { 
443
            if (order.getDelivery_timestamp() != 0) { 
430
                commContentRow.createCell(13).setCellValue(new Date(order.getCourier_delivery_time()));
444
                commContentRow.createCell(13).setCellValue(getCorrectedDate(new Date(order.getCourier_delivery_time())));
431
                commContentRow.getCell(13).setCellStyle(dateCellStyle);
445
                commContentRow.getCell(13).setCellStyle(dateCellStyle);
432
            } else {
446
            } else {
433
                commContentRow.createCell(13).setCellValue("N/A");
447
                commContentRow.createCell(13).setCellValue("N/A");
434
            }
448
            }
435
 
449
 
436
            if (order.getDelivery_timestamp() != 0) {    
450
            if (order.getDelivery_timestamp() != 0) {    
437
                commContentRow.createCell(14).setCellValue(new Date(order.getDelivery_timestamp()));
451
                commContentRow.createCell(14).setCellValue(getCorrectedDate(new Date(order.getDelivery_timestamp())));
438
                commContentRow.getCell(14).setCellStyle(dateCellStyle);
452
                commContentRow.getCell(14).setCellStyle(dateCellStyle);
439
            } else {
453
            } else {
440
                commContentRow.createCell(14).setCellValue("N/A");
454
                commContentRow.createCell(14).setCellValue("N/A");
441
            }
455
            }
442
            
456