package cn.superdesk.uniorder.openapi.api._thirdpart.qchjc._dto.accounting;

import cn.superdesk.uniorder.openapi.annotation.GreaterThanZero;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.Valid;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Description:
 * @Author: linjinyu
 * @CreateDate: 2022-02-18 11:31:50
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022-02-18 11:31:50
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@ToString
public class QchjcSupplierStatementDto implements Serializable {

    @ApiModelProperty(value = "对账单-结算金额")
    @NotNull(message = "不能为空")
    @DecimalMin(value = "0", message = "金额需大于等于0.00")
    private BigDecimal accountingAmount;
    @ApiModelProperty(value = "对账单-编号")
    @NotBlank(message = "不能为空")
    private String     accountingOrderSn;
    @ApiModelProperty(value = "对账单 状态:0-未确认;1-已确认;-1-已取消;")
    @NotNull(message = "不能为空")
    @Range(min = 1, max = 1, message = "只接收已对账的对账单同步，请检查对账单状态")
    private Integer    accountingStatus;

    @ApiModelProperty(value = "联系人(收票人)-邮箱")
    @NotBlank(message = "不能为空")
    private String contactsEmail;
    @ApiModelProperty(value = "联系人(收票人)-地址")
    @NotBlank(message = "不能为空")
    private String contactsFullAddress;
    @ApiModelProperty(value = "联系人(收票人)-名称")
    @NotBlank(message = "不能为空")
    private String contactsName;
    @ApiModelProperty(value = "联系人(收票人)-电话")
    @NotBlank(message = "不能为空")
    private String contactsPhone;

    @ApiModelProperty(value = "系统信息-创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "不能为空")
    private Date   createTime;
    @ApiModelProperty(value = "系统信息-创建人(申请人)Id")
    @NotNull(message = "不能为空")
    private String createUserId;
    @NotBlank(message = "不能为空")
    private String createUserName;

    @ApiModelProperty(value = "账单周期 基于(对映订单里四个时间):1-发货时间;2-下单时间;3-完成时间;4-结算时间;")
    @NotNull(message = "不能为空")
    @Range(min = 1, max = 4, message = "数据参数错误，请检查")
    private Integer dateType;
    @ApiModelProperty(value = "账单周期-开始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "不能为空")
    private Date    startTime;
    @ApiModelProperty(value = "账单周期-结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "不能为空")
    private Date    endTime;

    @ApiModelProperty(value = "发票申请-发票信息-发票类型(关联表:invoice_type.id)")
    @NotNull(message = "不能为空")
    @Range(min = 1, max = 4, message = "数据参数错误，请检查")
    private Integer invoiceType;

    @ApiModelProperty("订单dto为引用值 List<UnifiedOrderDto>")
    @NotEmpty(message = "不能为空")
    @Valid
    private List<QchjcSupplierOrderDto> orderSelected;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "对账单-销方信息-地址")
    @NotBlank(message = "不能为空")
    private String sellerAddress;
    @ApiModelProperty(value = "对账单-销方信息-邮箱")
    @NotBlank(message = "不能为空")
    private String sellerEmail;
    @ApiModelProperty(value = "对账单-销方信息-电话")
    @NotBlank(message = "不能为空")
    private String sellerPhone;
    @ApiModelProperty(value = "对账单-销方信息-所属供应商Id")
    @NotNull(message = "不能为空")
    private String sellerSupplierId;
    @ApiModelProperty(value = "对账单-销方信息-所属供应商名称")
    @NotBlank(message = "不能为空")
    private String sellerSupplierName;
    @ApiModelProperty(value = "对账单-销方信息-用户Id")
    @NotNull(message = "不能为空")
    private String sellerUserId;
    @ApiModelProperty(value = "对账单-销方信息-实名或昵称-用于显示-非登陆用")
    @NotBlank(message = "不能为空")
    private String sellerUserName;

//	@ApiModelProperty(value = "对账单-返点金额")
//	@DecimalMin(value = "0",message = "返点金额需大于等于0.00")
//	@NotNull(message = "不能为空")
//	private BigDecimal rebateAmount;
//	@ApiModelProperty(value = "对账单-订单金额=结算金额+不结算金额")
//	@DecimalMin(value = "0",message = "订单金额需大于等于0.00")
//	@NotNull(message = "不能为空")
//	private BigDecimal statisticsTotalAmount;
//	@ApiModelProperty(value = "对账单-不结算金额")
//	@DecimalMin(value = "0",message = "金额需大于等于0.00")
//	@NotNull(message = "不能为空")
//	private BigDecimal unAccountingAmount;
//	@ApiModelProperty(value = "集采不对账金额")
//	@DecimalMin(value = "0",message = "金额需大于等于0.00")
//	@NotNull(message = "不能为空")
//	private BigDecimal jcUnAccountingAmount;

    @ApiModelProperty(value = "系统信息-更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "不能为空")
    private Date    updateTime;
    @ApiModelProperty(value = "系统信息-更新人Id")
    @NotNull(message = "不能为空")
    private String  updateUserId;
    @NotBlank(message = "不能为空")
    private String  updateUserName;
    @ApiModelProperty(value = "此对账单包含的所有发票单数量")
    @NotNull(message = "不能为空")
    @GreaterThanZero(message = "发票单数量必须大于0")
    private Integer invoiceCount;

    private static final long serialVersionUID = 1L;
}
