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


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: 2021-12-02 14:22:17
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021-12-02 14:22:17
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@ToString
public class QchjcOrderDto implements Serializable {

    @ApiModelProperty("结算时间;")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "不能为空")
    private Date    accountingTime;
    @ApiModelProperty("完成状态;业务方归类订单状态推送完成状态:1-已完成;2-未完成;3-已取消/已作废/已删除;")
    @Range(max = 1, min = 1, message = "不接收非已完成的数据，请检查")
    private Integer completState;
    @ApiModelProperty("订单 创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "不能为空")
    private Date    createTime;
    @ApiModelProperty("订单 创建人Id")
    @NotNull(message = "不能为空")
    private String  createUserId;

    @ApiModelProperty("物流单号")
    private String expressSn;
    @ApiModelProperty("快递拼音简写")
    private String express;
    @ApiModelProperty("快递名称 eg:京东快递;韵达快运")
    private String expressCompany;

    @ApiModelProperty("订单 完成时间;")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "不能为空")
    private Date finishTime;

    @ApiModelProperty("订单销售金额=运费+商品销售金额")
    @NotNull(message = "不能为空")
    @DecimalMin(value = "0", message = "金额需大于等于0.00")
    private BigDecimal orderAmount;
    @ApiModelProperty("订单成本金额")
    @NotNull(message = "不能为空")
    @DecimalMin(value = "0", message = "金额需大于等于0.00")
    private BigDecimal orderCostAmount;

    @ApiModelProperty("订单商品dto为引用值 List<QchjcOrderGoodsDto>")
    @NotEmpty(message = "不能为空")
    @Valid
    List<QchjcOrderGoodsDto> orderGoodsSelected;

    @ApiModelProperty("订单号")
    @NotBlank(message = "不能为空")
    private String  orderSn;
    @ApiModelProperty("外部订单号")
    @NotBlank(message = "不能为空")
    private String  orderSnOutTrade;
    @ApiModelProperty("订单状态(第三方系统)")
    @NotNull(message = "不能为空")
    private Integer orderState;
    @ApiModelProperty("订单状态名称(第三方系统)")
    @NotNull(message = "不能为空")
    private String  orderStateName;
    @ApiModelProperty("订单类型:1-订单;2-退单")
    @NotNull(message = "不能为空")
    @Range(min = 1, max = 2, message = "订单状态参数异常，1-订单，2-退单")
    private Integer orderType;
    @ApiModelProperty("其他属性(第三方系统对映统一订单字段对映不上时,字段差集作为Json结构体填充)")
    private String  otherParams;
    @ApiModelProperty("第三方接口-快照订单Id")
    @NotNull(message = "不能为空")
    private String  outSnapshotOrderId;

    @ApiModelProperty("付款状态(第三方系统)")
    private Integer payState;
    @ApiModelProperty("支付状态名称(第三方系统)")
    private String  payStateName;
    @ApiModelProperty("订单 支付时间;")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date    payTime;
    @ApiModelProperty("支付方式(第三方系统)")
    @NotNull(message = "不能为空")
    private Integer payType;
    @ApiModelProperty("支付方式名称(第三方系统)")
    @NotNull(message = "不能为空")
    private String  payTypeName;

    @ApiModelProperty("下单人-部门")
    private String purchaseDepartmentName;
    @ApiModelProperty("下单人-联系电话")
    private String purchasePhone;
    @ApiModelProperty("下单人-采购员Id")
    private String purchaseUserId;
    @ApiModelProperty("下单人-采购员名字")
    private String purchaseUserName;
    @ApiModelProperty("下单人-企业-引用值")
    @NotNull(message = "不能为空")
    private String purchaseVirtId;
    @ApiModelProperty("下单人-企业-引用值")
    @NotNull(message = "不能为空")
    private String purchaseVirtName;

    @ApiModelProperty("收货方-详细地址")
    private String recAddress;
    @ApiModelProperty("收货方-Id")
    private String recUserId;
    @ApiModelProperty("收货方-名称")
    private String recUserName;
    @ApiModelProperty("收货方-电话")
    private String recUserPhone;

    @ApiModelProperty("退单号")
    private String refundOrderSn;


    @ApiModelProperty("备注")
    private String remarks;

    @ApiModelProperty("订单 发货时间;")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date sendTime;

    @ApiModelProperty("销售方-引用值")
    @NotNull(message = "不能为空")
    private String supplierId;
    @ApiModelProperty("销售方-引用值")
    @NotNull(message = "不能为空")
    private String supplierName;

    @ApiModelProperty("运费")
    private BigDecimal transportAmount;
    @ApiModelProperty("商户承担运费")
    private BigDecimal transportMerchantAssumeAmount;

    @ApiModelProperty("成功持久化后产生-不必传")
    private Long unifiedOrderId;

    @ApiModelProperty("订单 最后更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "不能为空")
    private Date   updateTime;
    @ApiModelProperty("订单 最后更新人Id")
    @NotNull(message = "不能为空")
    private String updateUserId;

    @ApiModelProperty("项目ID-固定值")
    private Long   outOrgId;
    @ApiModelProperty("项目名称-固定值")
    private String outOrgName;

    private static final long serialVersionUID = 1L;
}
