cartgoodsinf.java

来自「采用struts+hibernet+javabean+jsp 些得shop购物网」· Java 代码 · 共 103 行

JAVA
103
字号
package com.hnzt.bean;

import java.math.BigDecimal;

public class CartGoodsInf implements java.io.Serializable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String uaername;
	private String goodsId,goodsName;
	private double goodsPrice;
	private int goodsAmount;
	private String pnumber;
	private String manu_number;
	private double totalPrice;
	
	public CartGoodsInf(String username,String goodsId,String goodsName,double goodsPrice,int goodsAmount,String pnumber,String manu_number)
	{
		this.uaername = username;
		this.goodsId=goodsId;
		this.goodsName=goodsName;
		this.goodsPrice=goodsPrice;
		this.goodsAmount=goodsAmount;
		this.pnumber = pnumber;
		this.manu_number = manu_number;
	} 
	
	
    public void setGoodsId(String goodsId)
	{
		this.goodsId=goodsId;
	}
	public void setGoodsName(String goodsName)
	{
		this.goodsName=goodsName;
	}
	public void setGoodsPrice(double goodsPrice)
	{
		this.goodsPrice=goodsPrice;
	}
    public void setGoodsAmount(int goodsAmount)
	{
		this.goodsAmount=goodsAmount;
	}
	
	public void setUaername(String uaername) {
		this.uaername = uaername;
	}

	public String getUaername() {
		return uaername;
	}


	public String getPnumber() {
		return pnumber;
	}


	public void setPnumber(String pnumber) {
		this.pnumber = pnumber;
	}


	public String getGoodsId()
	{
		return this.goodsId;
	}
	public String getGoodsName()
	{
		return this.goodsName;
	}
	public double getGoodsPrice()
	{
		return this.goodsPrice;
	}
	public int getGoodsAmount()
	{
		return this.goodsAmount;
	}
	
	
	public double getTotalPrice()
	{
		this.totalPrice=this.goodsPrice*(double)this.goodsAmount;
		BigDecimal total=new BigDecimal(this.totalPrice);
		total=total.setScale(2,5);
		this.totalPrice=total.doubleValue();
		return this.totalPrice;
	}


	public String getManu_number() {
		return manu_number;
	}


	public void setManu_number(String manu_number) {
		this.manu_number = manu_number;
	}
}

⌨️ 快捷键说明

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