package com.wechat.model.dbEntity;

import java.math.BigDecimal;
import java.util.Date;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotBlank;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 单表生成Entity
 * 
 * @author tangwc
 * @version 2018-06-08
 */
public class MdeOrders extends BaseEntity {

	private static final long serialVersionUID = 1L;

	private String orderId; // 订单编号（采番规则：P/E+YYMMDD+10位hashCode取正+3位随机数）

	@NotBlank(message="用户id不能为空|userCode can not be null")
	private String userCode; // 用户id

	@NotBlank(message = "支付方式不能为空|payType can not be null")
	private String payType; // 支付方式[1-微信；2-支付宝；3-线下汇款]

	private String thirdPartyOrd; // 第三方支付订单号

	private String pkgId; // 套餐id（会员套餐表id）
	
	private Integer goodsId; // 商品id
	
	private String img;  //封面图

	private String pkgTitle; // 套餐标题
	private String pkgTitleEn; // 套餐标题英文
	
    private String subheadCn;  // 商品副标题
    private String subheadEn;

	private String pkgIntroduction; // 套餐简介
	private String pkgIntroductionEn; // 套餐简介英文
	
	private String pkgDetail; // 套餐详情
	private String pkgDetailEn; // 套餐详情英文 

	@NotBlank(message = "购买有效期不能为空|The validity period of the purchase can not be empty")
	private String validityPeriod; // 购买有效期
	
	private String skuCn;		// sku
	private String skuEn;		// sku

	private String price; // 商品售价（单价）
	private String refundNo; // 退款金额

    private BigDecimal payableMoney;  //应付商品总金额

    private BigDecimal payableFreight;  //总运费金额

    private BigDecimal realFreight;  //实付运费

    private BigDecimal payPrice;   // 实际支付总金额（总价）
    
    private String goodsNo;    //商品的货号

    private Integer goodsNums;  //商品数量

    private BigDecimal goodsWeight;  //重量
	
	private Date orderTime; // 下单时间

	private Date payTime; // 支付时间

	private Date finishTime; // 到期时间
	
	private Date sendTime; // 发货时间
	
	
	private String invTitle; // 发票抬头
	private String taxationNo; // 税号
	private String ltdAdd; // 公司地址
	private String ltdTel; // 公司电话
	private String openingBank; // 开户行
	private String accountNumber; // 开户账号
	private String invContent; // 开票内容
	private String invMoney; // 开票金额
	private String recipientName; // 收件人姓名
	private String recipientTel; // 收件人电话
	private String recipientAdd; // 收件地址
	
	private Integer addId; // 地址id
	private String addrProvince;  //地址-省（中国）
	private String addrCity;  //地址-市（中国）
	private String addrArea;  //地址-区（中国）
	private String postcode; //邮编
	
	
	@NotNull(message = "类型区分|invType can not be null")
	private String invType; // 类型区分[0-不开票；1-普票；2-增值税发票]
	private String expressName; // 快递公司名（字典表维护，此处直接填名称）
	private String expressNo; // 快递单号
	private String ordStatus; // 订单状态[1-订单生成；2-已支付；3-取消订单（用户）；4-退款；9-作废（系统）]
	private String changeBy; // 订单状态修改者编号
	@NotNull(message = "订单来源不能为空|orderSource can not be null")
	private String orderSource; // 订单来源[ 1-PC, 2-微信 ]
	private String userDel; // 用户删除标志[ 0-正常, 1-已删除 ]
	
	private String distributionStatus;   //配送状态 0：未发送,1：已发送,2：部分发送

    private Short point;  //增加的积分

    private String type;  //0会员套餐订单 1个人服务,2企业服务,3商品购买，4积分兑换

    private String postscript;  //用户附言
	
	
	// 优惠券
	private Integer discountMoney;//抵扣金额
	private String tcCode;//券类别码
	private String tdCode;// 券详细码
	
	private String vipFlag;// vip标识
	
	private Date availableTo;		// 使用时间to
	
	public MdeOrders() {
		super();
	}
	
	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	// @NotNull(message="用户id不能为空")
	public String getUserCode() {
		return userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}

	// @Length(min=0, max=1, message="支付方式[1-微信；2-支付宝；3-线下汇款]长度必须介于 0 和 1 之间")
	public String getPayType() {
		return payType;
	}

	public void setPayType(String payType) {
		this.payType = payType;
	}

	// @Length(min=0, max=50, message="第三方支付订单号长度必须介于 0 和 50 之间")
	public String getThirdPartyOrd() {
		return thirdPartyOrd;
	}

	public void setThirdPartyOrd(String thirdPartyOrd) {
		this.thirdPartyOrd = thirdPartyOrd;
	}

	// @Length(min=1, max=11, message="套餐id（会员套餐表id）长度必须介于 1 和 11 之间")
	public String getPkgId() {
		return pkgId;
	}

	public void setPkgId(String pkgId) {
		this.pkgId = pkgId;
	}

	// @Length(min=1, max=10, message="套餐标题长度必须介于 1 和 10 之间")
	public String getPkgTitle() {
		return pkgTitle;
	}

	public void setPkgTitle(String pkgTitle) {
		this.pkgTitle = pkgTitle;
	}

	// @Length(min=1, max=50, message="套餐简介长度必须介于 1 和 50 之间")
	public String getPkgIntroduction() {
		return pkgIntroduction;
	}

	public void setPkgIntroduction(String pkgIntroduction) {
		this.pkgIntroduction = pkgIntroduction;
	}

	// @Length(min=1, max=11, message="购买有效期长度必须介于 1 和 11 之间")
	public String getValidityPeriod() {
		return validityPeriod;
	}

	public void setValidityPeriod(String validityPeriod) {
		this.validityPeriod = validityPeriod;
	}

	public String getPrice() {
		return price;
	}

	public void setPrice(String price) {
		this.price = price;
	}

	public String getRefundNo() {
		return refundNo;
	}

	public void setRefundNo(String refundNo) {
		this.refundNo = refundNo;
	}

	// @NotNull(message="下单时间不能为空")
	public Date getOrderTime() {
		return orderTime;
	}

	public void setOrderTime(Date orderTime) {
		this.orderTime = orderTime;
	}

	public Date getPayTime() {
		return payTime;
	}

	public void setPayTime(Date payTime) {
		this.payTime = payTime;
	}

	// @Length(min=0, max=50, message="发票抬头长度必须介于 0 和 50 之间")
	public String getInvTitle() {
		return invTitle;
	}

	public void setInvTitle(String invTitle) {
		this.invTitle = invTitle;
	}

	// @Length(min=0, max=20, message="税号长度必须介于 0 和 20 之间")
	public String getTaxationNo() {
		return taxationNo;
	}

	public void setTaxationNo(String taxationNo) {
		this.taxationNo = taxationNo;
	}

	// @Length(min=0, max=100, message="公司地址长度必须介于 0 和 100 之间")
	public String getLtdAdd() {
		return ltdAdd;
	}

	public void setLtdAdd(String ltdAdd) {
		this.ltdAdd = ltdAdd;
	}

	// @Length(min=0, max=12, message="公司电话长度必须介于 0 和 12 之间")
	public String getLtdTel() {
		return ltdTel;
	}

	public void setLtdTel(String ltdTel) {
		this.ltdTel = ltdTel;
	}

	// @Length(min=0, max=100, message="开户行长度必须介于 0 和 100 之间")
	public String getOpeningBank() {
		return openingBank;
	}

	public void setOpeningBank(String openingBank) {
		this.openingBank = openingBank;
	}

	// @Length(min=0, max=25, message="开户账号长度必须介于 0 和 25 之间")
	public String getAccountNumber() {
		return accountNumber;
	}

	public void setAccountNumber(String accountNumber) {
		this.accountNumber = accountNumber;
	}

	// @Length(min=0, max=50, message="开票内容长度必须介于 0 和 50 之间")
	public String getInvContent() {
		return invContent;
	}

	public void setInvContent(String invContent) {
		this.invContent = invContent;
	}

	public String getInvMoney() {
		return invMoney;
	}

	public void setInvMoney(String invMoney) {
		this.invMoney = invMoney;
	}

	// @Length(min=0, max=50, message="收件人姓名长度必须介于 0 和 50 之间")
	public String getRecipientName() {
		return recipientName;
	}

	public void setRecipientName(String recipientName) {
		this.recipientName = recipientName;
	}

	// @Length(min=0, max=12, message="收件人电话长度必须介于 0 和 12 之间")
	public String getRecipientTel() {
		return recipientTel;
	}

	public void setRecipientTel(String recipientTel) {
		this.recipientTel = recipientTel;
	}

	// @Length(min=0, max=100, message="收件地址长度必须介于 0 和 100 之间")
	public String getRecipientAdd() {
		return recipientAdd;
	}

	public void setRecipientAdd(String recipientAdd) {
		this.recipientAdd = recipientAdd;
	}

	// @Length(min=1, max=1, message="类型区分[0-不开票；1-普票；2-增值税发票]长度必须介于 1 和 1 之间")
	public String getInvType() {
		return invType;
	}

	public void setInvType(String invType) {
		this.invType = invType;
	}

	// @Length(min=0, max=50, message="快递公司名（字典表维护，此处直接填名称）长度必须介于 0 和 50 之间")
	public String getExpressName() {
		return expressName;
	}

	public void setExpressName(String expressName) {
		this.expressName = expressName;
	}

	// @Length(min=0, max=50, message="快递单号长度必须介于 0 和 50 之间")
	public String getExpressNo() {
		return expressNo;
	}

	public void setExpressNo(String expressNo) {
		this.expressNo = expressNo;
	}

	// @Length(min=1, max=255,
	// message="订单状态[1-订单生成；2-已支付；3-取消订单（用户）；4-退款；9-作废（系统）]长度必须介于 1 和 255 之间")
	public String getOrdStatus() {
		return ordStatus;
	}

	public void setOrdStatus(String ordStatus) {
		this.ordStatus = ordStatus;
	}

	// @Length(min=0, max=128, message="订单状态修改者编号长度必须介于 0 和 128 之间")
	public String getChangeBy() {
		return changeBy;
	}

	public void setChangeBy(String changeBy) {
		this.changeBy = changeBy;
	}

	public String getOrderSource() {
		return orderSource;
	}

	public void setOrderSource(String orderSource) {
		this.orderSource = orderSource;
	}

	public String getUserDel() {
		return userDel;
	}

	public void setUserDel(String userDel) {
		this.userDel = userDel;
	}

	public Date getFinishTime() {
		return finishTime;
	}

	public void setFinishTime(Date finishTime) {
		this.finishTime = finishTime;
	}

	public String getPkgDetail() {
		return pkgDetail;
	}

	public void setPkgDetail(String pkgDetail) {
		this.pkgDetail = pkgDetail;
	}

	public String getPkgTitleEn() {
		return pkgTitleEn;
	}

	public void setPkgTitleEn(String pkgTitleEn) {
		this.pkgTitleEn = pkgTitleEn;
	}

	public String getPkgIntroductionEn() {
		return pkgIntroductionEn;
	}

	public void setPkgIntroductionEn(String pkgIntroductionEn) {
		this.pkgIntroductionEn = pkgIntroductionEn;
	}

	public String getPkgDetailEn() {
		return pkgDetailEn;
	}

	public void setPkgDetailEn(String pkgDetailEn) {
		this.pkgDetailEn = pkgDetailEn;
	}

	public Integer getDiscountMoney() {
		return discountMoney;
	}

	public void setDiscountMoney(Integer discountMoney) {
		this.discountMoney = discountMoney;
	}

	public String getTcCode() {
		return tcCode;
	}

	public void setTcCode(String tcCode) {
		this.tcCode = tcCode;
	}

	public String getTdCode() {
		return tdCode;
	}

	public void setTdCode(String tdCode) {
		this.tdCode = tdCode;
	}

	public String getVipFlag() {
		return vipFlag;
	}

	public void setVipFlag(String vipFlag) {
		this.vipFlag = vipFlag;
	}

	public Date getAvailableTo() {
		return availableTo;
	}

	public void setAvailableTo(Date availableTo) {
		this.availableTo = availableTo;
	}

	public String getSkuCn() {
		return skuCn;
	}

	public void setSkuCn(String skuCn) {
		this.skuCn = skuCn;
	}

	public String getSkuEn() {
		return skuEn;
	}

	public void setSkuEn(String skuEn) {
		this.skuEn = skuEn;
	}

	public Integer getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(Integer goodsId) {
		this.goodsId = goodsId;
	}

	public String getImg() {
		return img;
	}

	public void setImg(String img) {
		this.img = img;
	}

	public String getSubheadCn() {
		return subheadCn;
	}

	public void setSubheadCn(String subheadCn) {
		this.subheadCn = subheadCn;
	}

	public String getSubheadEn() {
		return subheadEn;
	}

	public void setSubheadEn(String subheadEn) {
		this.subheadEn = subheadEn;
	}

	public BigDecimal getPayableFreight() {
		return payableFreight;
	}

	public void setPayableFreight(BigDecimal payableFreight) {
		this.payableFreight = payableFreight;
	}

	public BigDecimal getRealFreight() {
		return realFreight;
	}

	public void setRealFreight(BigDecimal realFreight) {
		this.realFreight = realFreight;
	}

	public String getGoodsNo() {
		return goodsNo;
	}

	public void setGoodsNo(String goodsNo) {
		this.goodsNo = goodsNo;
	}

	public Integer getGoodsNums() {
		return goodsNums;
	}

	public void setGoodsNums(Integer goodsNums) {
		this.goodsNums = goodsNums;
	}

	public BigDecimal getGoodsWeight() {
		return goodsWeight;
	}

	public void setGoodsWeight(BigDecimal goodsWeight) {
		this.goodsWeight = goodsWeight;
	}

	public BigDecimal getPayableMoney() {
		return payableMoney;
	}

	public void setPayableMoney(BigDecimal payableMoney) {
		this.payableMoney = payableMoney;
	}
	
	public void setPayableMoney(String payableMoney) {
		this.payableMoney = new BigDecimal(payableMoney);
	}


	public BigDecimal getPayPrice() {
		return payPrice;
	}

	public void setPayPrice(BigDecimal payPrice) {
		this.payPrice = payPrice;
	}

	public Date getSendTime() {
		return sendTime;
	}

	public void setSendTime(Date sendTime) {
		this.sendTime = sendTime;
	}

	public String getDistributionStatus() {
		return distributionStatus;
	}

	public void setDistributionStatus(String distributionStatus) {
		this.distributionStatus = distributionStatus;
	}

	public Short getPoint() {
		return point;
	}

	public void setPoint(Short point) {
		this.point = point;
	}

	public String getPostscript() {
		return postscript;
	}

	public void setPostscript(String postscript) {
		this.postscript = postscript;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getAddrProvince() {
		return addrProvince;
	}

	public void setAddrProvince(String addrProvince) {
		this.addrProvince = addrProvince;
	}

	public String getAddrCity() {
		return addrCity;
	}

	public void setAddrCity(String addrCity) {
		this.addrCity = addrCity;
	}

	public String getAddrArea() {
		return addrArea;
	}

	public void setAddrArea(String addrArea) {
		this.addrArea = addrArea;
	}

	public String getPostcode() {
		return postcode;
	}

	public void setPostcode(String postcode) {
		this.postcode = postcode;
	}

	public Integer getAddId() {
		return addId;
	}

	public void setAddId(Integer addId) {
		this.addId = addId;
	}
	
}