Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
20642 amit.gupta 1
package com.providers.logistics;
2
 
3
import in.shop2020.model.v1.order.Order;
4
 
5
import java.util.List;
6
 
7
public class ShipmentInfo {
8
	private double totalWeightInKg=0;
9
	private double totalAmount=0;
10
 
11
	private double totalShippingAmount=0;
12
	private  int totalPcs = 0;
13
	private Order order;
14
 
15
 
16
	public ShipmentInfo(List<Order> orders) {
17
		for(Order o : orders) {
18
			this.totalAmount += o.getTotal_amount();
19
			this.totalWeightInKg += o.getTotal_weight();
20
			this.totalShippingAmount += o.getShippingCost();
21
			this.totalPcs += o.getLineitems().get(0).getQuantity();
22
		}
23
		this.order = orders.get(0);
24
	}
25
 
26
	public double getTotalWeightInKg() {
27
		return totalWeightInKg;
28
	}
29
 
30
	public double getTotalAmount() {
31
		return totalAmount;
32
	}
33
 
34
	public double getTotalShippingAmount() {
35
		return totalShippingAmount;
36
	}
37
 
38
	public int getTotalPcs() {
39
		return totalPcs;
40
	}
41
 
42
	public Order getOrder() {
43
		return order;
44
	}
45
}