|
|
@@ -1,5 +1,17 @@
|
|
|
package com.uas.platform.b2b.erp.model;
|
|
|
|
|
|
+import java.sql.Date;
|
|
|
+import java.util.HashSet;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Set;
|
|
|
+
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
+
|
|
|
+import com.uas.platform.b2b.model.PurchaseOrderAll;
|
|
|
+import com.uas.platform.b2b.model.PurchaseOrderAllItem;
|
|
|
+import com.uas.platform.b2b.support.SystemSession;
|
|
|
+import com.uas.platform.core.model.Status;
|
|
|
+
|
|
|
/**
|
|
|
* ERP系统的采购订单
|
|
|
*
|
|
|
@@ -8,4 +20,142 @@ package com.uas.platform.b2b.erp.model;
|
|
|
*/
|
|
|
public class Purchase {
|
|
|
|
|
|
+ private String pu_code;
|
|
|
+ private Date pu_date;
|
|
|
+ private Long ve_uu;
|
|
|
+ private String pu_currency;
|
|
|
+ private String pu_kind;
|
|
|
+ private String pu_payments;
|
|
|
+ private String pu_remark;
|
|
|
+ private String pu_recordman;
|
|
|
+ private String pu_auditman;
|
|
|
+ private Date pu_indate;
|
|
|
+ private String pu_shipaddresscode;
|
|
|
+ private List<PurchaseDetail> purchaseDetails;
|
|
|
+
|
|
|
+ public String getPu_code() {
|
|
|
+ return pu_code;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPu_code(String pu_code) {
|
|
|
+ this.pu_code = pu_code;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Date getPu_date() {
|
|
|
+ return pu_date;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPu_date(Date pu_date) {
|
|
|
+ this.pu_date = pu_date;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Long getVe_uu() {
|
|
|
+ return ve_uu;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setVe_uu(Long ve_uu) {
|
|
|
+ this.ve_uu = ve_uu;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getPu_currency() {
|
|
|
+ return pu_currency;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPu_currency(String pu_currency) {
|
|
|
+ this.pu_currency = pu_currency;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getPu_kind() {
|
|
|
+ return pu_kind;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPu_kind(String pu_kind) {
|
|
|
+ this.pu_kind = pu_kind;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getPu_payments() {
|
|
|
+ return pu_payments;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPu_payments(String pu_payments) {
|
|
|
+ this.pu_payments = pu_payments;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getPu_remark() {
|
|
|
+ return pu_remark;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPu_remark(String pu_remark) {
|
|
|
+ this.pu_remark = pu_remark;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getPu_recordman() {
|
|
|
+ return pu_recordman;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPu_recordman(String pu_recordman) {
|
|
|
+ this.pu_recordman = pu_recordman;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getPu_auditman() {
|
|
|
+ return pu_auditman;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPu_auditman(String pu_auditman) {
|
|
|
+ this.pu_auditman = pu_auditman;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Date getPu_indate() {
|
|
|
+ return pu_indate;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPu_indate(Date pu_indate) {
|
|
|
+ this.pu_indate = pu_indate;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getPu_shipaddresscode() {
|
|
|
+ return pu_shipaddresscode;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPu_shipaddresscode(String pu_shipaddresscode) {
|
|
|
+ this.pu_shipaddresscode = pu_shipaddresscode;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<PurchaseDetail> getPurchaseDetails() {
|
|
|
+ return purchaseDetails;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPurchaseDetails(List<PurchaseDetail> purchaseDetails) {
|
|
|
+ this.purchaseDetails = purchaseDetails;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 转为平台的采购订单
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public PurchaseOrderAll convert() {
|
|
|
+ PurchaseOrderAll order = new PurchaseOrderAll();
|
|
|
+ order.setCode(this.pu_code);
|
|
|
+ order.setCurrency(this.pu_currency);
|
|
|
+ order.setDate(this.pu_date);
|
|
|
+ order.setEnterprise(SystemSession.getUser().getEnterprise());
|
|
|
+ order.setPayments(this.pu_payments);
|
|
|
+ order.setRemark(this.pu_remark);
|
|
|
+ order.setShipAddress(this.pu_shipaddresscode);
|
|
|
+ order.setRecorder(this.pu_recordman);
|
|
|
+ order.setStatus((short) Status.NOT_REPLY.value());
|
|
|
+ order.setType(this.pu_kind);
|
|
|
+ order.setVendUU(this.ve_uu);
|
|
|
+ order.setAuditor(this.pu_auditman);
|
|
|
+ if(!CollectionUtils.isEmpty(this.purchaseDetails)) {
|
|
|
+ Set<PurchaseOrderAllItem> items = new HashSet<PurchaseOrderAllItem>();
|
|
|
+ for(PurchaseDetail detail:this.purchaseDetails) {
|
|
|
+ items.add(detail.convert());
|
|
|
+ }
|
|
|
+ order.setOrderItems(items);
|
|
|
+ }
|
|
|
+ return order;
|
|
|
+ }
|
|
|
+
|
|
|
}
|