|
|
@@ -14,7 +14,7 @@ import java.util.*;
|
|
|
*/
|
|
|
@Table(name = "purc$changeitems")
|
|
|
@Entity
|
|
|
-public class PurchaseOrderChangeItem extends AbstractOrderProduct {
|
|
|
+public class PurchaseOrderChangeItem {
|
|
|
|
|
|
@Id
|
|
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
|
|
@@ -49,16 +49,12 @@ public class PurchaseOrderChangeItem extends AbstractOrderProduct {
|
|
|
/**
|
|
|
* 新产品
|
|
|
*/
|
|
|
- @OneToOne(cascade = { CascadeType.REFRESH })
|
|
|
- @JoinColumn(name = "pcd_newprid", insertable = false, updatable = false)
|
|
|
- private Product newProduct;
|
|
|
+ private ProductInfo newProduct;
|
|
|
|
|
|
/**
|
|
|
* 原产品
|
|
|
*/
|
|
|
- @OneToOne(cascade = { CascadeType.REFRESH })
|
|
|
- @JoinColumn(name = "pcd_oldprid", insertable = false, updatable = false)
|
|
|
- private Product oldProduct;
|
|
|
+ private ProductInfo oldProduct;
|
|
|
|
|
|
/**
|
|
|
* 新产品id
|
|
|
@@ -66,12 +62,72 @@ public class PurchaseOrderChangeItem extends AbstractOrderProduct {
|
|
|
@Column(name = "pcd_newprid")
|
|
|
private Long newProductId;
|
|
|
|
|
|
+ /**
|
|
|
+ * 新物料编号
|
|
|
+ */
|
|
|
+ @Column(name = "pcd_newprcode")
|
|
|
+ private String newProductCode;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新物料名称
|
|
|
+ */
|
|
|
+ @Column(name = "pcd_newprtitle")
|
|
|
+ private String newProductTitle;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新物料规格
|
|
|
+ */
|
|
|
+ @Column(name = "pcd_newprspec")
|
|
|
+ private String newProductSpec;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新物料单位
|
|
|
+ */
|
|
|
+ @Column(name = "pcd_newprunit")
|
|
|
+ private String newProductUnit;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新物料来源uas id
|
|
|
+ */
|
|
|
+ @Column(name = "pcd_newprsourceid")
|
|
|
+ private Long newProductSourceId;
|
|
|
+
|
|
|
/**
|
|
|
* 原产品id
|
|
|
*/
|
|
|
@Column(name = "pcd_oldprid")
|
|
|
private Long oldProductId;
|
|
|
|
|
|
+ /**
|
|
|
+ * 原物料编号
|
|
|
+ */
|
|
|
+ @Column(name = "pcd_oldprcode")
|
|
|
+ private String oldProductCode;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 原物料名称
|
|
|
+ */
|
|
|
+ @Column(name = "pcd_oldprtitle")
|
|
|
+ private String oldProductTitle;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 原物料规格
|
|
|
+ */
|
|
|
+ @Column(name = "pcd_oldprspec")
|
|
|
+ private String oldProductSpec;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 原物料单位
|
|
|
+ */
|
|
|
+ @Column(name = "pcd_oldprunit")
|
|
|
+ private String oldProductUnit;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 原物料来源uas id
|
|
|
+ */
|
|
|
+ @Column(name = "pcd_oldprsourceid")
|
|
|
+ private Long oldProductSourceId;
|
|
|
+
|
|
|
/**
|
|
|
* 新数量
|
|
|
*/
|
|
|
@@ -158,11 +214,26 @@ public class PurchaseOrderChangeItem extends AbstractOrderProduct {
|
|
|
this.orderChange = orderChange;
|
|
|
}
|
|
|
|
|
|
- public Product getNewProduct() {
|
|
|
+ public ProductInfo getNewProduct() {
|
|
|
+ if (newProduct == null) {
|
|
|
+ newProduct = new ProductInfo();
|
|
|
+ newProduct.setCode(this.newProductCode);
|
|
|
+ newProduct.setTitle(this.newProductTitle);
|
|
|
+ newProduct.setSpec(this.newProductSpec);
|
|
|
+ newProduct.setUnit(this.newProductUnit);
|
|
|
+ newProduct.setSourceId(this.newProductSourceId);
|
|
|
+ }
|
|
|
return newProduct;
|
|
|
}
|
|
|
|
|
|
- public void setNewProduct(Product newProduct) {
|
|
|
+ public void setNewProduct(ProductInfo newProduct) {
|
|
|
+ if (newProduct != null) {
|
|
|
+ this.newProductCode = newProduct.getCode();
|
|
|
+ this.newProductTitle = newProduct.getTitle();
|
|
|
+ this.newProductSpec = newProduct.getSpec();
|
|
|
+ this.newProductUnit = newProduct.getUnit();
|
|
|
+ this.newProductSourceId = oldProduct.getSourceId();
|
|
|
+ }
|
|
|
this.newProduct = newProduct;
|
|
|
}
|
|
|
|
|
|
@@ -230,11 +301,26 @@ public class PurchaseOrderChangeItem extends AbstractOrderProduct {
|
|
|
this.orderItemNumber = orderItemNumber;
|
|
|
}
|
|
|
|
|
|
- public Product getOldProduct() {
|
|
|
+ public ProductInfo getOldProduct() {
|
|
|
+ if (oldProduct == null) {
|
|
|
+ oldProduct = new ProductInfo();
|
|
|
+ oldProduct.setCode(this.oldProductCode);
|
|
|
+ oldProduct.setTitle(this.oldProductTitle);
|
|
|
+ oldProduct.setSpec(this.oldProductSpec);
|
|
|
+ oldProduct.setUnit(this.oldProductUnit);
|
|
|
+ oldProduct.setSourceId(this.oldProductSourceId);
|
|
|
+ }
|
|
|
return oldProduct;
|
|
|
}
|
|
|
|
|
|
- public void setOldProduct(Product oldProduct) {
|
|
|
+ public void setOldProduct(ProductInfo oldProduct) {
|
|
|
+ if (oldProduct != null) {
|
|
|
+ this.oldProductCode = oldProduct.getCode();
|
|
|
+ this.oldProductTitle = oldProduct.getTitle();
|
|
|
+ this.oldProductSpec = oldProduct.getSpec();
|
|
|
+ this.oldProductUnit = oldProduct.getUnit();
|
|
|
+ this.oldProductSourceId = oldProduct.getSourceId();
|
|
|
+ }
|
|
|
this.oldProduct = oldProduct;
|
|
|
}
|
|
|
|
|
|
@@ -286,6 +372,86 @@ public class PurchaseOrderChangeItem extends AbstractOrderProduct {
|
|
|
this.erpDate = erpDate;
|
|
|
}
|
|
|
|
|
|
+ public String getNewProductCode() {
|
|
|
+ return newProductCode;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setNewProductCode(String newProductCode) {
|
|
|
+ this.newProductCode = newProductCode;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getNewProductTitle() {
|
|
|
+ return newProductTitle;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setNewProductTitle(String newProductTitle) {
|
|
|
+ this.newProductTitle = newProductTitle;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getNewProductSpec() {
|
|
|
+ return newProductSpec;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setNewProductSpec(String newProductSpec) {
|
|
|
+ this.newProductSpec = newProductSpec;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getNewProductUnit() {
|
|
|
+ return newProductUnit;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setNewProductUnit(String newProductUnit) {
|
|
|
+ this.newProductUnit = newProductUnit;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Long getNewProductSourceId() {
|
|
|
+ return newProductSourceId;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setNewProductSourceId(Long newProductSourceId) {
|
|
|
+ this.newProductSourceId = newProductSourceId;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getOldProductCode() {
|
|
|
+ return oldProductCode;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setOldProductCode(String oldProductCode) {
|
|
|
+ this.oldProductCode = oldProductCode;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getOldProductTitle() {
|
|
|
+ return oldProductTitle;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setOldProductTitle(String oldProductTitle) {
|
|
|
+ this.oldProductTitle = oldProductTitle;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getOldProductSpec() {
|
|
|
+ return oldProductSpec;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setOldProductSpec(String oldProductSpec) {
|
|
|
+ this.oldProductSpec = oldProductSpec;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getOldProductUnit() {
|
|
|
+ return oldProductUnit;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setOldProductUnit(String oldProductUnit) {
|
|
|
+ this.oldProductUnit = oldProductUnit;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Long getOldProductSourceId() {
|
|
|
+ return oldProductSourceId;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setOldProductSourceId(Long oldProductSourceId) {
|
|
|
+ this.oldProductSourceId = oldProductSourceId;
|
|
|
+ }
|
|
|
+
|
|
|
public static List<PurchaseOrderChange> distinct(List<PurchaseOrderChangeItem> items) {
|
|
|
List<PurchaseOrderChange> accepts = new ArrayList<PurchaseOrderChange>();
|
|
|
Set<Long> keys = new HashSet<Long>();
|
|
|
@@ -297,24 +463,4 @@ public class PurchaseOrderChangeItem extends AbstractOrderProduct {
|
|
|
}
|
|
|
return accepts;
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * [抽象方法] 获取物料id
|
|
|
- *
|
|
|
- * @return
|
|
|
- */
|
|
|
- @Override
|
|
|
- public Long getProductId() {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * [抽象方法] 设置物料id
|
|
|
- *
|
|
|
- * @param productId 物料id
|
|
|
- */
|
|
|
- @Override
|
|
|
- public void setProductId(Long productId) {
|
|
|
-
|
|
|
- }
|
|
|
}
|