|
|
@@ -1,6 +1,11 @@
|
|
|
package com.uas.platform.b2c.logistics.model;
|
|
|
|
|
|
import com.alibaba.fastjson.annotation.JSONField;
|
|
|
+import com.uas.platform.b2c.core.utils.NumberUtil;
|
|
|
+import com.uas.platform.b2c.trade.order.model.OrderDetail;
|
|
|
+import com.uas.platform.b2c.trade.order.model.PurchaseDetail;
|
|
|
+import com.uas.platform.core.exception.IllegalStatusException;
|
|
|
+import com.uas.platform.core.model.Status;
|
|
|
import com.uas.platform.core.persistence.StatusColumn;
|
|
|
import org.codehaus.jackson.annotate.JsonIgnore;
|
|
|
|
|
|
@@ -10,7 +15,6 @@ import javax.persistence.*;
|
|
|
* 发货单(来源于订单的)明细
|
|
|
*
|
|
|
* @author ChenHao
|
|
|
- *
|
|
|
*/
|
|
|
@Entity
|
|
|
@Table(name = "trade$invoice_detail")
|
|
|
@@ -21,6 +25,12 @@ public class InvoiceDetail {
|
|
|
@Column(name = "id")
|
|
|
private Long id;
|
|
|
|
|
|
+ /**
|
|
|
+ * 发货单明细编号
|
|
|
+ */
|
|
|
+ @Column(name = "detail_id", unique = true)
|
|
|
+ private String detailid;
|
|
|
+
|
|
|
/**
|
|
|
* 主表
|
|
|
*
|
|
|
@@ -37,10 +47,28 @@ public class InvoiceDetail {
|
|
|
private Short detno;
|
|
|
|
|
|
/**
|
|
|
- * 发货单明细编号
|
|
|
+ * 采购单明细id
|
|
|
*/
|
|
|
- @Column(name = "detail_id", unique = true)
|
|
|
- private String detailid;
|
|
|
+ @Column(name = "detail_orderdetail_id")
|
|
|
+ private Long orderDetailId;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 采购单明细单号
|
|
|
+ */
|
|
|
+ @Column(name = "detail_order_detailid")
|
|
|
+ private String orderDetailid;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 销售单明细单号
|
|
|
+ */
|
|
|
+ @Column(name = "detail_purchase_detailid")
|
|
|
+ private String purchaseDetailid;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 销售单明细主键
|
|
|
+ */
|
|
|
+ @Column(name = "detail_purchasedetail_id")
|
|
|
+ private Long purchaseDetailId;
|
|
|
|
|
|
/**
|
|
|
* 来源id(父级)
|
|
|
@@ -61,10 +89,22 @@ public class InvoiceDetail {
|
|
|
private String batchCode;
|
|
|
|
|
|
/**
|
|
|
- * 对应的器件uuid
|
|
|
+ * 明细的评论
|
|
|
*/
|
|
|
- @Column(name = "cmp_uuid")
|
|
|
- private String uuid;
|
|
|
+ @Column(name = "detail_remark", length = 4000)
|
|
|
+ private String remark;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 物料编号
|
|
|
+ */
|
|
|
+ @Column(name = "detail_go_number")
|
|
|
+ private String goodsnumber;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 物料id
|
|
|
+ */
|
|
|
+ @Column(name = "detail_productid")
|
|
|
+ private Long productid;
|
|
|
|
|
|
/**
|
|
|
* 库存 现货 1311 呆滞库存, 1312 ,(暂时不用) 废料 1313
|
|
|
@@ -72,6 +112,12 @@ public class InvoiceDetail {
|
|
|
@Column(name = "go_original")
|
|
|
private Integer original;
|
|
|
|
|
|
+ /**
|
|
|
+ * 对应的器件uuid
|
|
|
+ */
|
|
|
+ @Column(name = "cmp_uuid")
|
|
|
+ private String uuid;
|
|
|
+
|
|
|
/**
|
|
|
* 原厂型号
|
|
|
*/
|
|
|
@@ -84,11 +130,37 @@ public class InvoiceDetail {
|
|
|
@Column(name = "ki_name")
|
|
|
private String kiName;
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 类目ID
|
|
|
+ */
|
|
|
+ @Column(name = "go_kind_uuid")
|
|
|
+ private Long kindUuid;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 品牌中文名称
|
|
|
+ */
|
|
|
+ @Column(name = "br_name_cn")
|
|
|
+ private String brandNameCn;
|
|
|
+
|
|
|
/**
|
|
|
- * 器件所属品牌
|
|
|
+ * 品牌英文名称
|
|
|
*/
|
|
|
- @Column(name = "br_name")
|
|
|
- private String brName;
|
|
|
+ @Column(name = "br_name_en")
|
|
|
+ private String brandNameEn;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 品牌品牌id
|
|
|
+ */
|
|
|
+ @Column(name = "br_name_id")
|
|
|
+ private Long brandid;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 品牌品牌uuid
|
|
|
+ */
|
|
|
+ @Column(name = "br_name_uuid")
|
|
|
+ private String branduuid;
|
|
|
|
|
|
/**
|
|
|
* 图片path
|
|
|
@@ -105,14 +177,14 @@ public class InvoiceDetail {
|
|
|
/**
|
|
|
* 数量
|
|
|
*/
|
|
|
- @Column(name = "detail_number")
|
|
|
- private Double number;
|
|
|
+ @Column(name = "detail_qty")
|
|
|
+ private Double qty;
|
|
|
|
|
|
/**
|
|
|
* 币种名称
|
|
|
*/
|
|
|
- @Column(name = "cr_name")
|
|
|
- private String currencyName;
|
|
|
+ @Column(name = "detail_currency")
|
|
|
+ private String currency;
|
|
|
|
|
|
/**
|
|
|
* 金额小计
|
|
|
@@ -132,17 +204,6 @@ public class InvoiceDetail {
|
|
|
@Column(name = "transation_price")
|
|
|
private Double transationPrice;
|
|
|
|
|
|
- /**
|
|
|
- * 客户退货数量
|
|
|
- */
|
|
|
- @Column(name = "detail_returnqty")
|
|
|
- private Double returnQty;
|
|
|
-
|
|
|
- /**
|
|
|
- * 客户换货数量
|
|
|
- */
|
|
|
- @Column(name = "detail_changeqty")
|
|
|
- private Double changeQty;
|
|
|
|
|
|
/*
|
|
|
* 税金
|
|
|
@@ -150,10 +211,11 @@ public class InvoiceDetail {
|
|
|
@Column(name = "detail_taxes")
|
|
|
private Double taxes;
|
|
|
|
|
|
- /*
|
|
|
+
|
|
|
+ /**
|
|
|
* 税率
|
|
|
*/
|
|
|
- @Column(name = "tax")
|
|
|
+ @Column(name = "detail_tax")
|
|
|
private Short tax;
|
|
|
|
|
|
/*
|
|
|
@@ -162,6 +224,25 @@ public class InvoiceDetail {
|
|
|
@Column(name = "detail_taxunitprice")
|
|
|
private Double taxunitprice;
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 商城最长交期
|
|
|
+ */
|
|
|
+ @Column(name = "go_b2cmaxdelivery")
|
|
|
+ private Short b2cMaxDelivery;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 商城最短交期
|
|
|
+ */
|
|
|
+ @Column(name = "go_b2cmindelivery")
|
|
|
+ private Short b2cMinDelivery;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 规格信息
|
|
|
+ */
|
|
|
+ @Column(name = "detail_spec", length = 4000)
|
|
|
+ private String spec;
|
|
|
+
|
|
|
/**
|
|
|
* 发货单明细状态
|
|
|
*/
|
|
|
@@ -237,14 +318,6 @@ public class InvoiceDetail {
|
|
|
this.kiName = kiName;
|
|
|
}
|
|
|
|
|
|
- public String getBrName() {
|
|
|
- return brName;
|
|
|
- }
|
|
|
-
|
|
|
- public void setBrName(String brName) {
|
|
|
- this.brName = brName;
|
|
|
- }
|
|
|
-
|
|
|
public String getImg() {
|
|
|
return img;
|
|
|
}
|
|
|
@@ -265,20 +338,112 @@ public class InvoiceDetail {
|
|
|
this.unitprice = unitprice;
|
|
|
}
|
|
|
|
|
|
- public Double getNumber() {
|
|
|
- return number;
|
|
|
+ public String getRemark() {
|
|
|
+ return remark;
|
|
|
+ }
|
|
|
+
|
|
|
+ public InvoiceDetail setRemark(String remark) {
|
|
|
+ this.remark = remark;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getGoodsnumber() {
|
|
|
+ return goodsnumber;
|
|
|
+ }
|
|
|
+
|
|
|
+ public InvoiceDetail setGoodsnumber(String goodsnumber) {
|
|
|
+ this.goodsnumber = goodsnumber;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Long getProductid() {
|
|
|
+ return productid;
|
|
|
+ }
|
|
|
+
|
|
|
+ public InvoiceDetail setProductid(Long productid) {
|
|
|
+ this.productid = productid;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Long getKindUuid() {
|
|
|
+ return kindUuid;
|
|
|
}
|
|
|
|
|
|
- public void setNumber(Double number) {
|
|
|
- this.number = number;
|
|
|
+ public InvoiceDetail setKindUuid(Long kindUuid) {
|
|
|
+ this.kindUuid = kindUuid;
|
|
|
+ return this;
|
|
|
}
|
|
|
|
|
|
- public String getCurrencyName() {
|
|
|
- return currencyName;
|
|
|
+ public String getBrandNameCn() {
|
|
|
+ return brandNameCn;
|
|
|
}
|
|
|
|
|
|
- public void setCurrencyName(String currencyName) {
|
|
|
- this.currencyName = currencyName;
|
|
|
+ public InvoiceDetail setBrandNameCn(String brandNameCn) {
|
|
|
+ this.brandNameCn = brandNameCn;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Long getBrandid() {
|
|
|
+ return brandid;
|
|
|
+ }
|
|
|
+
|
|
|
+ public InvoiceDetail setBrandid(Long brandid) {
|
|
|
+ this.brandid = brandid;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getBranduuid() {
|
|
|
+ return branduuid;
|
|
|
+ }
|
|
|
+
|
|
|
+ public InvoiceDetail setBranduuid(String branduuid) {
|
|
|
+ this.branduuid = branduuid;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Double getQty() {
|
|
|
+ return qty;
|
|
|
+ }
|
|
|
+
|
|
|
+ public InvoiceDetail setQty(Double qty) {
|
|
|
+ this.qty = qty;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getCurrency() {
|
|
|
+ return currency;
|
|
|
+ }
|
|
|
+
|
|
|
+ public InvoiceDetail setCurrency(String currency) {
|
|
|
+ this.currency = currency;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Short getB2cMaxDelivery() {
|
|
|
+ return b2cMaxDelivery;
|
|
|
+ }
|
|
|
+
|
|
|
+ public InvoiceDetail setB2cMaxDelivery(Short b2cMaxDelivery) {
|
|
|
+ this.b2cMaxDelivery = b2cMaxDelivery;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Short getB2cMinDelivery() {
|
|
|
+ return b2cMinDelivery;
|
|
|
+ }
|
|
|
+
|
|
|
+ public InvoiceDetail setB2cMinDelivery(Short b2cMinDelivery) {
|
|
|
+ this.b2cMinDelivery = b2cMinDelivery;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getSpec() {
|
|
|
+ return spec;
|
|
|
+ }
|
|
|
+
|
|
|
+ public InvoiceDetail setSpec(String spec) {
|
|
|
+ this.spec = spec;
|
|
|
+ return this;
|
|
|
}
|
|
|
|
|
|
public Double getPrice() {
|
|
|
@@ -331,22 +496,6 @@ public class InvoiceDetail {
|
|
|
this.transationPrice = transationPrice;
|
|
|
}
|
|
|
|
|
|
- public Double getReturnQty() {
|
|
|
- return returnQty;
|
|
|
- }
|
|
|
-
|
|
|
- public void setReturnQty(Double returnQty) {
|
|
|
- this.returnQty = returnQty;
|
|
|
- }
|
|
|
-
|
|
|
- public Double getChangeQty() {
|
|
|
- return changeQty;
|
|
|
- }
|
|
|
-
|
|
|
- public void setChangeQty(Double changeQty) {
|
|
|
- this.changeQty = changeQty;
|
|
|
- }
|
|
|
-
|
|
|
public Double getTaxes() {
|
|
|
return taxes;
|
|
|
}
|
|
|
@@ -370,10 +519,174 @@ public class InvoiceDetail {
|
|
|
public void setTaxunitprice(Double taxunitprice) {
|
|
|
this.taxunitprice = taxunitprice;
|
|
|
}
|
|
|
+
|
|
|
+ public Long getOrderDetailId() {
|
|
|
+ return orderDetailId;
|
|
|
+ }
|
|
|
+
|
|
|
+ public InvoiceDetail setOrderDetailId(Long orderDetailId) {
|
|
|
+ this.orderDetailId = orderDetailId;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getOrderDetailid() {
|
|
|
+ return orderDetailid;
|
|
|
+ }
|
|
|
+
|
|
|
+ public InvoiceDetail setOrderDetailid(String orderDetailid) {
|
|
|
+ this.orderDetailid = orderDetailid;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getPurchaseDetailid() {
|
|
|
+ return purchaseDetailid;
|
|
|
+ }
|
|
|
+
|
|
|
+ public InvoiceDetail setPurchaseDetailid(String purchaseDetailid) {
|
|
|
+ this.purchaseDetailid = purchaseDetailid;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Long getPurchaseDetailId() {
|
|
|
+ return purchaseDetailId;
|
|
|
+ }
|
|
|
+
|
|
|
+ public InvoiceDetail setPurchaseDetailId(Long purchaseDetailId) {
|
|
|
+ this.purchaseDetailId = purchaseDetailId;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getBrandNameEn() {
|
|
|
+ return brandNameEn;
|
|
|
+ }
|
|
|
+
|
|
|
+ public InvoiceDetail setBrandNameEn(String brandNameEn) {
|
|
|
+ this.brandNameEn = brandNameEn;
|
|
|
+ return this;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据采购单明细生成发货单明细
|
|
|
+ *
|
|
|
+ * @param puDetail 采购单明细
|
|
|
+ */
|
|
|
+ public InvoiceDetail(PurchaseDetail puDetail) {
|
|
|
+ if (puDetail == null) {
|
|
|
+ throw new IllegalStatusException("采购单明细已失效");
|
|
|
+ }
|
|
|
+ this.purchaseDetailId = puDetail.getId();
|
|
|
+ this.batchCode = puDetail.getBatchCode();
|
|
|
+ this.uuid = puDetail.getUuid();
|
|
|
+ this.original = puDetail.getOriginal();
|
|
|
+ this.cmpCode = puDetail.getCmpCode();
|
|
|
+ this.kiName = puDetail.getKiName();
|
|
|
+ this.kindUuid = puDetail.getKindUuid();
|
|
|
+ this.brandNameEn = puDetail.getBrName();
|
|
|
+ this.brandNameCn = puDetail.getBrandNameCn();
|
|
|
+ this.branduuid = puDetail.getBranduuid();
|
|
|
+ this.brandid = puDetail.getBrandid();
|
|
|
+ this.img = puDetail.getImg();
|
|
|
+ this.unitprice = puDetail.getUnitprice();
|
|
|
+ this.taxunitprice = puDetail.getTaxUnitPrice();
|
|
|
+ this.qty = puDetail.getNumber();
|
|
|
+ this.taxes = puDetail.getTaxes();
|
|
|
+ this.price = puDetail.getPrice();
|
|
|
+ this.ensurePrice = puDetail.getEnsurePrice();
|
|
|
+ this.transationPrice = puDetail.getTransationPrice();
|
|
|
+ this.currency = puDetail.getCurrencyName();
|
|
|
+ this.tax = puDetail.getTax();
|
|
|
+ this.b2cMinDelivery = puDetail.getB2cMinDelivery();
|
|
|
+ this.b2cMaxDelivery = puDetail.getB2cMaxDelivery();
|
|
|
+ this.remark = puDetail.getRemark();
|
|
|
+ this.goodsnumber = puDetail.getGoodsnumber();
|
|
|
+ this.productid = puDetail.getProductid();
|
|
|
+ this.orderDetailId = puDetail.getOrDetailId();
|
|
|
+ this.orderDetailid = puDetail.getOrderdetailid();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据采购单明细生成发货单明细
|
|
|
+ *
|
|
|
+ * @param puDetail 采购单明细
|
|
|
+ */
|
|
|
+ public InvoiceDetail(PurchaseDetail puDetail, Double qty) {
|
|
|
+ this(puDetail);
|
|
|
+ this.qty = qty;
|
|
|
+ this.taxes = puDetail.getTaxes();
|
|
|
+ this.price = NumberUtil.mul(qty, this.taxunitprice);
|
|
|
+ this.ensurePrice = this.price;
|
|
|
+ this.transationPrice = this.price;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据订单明细和id生成发货单明细对象
|
|
|
+ *
|
|
|
+ * @param detail 订单明细
|
|
|
+ * @param detailId 明细id
|
|
|
+ */
|
|
|
+ public InvoiceDetail(OrderDetail detail, String detailId) {
|
|
|
+ this();
|
|
|
+ this.detailid = detailId;
|
|
|
+ this.uuid = detail.getUuid();
|
|
|
+ this.batchCode = detail.getBatchCode();
|
|
|
+ this.cmpCode = detail.getCmpCode();
|
|
|
+ this.uuid = detail.getUuid();
|
|
|
+ this.brandNameEn = detail.getBrName();
|
|
|
+ this.brandNameCn = detail.getBrandNameCn();
|
|
|
+ this.brandid = detail.getBrandid();
|
|
|
+ this.branduuid = detail.getBranduuid();
|
|
|
+ this.kindUuid = detail.getKindUuid();
|
|
|
+ this.kiName = detail.getKiName();
|
|
|
+ this.img = detail.getImg();
|
|
|
+ this.original = detail.getOriginal();
|
|
|
+ this.unitprice = detail.getUnitprice();
|
|
|
+ this.taxunitprice = detail.getTaxUnitprice();
|
|
|
+ Double taxRate = detail.getTaxRate() == null ? 0 : detail.getTaxRate();
|
|
|
+ this.tax = Double.valueOf(taxRate * 100).shortValue();
|
|
|
+ this.taxes = detail.getTaxes();
|
|
|
+ this.qty = detail.getNumber();
|
|
|
+ this.currency = detail.getCurrencyName();
|
|
|
+ this.price = detail.getPrice();
|
|
|
+ this.ensurePrice = detail.getEnsurePrice();
|
|
|
+ this.orderDetailId = detail.getId();
|
|
|
+ this.orderDetailid = detail.getDetailid();
|
|
|
+ this.status = Status.TOBESHIPPED.value();
|
|
|
+ this.goodsnumber = detail.getGoodsnumber();
|
|
|
+ this.b2cMinDelivery = detail.getB2cMinDelivery();
|
|
|
+ this.b2cMaxDelivery = detail.getB2cMaxDelivery();
|
|
|
+ this.remark = detail.getRemark();
|
|
|
+ this.spec = detail.getSpec();
|
|
|
+ this.productid = detail.getProductId();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据订单明细和id生成发货单明细对象
|
|
|
+ *
|
|
|
+ * @param detail 订单明细
|
|
|
+ * @param detailId 明细id
|
|
|
+ */
|
|
|
+ public InvoiceDetail(OrderDetail detail, String detailId, Double qty) {
|
|
|
+ this(detail, detailId);
|
|
|
+ this.taxes = NumberUtil.mul(NumberUtil.sub(this.taxunitprice, this.unitprice), qty);
|
|
|
+ this.qty = qty;
|
|
|
+ this.price = NumberUtil.mul(qty, this.taxunitprice);
|
|
|
+ this.ensurePrice = this.price;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 平台换货单明细 生成供应商换货出货单明细
|
|
|
*/
|
|
|
public InvoiceDetail() {
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param fPurchaseDetail
|
|
|
+ */
|
|
|
+ public InvoiceDetail(InvoiceFPurchaseDetail fPurchaseDetail) {
|
|
|
|
|
|
}
|
|
|
|