Browse Source

客户采购订单 增加待交货显示

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@2301 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
yuj 10 years ago
parent
commit
0665362053

+ 370 - 0
src/main/java/com/uas/platform/b2b/model/PurchaseOrderWaiting.java

@@ -0,0 +1,370 @@
+package com.uas.platform.b2b.model;
+
+import java.util.Date;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
+import javax.persistence.OneToOne;
+import javax.persistence.OrderBy;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.Where;
+
+/** 
+  * @author yujia 
+  * @version 创建时间:2015年12月29日 上午11:25:19 
+  * 待交货的采购订单
+  */
+
+@Table(name = "purc$orders", indexes = { @Index(name = "purc$orders_date", columnList = "pu_date") })
+@Entity
+@Where(clause = "pu_end=0 or pu_end is null")
+public class PurchaseOrderWaiting {
+	
+	@Id
+	@Column(name = "pu_id")
+	private Long id;
+	
+	/**
+	 * 采购企业UU
+	 */
+	@Column(name = "pu_enuu")
+	private Long enUU;
+
+	/**
+	 * 采购企业
+	 */
+	@OneToOne(cascade = { CascadeType.MERGE, CascadeType.REFRESH })
+	@JoinColumn(name = "pu_enuu", insertable = false, updatable = false)
+	private EnterpriseInfo enterprise;
+
+	/**
+	 * 采购单所属采购员
+	 */
+	@OneToOne(cascade = { CascadeType.REFRESH })
+	@JoinColumn(name = "pu_useruu", insertable = false, updatable = false)
+	private UserBaseInfo user;
+
+	/**
+	 * 采购单所属采购员UU
+	 */
+	@Column(name = "pu_useruu")
+	private Long userUU;
+
+	/**
+	 * 采购单号
+	 */
+	@Column(name = "pu_code")
+	private String code;
+
+	/**
+	 * 采购类型
+	 */
+	@Column(name = "pu_type")
+	private String type;
+
+	/**
+	 * 单据归属日期
+	 */
+	@Column(name = "pu_date")
+	private Date date;
+
+	/**
+	 * 录单人
+	 */
+	@Column(name = "pu_recorder")
+	private String recorder;
+
+	/**
+	 * 审核人
+	 */
+	@Column(name = "pu_auditor")
+	private String auditor;
+
+	/**
+	 * 供应商UU
+	 */
+	@Column(name = "pu_venduu")
+	private Long vendUU;
+
+	/**
+	 * 供应商联系人UU
+	 */
+	@Column(name = "pu_venduseruu")
+	private Long vendUserUU;
+
+	/**
+	 * 收货地址
+	 */
+	@Column(name = "pu_shipaddress")
+	private String shipAddress;
+
+	/**
+	 * 备注
+	 */
+	@Column(name = "pu_remark")
+	private String remark;
+
+	/**
+	 * 付款币种
+	 */
+	@Column(name = "pu_currency")
+	private String currency;
+
+	/**
+	 * 汇率
+	 */
+	@Column(name = "pu_rate")
+	private Float rate;
+
+	/**
+	 * 付款方式
+	 */
+	@Column(name = "pu_payments")
+	private String payments;
+
+	/**
+	 * 处理状态(已回复、未回复),全部回复后改为已回复
+	 */
+	@Column(name = "pu_status")
+	private Short status;
+
+	/**
+	 * 从平台传到供应商ERP的状态
+	 */
+	@Column(name = "pu_sendstatus")
+	private Short sendStatus;
+
+	/**
+	 * 采购单明细
+	 */
+	@OneToMany(mappedBy = "order", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE, CascadeType.MERGE }, fetch = FetchType.EAGER)
+	@OrderBy("number")
+	@Where(clause = "nvl(pd_acceptqty,0)<nvl(pd_qty,0)+nvl(pd_returnqty,0)")
+	private Set<PurchaseOrderWaitingItem> orderItems;
+	
+	/**
+	 * 显示状态(0 已查看 , 1 未查看, 2 置顶)
+	 */
+	@Column(name = "pu_display")
+	private Short display;
+	
+	/**
+	 * 打印次数
+	 */
+	@Column(name = "pu_print")
+	private Short print;
+
+	/**
+	 * 应付供应商名称
+	 */
+	@Column(name = "pu_receivename")
+	private String receiveName;
+
+	/**
+	 * 应付供应商编号
+	 */
+	@Column(name = "pu_receivecode")
+	private String receiveCode;
+	
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getEnUU() {
+		return enUU;
+	}
+
+	public void setEnUU(Long enUU) {
+		this.enUU = enUU;
+	}
+
+	public EnterpriseInfo getEnterprise() {
+		return enterprise;
+	}
+
+	public void setEnterprise(EnterpriseInfo enterprise) {
+		this.enterprise = enterprise;
+	}
+
+	public UserBaseInfo getUser() {
+		return user;
+	}
+
+	public void setUser(UserBaseInfo user) {
+		this.user = user;
+	}
+
+	public Long getUserUU() {
+		return userUU;
+	}
+
+	public void setUserUU(Long userUU) {
+		this.userUU = userUU;
+	}
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public Date getDate() {
+		return date;
+	}
+
+	public void setDate(Date date) {
+		this.date = date;
+	}
+
+	public String getRecorder() {
+		return recorder;
+	}
+
+	public void setRecorder(String recorder) {
+		this.recorder = recorder;
+	}
+
+	public String getAuditor() {
+		return auditor;
+	}
+
+	public void setAuditor(String auditor) {
+		this.auditor = auditor;
+	}
+
+	public Long getVendUU() {
+		return vendUU;
+	}
+
+	public void setVendUU(Long vendUU) {
+		this.vendUU = vendUU;
+	}
+
+	public Long getVendUserUU() {
+		return vendUserUU;
+	}
+
+	public void setVendUserUU(Long vendUserUU) {
+		this.vendUserUU = vendUserUU;
+	}
+
+	public String getShipAddress() {
+		return shipAddress;
+	}
+
+	public void setShipAddress(String shipAddress) {
+		this.shipAddress = shipAddress;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public String getCurrency() {
+		return currency;
+	}
+
+	public void setCurrency(String currency) {
+		this.currency = currency;
+	}
+
+	public Float getRate() {
+		return rate;
+	}
+
+	public void setRate(Float rate) {
+		this.rate = rate;
+	}
+
+	public String getPayments() {
+		return payments;
+	}
+
+	public void setPayments(String payments) {
+		this.payments = payments;
+	}
+
+	public Short getStatus() {
+		return status;
+	}
+
+	public void setStatus(Short status) {
+		this.status = status;
+	}
+
+	public Short getSendStatus() {
+		return sendStatus;
+	}
+
+	public void setSendStatus(Short sendStatus) {
+		this.sendStatus = sendStatus;
+	}
+
+	public Set<PurchaseOrderWaitingItem> getOrderItems() {
+		return orderItems;
+	}
+
+	public void setOrderItems(Set<PurchaseOrderWaitingItem> orderItems) {
+		this.orderItems = orderItems;
+	}
+
+	public Short getDisplay() {
+		if(this.display == null) this.display = 0;
+		return display;
+	}
+
+	public void setDisplay(Short display) {
+		this.display = display;
+	}
+
+	public Short getPrint() {
+		return print;
+	}
+
+	public void setPrint(Short print) {
+		this.print = print;
+	}
+
+	public String getReceiveName() {
+		return receiveName;
+	}
+
+	public void setReceiveName(String receiveName) {
+		this.receiveName = receiveName;
+	}
+
+	public String getReceiveCode() {
+		return receiveCode;
+	}
+
+	public void setReceiveCode(String receiveCode) {
+		this.receiveCode = receiveCode;
+	}
+}

+ 331 - 0
src/main/java/com/uas/platform/b2b/model/PurchaseOrderWaitingItem.java

@@ -0,0 +1,331 @@
+package com.uas.platform.b2b.model;
+
+import java.util.Date;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+
+import org.codehaus.jackson.annotate.JsonIgnore;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.uas.platform.b2b.support.SystemSession;
+
+@Table(name = "purc$orderitems")
+@Entity
+public class PurchaseOrderWaitingItem {
+
+	@Id
+	@Column(name = "pd_id")
+	private Long id;
+
+	/**
+	 * 序号
+	 */
+	@Column(name = "pd_number")
+	private Short number;
+
+	/**
+	 * 采购订单
+	 */
+	@ManyToOne(cascade = CascadeType.ALL, optional = true)
+	@JoinColumn(name = "pd_puid", nullable = false)
+	private PurchaseOrderWaiting order;
+
+	/**
+	 * 产品ID
+	 */
+	@Column(name = "pd_prid")
+	private Long productId;
+
+	/**
+	 * 产品
+	 */
+	@OneToOne(cascade = { CascadeType.REFRESH })
+	@JoinColumn(name = "pd_prid", insertable = false, updatable = false)
+	private Product product;
+
+	/**
+	 * 数量
+	 */
+	@Column(name = "pd_qty")
+	private Double qty;
+
+	/**
+	 * 已回复的数量
+	 */
+	@Column(name = "pd_replyqty")
+	private Double replyQty;
+
+	/**
+	 * (最近一次)回复的交期
+	 */
+	@Column(name = "pd_replydelivery")
+	private Date replyDelivery;
+
+	/**
+	 * (最近一次)回复的备注
+	 */
+	@Column(name = "pd_replyremark")
+	private String replyRemark;
+
+	/**
+	 * 备注
+	 */
+	@Column(name = "pd_remark")
+	private String remark;
+
+	/**
+	 * 含税单价
+	 */
+	@Column(name = "pd_price")
+	private Double price;
+
+	/**
+	 * 税率
+	 */
+	@Column(name = "pd_taxrate")
+	private Float taxrate;
+
+	/**
+	 * 处理状态(已回复、未回复),全部回复后改为已回复
+	 */
+	@Column(name = "pd_status", insertable = false, updatable = false)
+	private Short status;
+
+	/**
+	 * 含税金额
+	 */
+	@Column(name = "pd_amount", insertable = false, updatable = false)
+	private Double amount;
+
+	/**
+	 * 不含税单价
+	 */
+	@Column(name = "pd_notaxprice", insertable = false, updatable = false)
+	private Double noTaxPrice;
+
+	/**
+	 * 不含税金额
+	 */
+	@Column(name = "pd_notaxamount", insertable = false, updatable = false)
+	private Double noTaxAmount;
+
+	/**
+	 * 交货日期
+	 */
+	@Column(name = "pd_delivery")
+	private Date delivery;
+
+	/**
+	 * 是否已结案
+	 */
+	@Column(name = "pd_end")
+	private Short end;
+	
+	/**
+	 * 客户已验收数量
+	 */
+	@Column(name = "pd_acceptqty")
+	private Double acceptQty;
+
+	/**
+	 * 客户验退数量
+	 */
+	@Column(name = "pd_returnqty")
+	private Double returnQty;
+
+	/**
+	 * 关键词查询相关
+	 */
+	@Transient
+	private Boolean key;
+	
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Short getNumber() {
+		return number;
+	}
+
+	public void setNumber(Short number) {
+		this.number = number;
+	}
+
+	public Long getProductId() {
+		return productId;
+	}
+
+	public void setProductId(Long productId) {
+		this.productId = productId;
+	}
+
+	public Product getProduct() {
+		return product;
+	}
+
+	public void setProduct(Product product) {
+		this.product = product;
+	}
+
+	@JsonIgnore
+	@JSONField(serialize = false)
+	public PurchaseOrderWaiting getOrder() {
+		return order;
+	}
+
+	public void setOrder(PurchaseOrderWaiting order) {
+		this.order = order;
+	}
+
+	public Double getQty() {
+		return qty;
+	}
+
+	public void setQty(Double qty) {
+		this.qty = qty;
+	}
+
+	public Double getReplyQty() {
+		return replyQty;
+	}
+
+	public void setReplyQty(Double replyQty) {
+		this.replyQty = replyQty;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public Double getPrice() {
+		return price;
+	}
+
+	public void setPrice(Double price) {
+		this.price = price;
+	}
+
+	public Float getTaxrate() {
+		return taxrate;
+	}
+
+	public void setTaxrate(Float taxrate) {
+		this.taxrate = taxrate;
+	}
+
+	public Double getAmount() {
+		return amount;
+	}
+
+	public void setAmount(Double amount) {
+		this.amount = amount;
+	}
+
+	public Double getNoTaxPrice() {
+		return noTaxPrice;
+	}
+
+	public void setNoTaxPrice(Double noTaxPrice) {
+		this.noTaxPrice = noTaxPrice;
+	}
+
+	public Double getNoTaxAmount() {
+		return noTaxAmount;
+	}
+
+	public void setNoTaxAmount(Double noTaxAmount) {
+		this.noTaxAmount = noTaxAmount;
+	}
+
+	public Date getDelivery() {
+		return delivery;
+	}
+
+	public void setDelivery(Date delivery) {
+		this.delivery = delivery;
+	}
+
+	public Date getReplyDelivery() {
+		return replyDelivery;
+	}
+
+	public void setReplyDelivery(Date replyDelivery) {
+		this.replyDelivery = replyDelivery;
+	}
+
+	public String getReplyRemark() {
+		return replyRemark;
+	}
+
+	public void setReplyRemark(String replyRemark) {
+		this.replyRemark = replyRemark;
+	}
+
+	public Short getStatus() {
+		return status;
+	}
+
+	public void setStatus(Short status) {
+		this.status = status;
+	}
+
+	public Short getEnd() {
+		return end;
+	}
+
+	public void setEnd(Short end) {
+		this.end = end;
+	}
+
+	public Double getAcceptQty() {
+		return acceptQty;
+	}
+
+	public void setAcceptQty(Double acceptQty) {
+		this.acceptQty = acceptQty;
+	}
+
+	public Double getReturnQty() {
+		return returnQty;
+	}
+
+	public void setReturnQty(Double returnQty) {
+		this.returnQty = returnQty;
+	}
+
+	public Boolean getKey() {
+		return key;
+	}
+
+	public void setKey(Boolean key) {
+		this.key = key;
+	}
+	
+	public double getBalance() {
+		double qtyNum, returnQtyNum, acceptQtyNum;
+		qtyNum = qty == null ? 0 : qty;
+		returnQtyNum = returnQty == null ? 0 : returnQty;
+		acceptQtyNum = acceptQty == null ? 0 : acceptQty;
+		return qtyNum + returnQtyNum - acceptQtyNum;
+	}
+	
+	public String getVendorName() {
+		return SystemSession.getUser().getEnterprise().getEnName();
+	}
+}