Просмотр исходного кода

【导出对账单Excel】

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@4388 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
aof 10 лет назад
Родитель
Сommit
2daed2fc12

+ 43 - 30
src/main/java/com/uas/platform/b2b/model/ErpProdIODetail.java

@@ -3,19 +3,18 @@ package com.uas.platform.b2b.model;
 import java.io.Serializable;
 import java.util.Date;
 
-
 /**
  * 买家应付(卖家应收)对账单
  */
-public class ErpProdIODetail implements Serializable{
-	
+public class ErpProdIODetail implements Serializable {
+
 	private static final long serialVersionUID = 1L;
-	
+
 	/**
 	 * 出入库单号
 	 */
 	private String inOutNo;
-	
+
 	/**
 	 * 出出入库单序号
 	 */
@@ -25,7 +24,7 @@ public class ErpProdIODetail implements Serializable{
 	 * 单据类型
 	 */
 	private String piClass;
-	
+
 	/**
 	 * 客户采购编号
 	 */
@@ -35,22 +34,27 @@ public class ErpProdIODetail implements Serializable{
 	 * 客户采购序号
 	 */
 	private Long orderDetno;
-	
+
 	/**
 	 * 客户采购料号
 	 */
 	private String prodCode;
-	
+
+	/**
+	 * 客户采购规格
+	 */
+	private String prodSpec;
+
 	/**
 	 * 客户物料描述
 	 */
 	private String prodTitle;
-	
+
 	/**
 	 * 客户验收数量
 	 */
 	private Double qty;
-	
+
 	/**
 	 * 单价
 	 */
@@ -60,82 +64,82 @@ public class ErpProdIODetail implements Serializable{
 	 * 币别
 	 */
 	private String currency;
-	
+
 	/**
 	 * 税率
 	 */
 	private Double taxrate;
-	
+
 	/**
 	 * 已对账数
 	 */
 	private Double yCheckQty;
-	
+
 	/**
 	 * 本次对账数
 	 */
 	private Double thisCheckQty;
-	
+
 	/**
 	 * 客户名称
 	 */
 	private String custName;
-	
+
 	/**
 	 * 客户UU
 	 */
 	private Long custUu;
-	
+
 	/**
 	 * sourceid
 	 */
 	private Long sourceId;
-	
+
 	/**
 	 * 单据来源表
 	 */
 	private String sourceTable;
-	
+
 	/**
 	 * 企业UU
 	 */
 	private Long enUu;
-	
+
 	/**
 	 * 日期
 	 */
 	private Date piDate;
-	
+
 	/**
 	 * 汇率
 	 */
-	private Double rate; 
-	
+	private Double rate;
+
 	/**
 	 * 应付供应商编号
 	 */
-	private String receiveCode; 
+	private String receiveCode;
 
 	/**
 	 * 应付供应商名称
 	 */
-	private String receiveName; 
-	
+	private String receiveName;
+
 	/**
 	 * 金额
 	 */
 	private Double money;
-	
+
 	/**
 	 * 本次对账金额
 	 */
 	private Double nowMoney;
-	
+
 	/**
 	 * 送货工厂
 	 */
 	private String factory;
-	
+
 	public String getFactory() {
 		return factory;
 	}
@@ -145,7 +149,7 @@ public class ErpProdIODetail implements Serializable{
 	}
 
 	public Double getMoney() {
-		this.money = (this.qty == null ? 0: this.qty) * (this.orderPrice == null ? 0:this.orderPrice);
+		this.money = (this.qty == null ? 0 : this.qty) * (this.orderPrice == null ? 0 : this.orderPrice);
 		return this.money;
 	}
 
@@ -154,7 +158,8 @@ public class ErpProdIODetail implements Serializable{
 	}
 
 	public Double getNowMoney() {
-		this.nowMoney = (this.thisCheckQty == null ? 0: this.thisCheckQty) * (this.orderPrice == null ? 0:this.orderPrice);
+		this.nowMoney = (this.thisCheckQty == null ? 0 : this.thisCheckQty)
+				* (this.orderPrice == null ? 0 : this.orderPrice);
 		return this.nowMoney;
 	}
 
@@ -338,4 +343,12 @@ public class ErpProdIODetail implements Serializable{
 		this.prodTitle = prodTitle;
 	}
 
+	public String getProdSpec() {
+		return prodSpec;
+	}
+
+	public void setProdSpec(String prodSpec) {
+		this.prodSpec = prodSpec;
+	}
+
 }

+ 85 - 63
src/main/java/com/uas/platform/b2b/model/PurchaseApCheckItem.java

@@ -23,8 +23,8 @@ import com.alibaba.fastjson.annotation.JSONField;
 
 /**
  * 买家应付(卖家应收)对账单明细
- * */
-@Table(name="purc$apcheckitem")
+ */
+@Table(name = "purc$apcheckitem")
 @Entity
 public class PurchaseApCheckItem implements Serializable {
 
@@ -32,134 +32,145 @@ public class PurchaseApCheckItem implements Serializable {
 	 * 序列号
 	 */
 	private static final long serialVersionUID = 1L;
-	
-	
+
 	/**
 	 * ID
-	 * */
+	 */
 	@Id
 	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "purc$apcheckitem_gen")
 	@SequenceGenerator(name = "purc$apcheckitem_gen", sequenceName = "purc$apcheckitem_seq", allocationSize = 1)
-	@Column(name="pai_id")
+	@Column(name = "pai_id")
 	private Long id;
 
 	/**
 	 * 行号
-	 * */
-	@Column(name="pai_number")
+	 */
+	@Column(name = "pai_number")
 	private Short number;
 
 	/**
 	 * 客户物料ID
-	 * */
-	@Column(name="pai_prid")
+	 */
+	@Column(name = "pai_prid")
 	private Long prid;
 
 	/**
 	 * 客户订单单号
-	 * */
-	@Column(name="pai_ordercode")
+	 */
+	@Column(name = "pai_ordercode")
 	private String orderCode;
 
 	/**
 	 * 客户出入库类型
-	 * */
-	@Column(name="pai_orderclass")
+	 */
+	@Column(name = "pai_orderclass")
 	private String orderClass;
 
 	/**
 	 * 客户订单序号
-	 * */
-	@Column(name="pai_orderdetno")
+	 */
+	@Column(name = "pai_orderdetno")
 	private Long orderDetno;
-	
+
 	/**
 	 * 客户出入库单号
-	 * */
-	@Column(name="pai_inoutno")
+	 */
+	@Column(name = "pai_inoutno")
 	private String inoutno;
-	
+
 	/**
-	 * 出入库单序号 
+	 * 出入库单序号
 	 */
-	@Column(name="pai_inoutnodetno")
+	@Column(name = "pai_inoutnodetno")
 	private Long inoutnodetno;
-	
+
 	/**
-	 * 客户料号 
-	 * */
-	@Column(name="pai_prodcode")
+	 * 客户料号
+	 */
+	@Column(name = "pai_prodcode")
 	private String prodCode;
-	
+
+	/**
+	 * 物料名称
+	 */
+	@Column(name = "pai_prodtitle")
+	private String prodTitle;
+
+	/**
+	 * 物料规格
+	 */
+	@Column(name = "pai_prodspec")
+	private String prodSpec;
+
 	/**
 	 * 单价
-	 * */
-	@Column(name="pai_price")
+	 */
+	@Column(name = "pai_price")
 	private Double price;
 
 	/**
 	 * 税率
-	 */	
+	 */
 	@Column(name = "pai_taxrate")
 	private Double taxrate;
-	
+
 	/**
 	 * 对账数量
-	 * */
-	@Column(name="pai_checkqty")
+	 */
+	@Column(name = "pai_checkqty")
 	private Double checkQty;
 
 	/**
 	 * 对账金额
-	 * */
-	@Column(name="pai_amount")
+	 */
+	@Column(name = "pai_amount")
 	private Double amount;
-	
+
 	/**
 	 * 客户确认数量
-	 * */
-	@Column(name="pai_custcheckqty")
+	 */
+	@Column(name = "pai_custcheckqty")
 	private Double custCheckQty;
-	
+
 	/**
 	 * 备注
-	 * */
-	@Column(name="pai_remark")
+	 */
+	@Column(name = "pai_remark")
 	private String remark;
 
 	/**
 	 * 对账状态
-	 * */
-	@Column(name="pai_status")
+	 */
+	@Column(name = "pai_status")
 	private Integer status;
 
 	/**
 	 * 明细行数据来源表
-	 * */
-	@Column(name="pai_sourcetable")
+	 */
+	@Column(name = "pai_sourcetable")
 	private String sourceTable;
 
 	/**
 	 * 明细行数据来源对应ID
-	 * */
-	@Column(name="pai_sourceid")
+	 */
+	@Column(name = "pai_sourceid")
 	private Long sourceId;
-	
+
 	/**
 	 * 此次转账之前的已对账数(用于删除应收对账单时)
 	 */
 	@Column(name = "pai_oldycheckqty")
 	private Double oldYCheckQty;
-	
+
 	/**
 	 * 应付供应商编号
-	 */	
+	 */
 	@Column(name = "pai_receivecode")
 	private String receiveCode;
-	
+
 	/**
 	 * 应付供应商名称
-	 */	
+	 */
 	@Column(name = "pai_receivename")
 	private String receiveName;
 
@@ -170,8 +181,6 @@ public class PurchaseApCheckItem implements Serializable {
 	@JoinColumn(name = "pai_paid", nullable = false)
 	private PurchaseApCheck apCheck;
 
-
-
 	public Long getId() {
 		return id;
 	}
@@ -196,7 +205,6 @@ public class PurchaseApCheckItem implements Serializable {
 		this.prid = prid;
 	}
 
-
 	public String getOrderCode() {
 		return orderCode;
 	}
@@ -277,7 +285,6 @@ public class PurchaseApCheckItem implements Serializable {
 		this.remark = remark;
 	}
 
-
 	public Integer getStatus() {
 		return status;
 	}
@@ -286,7 +293,6 @@ public class PurchaseApCheckItem implements Serializable {
 		this.status = status;
 	}
 
-	
 	public String getSourceTable() {
 		return sourceTable;
 	}
@@ -302,7 +308,7 @@ public class PurchaseApCheckItem implements Serializable {
 	public void setSourceId(Long sourceId) {
 		this.sourceId = sourceId;
 	}
-	
+
 	public Double getOldYCheckQty() {
 		return oldYCheckQty;
 	}
@@ -344,7 +350,7 @@ public class PurchaseApCheckItem implements Serializable {
 	}
 
 	@JsonIgnore
-	@JSONField(serialize = false)	
+	@JSONField(serialize = false)
 	public PurchaseApCheck getApCheck() {
 		return apCheck;
 	}
@@ -352,17 +358,33 @@ public class PurchaseApCheckItem implements Serializable {
 	public void setApCheck(PurchaseApCheck apCheck) {
 		this.apCheck = apCheck;
 	}
-	
-	public static List<PurchaseApCheck> distinct(List<PurchaseApCheckItem> items){
+
+	public String getProdTitle() {
+		return prodTitle;
+	}
+
+	public void setProdTitle(String prodTitle) {
+		this.prodTitle = prodTitle;
+	}
+
+	public String getProdSpec() {
+		return prodSpec;
+	}
+
+	public void setProdSpec(String prodSpec) {
+		this.prodSpec = prodSpec;
+	}
+
+	public static List<PurchaseApCheck> distinct(List<PurchaseApCheckItem> items) {
 		List<PurchaseApCheck> purchaseApChecks = new ArrayList<PurchaseApCheck>();
 		Set<Long> keys = new HashSet<Long>();
 		for (PurchaseApCheckItem item : items) {
-			if(!keys.contains(item.apCheck.getId())) {
+			if (!keys.contains(item.apCheck.getId())) {
 				purchaseApChecks.add(item.apCheck);
 				keys.add(item.apCheck.getId());
 			}
 		}
 		return purchaseApChecks;
 	}
-	
+
 }

+ 8 - 5
src/main/java/com/uas/platform/b2b/model/PurchaseInquiry.java

@@ -106,7 +106,7 @@ public class PurchaseInquiry implements Serializable {
 	 */
 	@Column(name = "in_environment")
 	private String environment;
-	
+
 	/*
 	 * 价格类型
 	 */
@@ -116,7 +116,8 @@ public class PurchaseInquiry implements Serializable {
 	/**
 	 * 询价明细
 	 */
-	@OneToMany(mappedBy = "inquiry", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE, CascadeType.MERGE }, fetch = FetchType.EAGER)
+	@OneToMany(mappedBy = "inquiry", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE,
+			CascadeType.MERGE }, fetch = FetchType.EAGER)
 	@OrderBy("number")
 	private Set<PurchaseInquiryItem> inquiryItems;
 
@@ -140,8 +141,10 @@ public class PurchaseInquiry implements Serializable {
 	 */
 	@Column(name = "in_checked")
 	private Short check;
-	
-	
+
+	/**
+	 * 是否过期
+	 */
 	@Column(name = "in_overdue", insertable = false, updatable = false)
 	private Short overdue;
 
@@ -282,5 +285,5 @@ public class PurchaseInquiry implements Serializable {
 	public void setOverdue(Short overdue) {
 		this.overdue = overdue;
 	}
-	
+
 }