package com.sunxung.factoring.entity.project.payment;

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

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotBlank;

import com.alibaba.fastjson.annotation.JSONField;
import com.sunxung.factoring.component.annotation.ObjectValidator;
import com.sunxung.factoring.entity.project.Project;
import com.sunxung.factoring.entity.sys.Dictionary;

/**
 * @Description:放款申请基础实体
 * <p>
 * 付款编号规则：3位英文字母FIN+4位年+2位月+2位日，后接自然数，每天从001开始<br>
 * 说明：放款申请基础实体与放款申请实体，均有付款类型、金额、币种重复字段。<br>
 * 因为申请——>提交，若否决再回到申请，也就是说，申请会存在历史数据，而此次放款申请的最终结果 必须由基础实体来保存。
 * </p>
 * @Author:wanxiangZhou
 * @E-mail:zhouyu@sunxung.cn
 * @Date:2018年9月19日 上午9:55:12
 */
public class PaymentApplyBasic extends Project {

    private static final long serialVersionUID = 1L;
    /** 付款编号 **/
    private String paymentNo;
    @NotBlank(message = "付款类型不能为空", groups = {
            Update.class
    })
    private String paymentType;// 要求与ConstantConversionUtil.java中paymentTypeMap常量值一致
    @NotNull(message = "付款金额不能为空", groups = {
            Update.class
    })
    private BigDecimal paymentAmount;
    @ObjectValidator(message = "币种不能为空", groups = {
            Update.class
    })
    private Dictionary currencyType;
    @NotNull(message = "计划付款日期不能为空", groups = {
            Update.class
    })
    @JSONField(format = "yyyy-MM-dd")
    private Date paymentDatePlan;


    public String getPaymentNo() {
        return paymentNo;
    }

    public void setPaymentNo(String paymentNo) {
        this.paymentNo = paymentNo;
    }

    public String getPaymentType() {
        return paymentType;
    }

    public void setPaymentType(String paymentType) {
        this.paymentType = paymentType;
    }

    public BigDecimal getPaymentAmount() {
        return paymentAmount;
    }

    public void setPaymentAmount(BigDecimal paymentAmount) {
        this.paymentAmount = paymentAmount;
    }

    public Dictionary getCurrencyType() {
        return currencyType;
    }

    public void setCurrencyType(Dictionary currencyType) {
        this.currencyType = currencyType;
    }

    public Date getPaymentDatePlan() {
        return paymentDatePlan;
    }

    public void setPaymentDatePlan(Date paymentDatePlan) {
        this.paymentDatePlan = paymentDatePlan;
    }
}
