//Source file: D:\\com\\yema\\pom\\domain\\Order.java
package com.yema.pom.domain;
import java.util.Date;
import java.util.TreeSet;
public class Order implements java.io.Serializable {
private static final long serialVersionUID = 2756054405310038433L;
private Integer poNo;
private Date orderDate;
private Date shipDate;
private String toStreet;
private String toCity;
private String toState;
private String toZip;
private Double total;
public Customer customer;
private java.util.Set<LineItem> lineItems = null;
public Order() {
}
public boolean addLineItem(LineItem lineItem) {
if (lineItems == null) {
lineItems = new TreeSet<LineItem>();
}
lineItem.setOrder(this);
lineItem.setLineNo(lineItems.size() + 1);
return lineItems.add(lineItem);
}
@Override
public String toString(){
return "(" + customer.getCustNo() + ", " + poNo + ", " + orderDate + ", " + shipDate + ", " + toStreet + ", " + toCity + ", " + toState + ", " + toZip + ")";
}
@Override
public boolean equals(Object obj) {
if (obj == null)
return false;
Order other = (Order) obj;
if (this.getPoNo().equals(other.getPoNo())) {
return true;
} else {
return false;
}
}
@Override
public int hashCode() {
return poNo;
}
public Integer getPoNo() {
return poNo;
}
public void setPoNo(Integer poNo) {
this.poNo = poNo;
}
public Date getShipDate() {
return shipDate;
}
public void setShipDate(Date shipDate) {
this.shipDate = shipDate;
}
public String getToStreet() {
return toStreet;
}
public void setToStreet(String toStreet) {
this.toStreet = toStreet;
}
public String getToCity() {
return toCity;
}
public void setToCity(String toCity) {
this.toCity = toCity;
}
public String getToState() {
return toState;
}
public void setToState(String toState) {
this.toState = toState;
}
public String getToZip() {
return toZip;
}
public void setToZip(String toZip) {
this.toZip = toZip;
}
public Double getTotal() {
total = 0.0;
System.out.println("^^^^^^^^^^^^^^^^^^^" + lineItems);
for(LineItem item : lineItems){
System.out.println("****************" + item);
System.out.println("****************" + item.getStockItem());
total = total + (item.getquantity() * item.getStockItem().getPrice())*(1 - item.getDiscount());
}
return total;
}
public void setTotal(Double total) {
this.total = total;
}
public Customer getCustomer() {
return customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
public java.util.Set<LineItem> getLineItems() {
return lineItems;
}
public void setLineItems(java.util.Set<LineItem> lineItems) {
this.lineItems = lineItems;
}
public Date getOrderDate() {
return orderDate;
}
public void setOrderDate(Date orderDate) {
this.orderDate = orderDate;
}
}
用JAVA编写的超市购物管理系统
5星 · 超过95%的资源 需积分: 49 186 浏览量
2008-05-03
01:59:50
上传
评论 11
收藏 25KB ZIP 举报
longhumen
- 粉丝: 3
- 资源: 48
最新资源
- 430975883187781蝴蝶(1).apk
- 北航操作系统实验课程源代码+报告.zip
- 基于Pytorch+YOLOv5+SlowFast实现的视频流实时动作检测算法-支持多目标的跟踪检测源码+项目说明.zip
- 遗传算法求解三维装箱问题.rar
- ThinkPHP5多小区物业管理系统源码PHP物业管理系统.zip
- 基于flask,Navicat和爬虫的可视化岗位分析网站.zip
- 部署yolov10的ncnn模型到android源码+模型+项目说明.zip
- Go语言网络层脚手架代码资料项目间共用的网络层.zip
- 基于monaco-editor的sql编辑器,支持sql语法联想、高亮.zip
- 网络安全相关的RSS订阅列表资料.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
前往页