package com.xinelu.manage.domain.trainingorder;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 学习培训订单主对象 training_order
 *
 * @author xinyilu
 * @date 2023-04-20
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "学习培训订单主对象", description = "training_order")
public class TrainingOrder extends BaseDomain implements Serializable {
    private static final long serialVersionUID = -3426704831943215090L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 护理站id
     */
    @ApiModelProperty(value = "护理站id")
    @Excel(name = "护理站id")
    @NotNull(message = "护理站id不能为空", groups = {Insert.class})
    private Long nurseStationId;

    /**
     * 护理员表id
     */
    @ApiModelProperty(value = "护理员表id")
    @Excel(name = "护理员表id")
    @NotNull(message = "护理员表id不能为空", groups = {Insert.class})
    private Long nurseStationPersonId;

    /**
     * 护理员姓名
     */
    @ApiModelProperty(value = "护理员姓名")
    @Excel(name = "护理员姓名")
    private String nursePersonName;

    /**
     * 订单编号
     */
    @ApiModelProperty(value = "订单编号")
    @Excel(name = "订单编号")
    private String trainingOrderNo;

    /**
     * 订单状态，待付款：WAIT_PAY，已付款：PAY，退款中：WAIT_REFUND，已退款：REFUNDED，已取消：CANCEL
     */
    @ApiModelProperty(value = "订单状态，待付款：WAIT_PAY，已付款：PAY，退款中：WAIT_REFUND，已退款：REFUNDED，已取消：CANCEL")
    @Excel(name = "订单状态，待付款：WAIT_PAY，已付款：PAY，退款中：WAIT_REFUND，已退款：REFUNDED，已取消：CANCEL")
    private String trainingOrderStatus;

    /**
     * 订单金额
     */
    @ApiModelProperty(value = "订单金额")
    @Excel(name = "订单金额")
    @NotNull(message = "订单金额不能为空", groups = {Insert.class})
    private BigDecimal trainingOrderAmount;

    /**
     * 下单方式，手机App：MOBILE_APP，微信小程序：WECHAT_APPLET，支付宝小程序：ALI_PAY_APPLET
     */
    @ApiModelProperty(value = "下单方式，手机App：MOBILE_APP，微信小程序：WECHAT_APPLET，支付宝小程序：ALI_PAY_APPLET")
    @Excel(name = "下单方式，手机App：MOBILE_APP，微信小程序：WECHAT_APPLET，支付宝小程序：ALI_PAY_APPLET")
    @NotBlank(message = "下单方式不能为空", groups = {Insert.class})
    private String trainingOrderChannel;

    /**
     * 下单时间，yyyy-MM-dd HH:mm:ss
     */
    @ApiModelProperty(value = "下单时间，yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "下单时间，yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd")
    private LocalDateTime trainingOrderTime;

    /**
     * 是否删除标识，0：否，1：是
     */
    private Integer delFlag;

    /**
     * 备注信息
     */
    private String remark;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("nurseStationId", getNurseStationId())
                .append("nurseStationPersonId", getNurseStationPersonId())
                .append("nursePersonName", getNursePersonName())
                .append("trainingOrderNo", getTrainingOrderNo())
                .append("trainingOrderStatus", getTrainingOrderStatus())
                .append("trainingOrderAmount", getTrainingOrderAmount())
                .append("trainingOrderChannel", getTrainingOrderChannel())
                .append("trainingOrderTime", getTrainingOrderTime())
                .append("remark", getRemark())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}