Subversion Repositories SmartDukaan

Rev

Rev 20643 | Go to most recent revision | Details | 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
import in.shop2020.model.v1.user.Address;
5
 
6
import java.util.List;
7
 
8
public class ShipmentInfo {
9
	private double totalWeightInKg=0;
10
	private double totalAmount=0;
11
 
12
	private double totalShippingAmount=0;
13
	private  int totalPcs = 0;
14
	private Order order;
15
 
16
 
17
	public ShipmentInfo(List<Order> orders) {
18
		for(Order o : orders) {
19
			this.totalAmount += o.getTotal_amount();
20
			this.totalWeightInKg += o.getTotal_weight();
21
			this.totalShippingAmount += o.getShippingCost();
22
			this.totalPcs += o.getLineitems().get(0).getQuantity();
23
		}
24
		this.order = orders.get(0);
25
	}
26
 
27
	public double getTotalWeightInKg() {
28
		return totalWeightInKg;
29
	}
30
 
31
	public double getTotalAmount() {
32
		return totalAmount;
33
	}
34
 
35
	public double getTotalShippingAmount() {
36
		return totalShippingAmount;
37
	}
38
 
39
	public int getTotalPcs() {
40
		return totalPcs;
41
	}
42
 
43
	public Order getOrder() {
44
		return order;
45
	}
46
}