Subversion Repositories SmartDukaan

Rev

Rev 2223 | Rev 2268 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2223 Rev 2224
Line 528... Line 528...
528
		context.put("sex", sex);
528
		context.put("sex", sex);
529
		htmlString = getHtmlFromVelocity(templateFile, context);
529
		htmlString = getHtmlFromVelocity(templateFile, context);
530
		return htmlString;
530
		return htmlString;
531
	}
531
	}
532
	
532
	
533
	public String getCompletedOrdersHtml(long userId) {
-
 
534
		String htmlString = "";
-
 
535
		VelocityContext context = new VelocityContext();
-
 
536
		String templateFile = "templates/completedorders.vm";
-
 
537
		TransactionServiceClient transactionServiceClient = null;
-
 
538
		in.shop2020.model.v1.order.TransactionService.Client orderClient = null;
-
 
539
		
-
 
540
		List<Order> orders = null;
-
 
541
		List<String> orderDate = new ArrayList<String>();
-
 
542
		Map<Long, String> providerNames = new HashMap<Long, String>();
-
 
543
		
-
 
544
		try{
-
 
545
			transactionServiceClient = new TransactionServiceClient();
-
 
546
			orderClient = transactionServiceClient.getClient();
-
 
547
			orders = orderClient.getOrdersForCustomer(userId, 0, (new Date()).getTime(), OrderStatus.DELIVERY_SUCCESS);
-
 
548
 
-
 
549
			LogisticsServiceClient logisticsServiceClient = new LogisticsServiceClient();
-
 
550
			in.shop2020.logistics.LogisticsService.Client logisticsClient = logisticsServiceClient.getClient();
-
 
551
			List<Provider> providers = logisticsClient.getAllProviders();
-
 
552
			for(Provider provider: providers)
-
 
553
				providerNames.put(provider.getId(), provider.getName());
-
 
554
 
-
 
555
			SimpleDateFormat dateformat = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss aa");
-
 
556
			
-
 
557
			if(orders != null && !orders.isEmpty()){
-
 
558
				for(Order order: orders){
-
 
559
					Date orderedOn = new Date(order.getCreated_timestamp());
-
 
560
					orderDate.add(dateformat.format(orderedOn));
-
 
561
				}
-
 
562
			}
-
 
563
		}catch (Exception e){
-
 
564
			
-
 
565
		}
-
 
566
		context.put("orders", orders);
-
 
567
		context.put("orderDate", orderDate);
-
 
568
		context.put("providerNames", providerNames);
-
 
569
		
-
 
570
		htmlString = getHtmlFromVelocity(templateFile, context);
-
 
571
		return htmlString;
-
 
572
	}
-
 
573
	public String getMyaccountHeaderHtml() {
533
	public String getMyaccountHeaderHtml() {
574
		String htmlString = "";
534
		String htmlString = "";
575
		VelocityContext context = new VelocityContext();
535
		VelocityContext context = new VelocityContext();
576
		String templateFile = "templates/myaccountheader.vm";
536
		String templateFile = "templates/myaccountheader.vm";
577
		htmlString = getHtmlFromVelocity(templateFile, context);
537
		htmlString = getHtmlFromVelocity(templateFile, context);
578
		return htmlString;
538
		return htmlString;
579
	}
539
	}
580
 
540
 
581
 
-
 
582
	public String getShippingAddressDetailsHtml(long userId, String errorMsg){
541
	public String getShippingAddressDetailsHtml(long userId, String errorMsg){
583
		String htmlString = "";
542
		String htmlString = "";
584
		VelocityContext context = new VelocityContext();
543
		VelocityContext context = new VelocityContext();
585
		String templateFile = "templates/shippingaddressdetails.vm";
544
		String templateFile = "templates/shippingaddressdetails.vm";
586
		long defaultAddressId = 0;
545
		long defaultAddressId = 0;