cartitem.java

来自「这是一个网上书店」· Java 代码 · 共 41 行

JAVA
41
字号
package com.ebookstore.dto;

import java.io.Serializable;

public class CartItem implements Serializable {

	private Item item;// 订单明细

	private int quantity;// 数量

	public Item getItem() {
		return item;
	}

	public void setItem(Item item) {
		this.item = item;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	// 获得当前明细的总价格
	public double getTotalPrice() {
		if (item != null) {
			return item.getBaseprice() * item.getDiscount() * quantity;
		} else {
			return 0;
		}
	}

	public void incrementQuantity() {
		quantity++;
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?