资源简介

传智播客巴巴运动网完整源码 ,最新的会员下载,下载后请给个评论

资源截图

代码片段和文件信息

package cn.itcast.bean;

import java.util.ArrayList;
import java.util.List;

import cn.itcast.bean.book.OrderContactInfo;
import cn.itcast.bean.book.OrderDeliverInfo;
import cn.itcast.bean.book.PaymentWay;

/**
 * 购物车
 */
public class BuyCart {
/* 购物项 */
private List items = new ArrayList();
/* 收货人配送信息 */
private OrderDeliverInfo deliverInfo;
/* 订购者联系信息 */
private OrderContactInfo contactInfo;
/* 收货人与订购者是否相同 */
private Boolean buyerIsrecipients;
/* 支付方式 */
private PaymentWay paymentWay;
/* 配送费 */
private float deliveFee = 10f;
/* 附言 */
private String note;

public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
public float getDeliveFee() {
return deliveFee;
}
public void setDeliveFee(float deliveFee) {
this.deliveFee = deliveFee;
}
public PaymentWay getPaymentWay() {
return paymentWay;
}
public void setPaymentWay(PaymentWay paymentWay) {
this.paymentWay = paymentWay;
}
public Boolean getBuyerIsrecipients() {
return buyerIsrecipients;
}
public void setBuyerIsrecipients(Boolean buyerIsrecipients) {
this.buyerIsrecipients = buyerIsrecipients;
}
public OrderDeliverInfo getDeliverInfo() {
return deliverInfo;
}
public void setDeliverInfo(OrderDeliverInfo deliverInfo) {
this.deliverInfo = deliverInfo;
}
public OrderContactInfo getContactInfo() {
return contactInfo;
}
public void setContactInfo(OrderContactInfo contactInfo) {
this.contactInfo = contactInfo;
}
/**
 * 添加购物项
 * @param item
 */
public void addBuyItem(BuyItem item){
if(items.contains(item)){//如果购物项已经存在于购物车累加其购买数量
for(BuyItem bItem : items){
if(bItem.equals(item)){
bItem.setAmount(bItem.getAmount()+1);
break;
}
}
}else{
items.add(item);
}
}
/**
 * 删除购物项
 * @param item
 */
public void deleteBuyItem(BuyItem item){
if(this.items.contains(item))
this.items.remove(item);
}
/**
 * 清空购物车
 */
public void deleteAll(){
items.clear();
}
public List getItems() {
return items;
}
/**
 * 计算商品的总金额
 */
public float getTotalSellPrice(){
float result = 0f;
for(BuyItem item : items){
result += item.getProduct().getSellprice() * item.getAmount();
}
return result;
}

/**
 * 计算商品的总节省金额
 */
public float getTotalSavePrice(){
float result = 0f;
for(BuyItem item : items){
result += item.getProduct().getMarketprice() * item.getAmount();
}
return result - getTotalSellPrice();
}
/**
 * 计算订单总金额
 * @return
 */
public float getOrderTotalPrice(){
return getTotalSellPrice() + getDeliveFee();
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        272  2008-08-03 09:58  src\arrowuploadfiletype.properties

     文件       4916  2009-12-09 11:26  src\beans.xml

     文件        496  2009-12-01 14:22  src\cn\itcast\bean\book\DeliverWay.java

     文件        510  2009-12-02 14:37  src\cn\itcast\bean\book\GeneratedOrderid.java

     文件       1967  2009-12-09 15:52  src\cn\itcast\bean\book\Message.java

     文件       5518  2009-12-09 16:01  src\cn\itcast\bean\book\Order.java

     文件       2847  2009-12-02 10:36  src\cn\itcast\bean\book\OrderContactInfo.java

     文件       3374  2009-12-02 10:32  src\cn\itcast\bean\book\OrderDeliverInfo.java

     文件       3014  2009-12-02 14:49  src\cn\itcast\bean\book\OrderItem.java

     文件        705  2009-12-04 15:33  src\cn\itcast\bean\book\OrderState.java

     文件        454  2009-12-01 14:26  src\cn\itcast\bean\book\PaymentWay.java

     文件       2820  2009-12-02 14:44  src\cn\itcast\bean\BuyCart.java

     文件       1414  2009-12-01 22:48  src\cn\itcast\bean\BuyItem.java

     文件       1084  2009-05-10 15:36  src\cn\itcast\bean\PageIndex.java

     文件       1730  2009-05-10 15:36  src\cn\itcast\bean\PageView.java

     文件       1639  2009-12-05 14:28  src\cn\itcast\bean\privilege\Department.java

     文件       4575  2009-12-07 11:22  src\cn\itcast\bean\privilege\Employee.java

     文件       2178  2009-12-05 14:19  src\cn\itcast\bean\privilege\IDCard.java

     文件       2300  2009-12-17 16:05  src\cn\itcast\bean\privilege\PrivilegeGroup.java

     文件       1812  2009-12-17 16:06  src\cn\itcast\bean\privilege\SystemPrivilege.java

     文件       1600  2009-12-17 16:04  src\cn\itcast\bean\privilege\SystemPrivilegePK.java

     文件       2152  2009-12-08 11:41  src\cn\itcast\bean\product\Brand.java

     文件       6785  2009-12-08 11:36  src\cn\itcast\bean\product\ProductInfo.java

     文件       3084  2009-12-08 11:41  src\cn\itcast\bean\product\Productstyle.java

     文件       3376  2009-12-08 11:41  src\cn\itcast\bean\product\ProductType.java

     文件        242  2009-05-10 15:44  src\cn\itcast\bean\product\Sex.java

     文件        444  2009-05-10 15:36  src\cn\itcast\bean\QueryResult.java

     文件       1674  2009-05-10 15:44  src\cn\itcast\bean\uploadfile\UploadFile.java

     文件       3329  2009-05-10 15:44  src\cn\itcast\bean\user\Buyer.java

     文件       2200  2009-05-10 15:44  src\cn\itcast\bean\user\ContactInfo.java

............此处省略1314个文件信息

评论

共有 条评论