package com.xinelu.manage.domain.goodsOrder;

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 com.xinelu.common.custominterface.Update;
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.hibernate.validator.constraints.Length;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 商品订单对象 goods_order
 *
 * @author xinyilu
 * @date 2022-10-18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "商品订单对象", description = "goods_order")
public class GoodsOrder extends BaseDomain implements Serializable {
    private static final long serialVersionUID = -2094816535111845905L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 护理站id
     */
    @ApiModelProperty(value = "护理站id")
    @Excel(name = "护理站id")
    private Long nurseStationId;

    /**
     * 会员id
     */
    @ApiModelProperty(value = "会员id")
    @Excel(name = "会员id")
    private Long patientId;

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

    /**
     * 订单状态，待付款：WAIT_PAY，已付款：PAY，已取消：CANCEL，待收货：WAIT_RECEIVED，已收货：RECEIVED，待退款：WAIT_REFUND，已退款：REFUNDED，待退货：WAIT_RETURNED，已退货：RETURNED
     * RECEIVED_GOODS (商品订单为:待评价，专家咨询订单为:待服务)，已完成：COMPLETED（专家咨询订单使用）
     */
    @ApiModelProperty(value = "订单状态，待付款：WAIT_PAY，已付款：PAY，已取消：CANCEL，待收货：WAIT_RECEIVED，已收货：RECEIVED，待退款：WAIT_REFUND，已退款：REFUNDED，待退货：WAIT_RETURNED，已退货：RETURNED")
    @Excel(name = "订单状态，待付款：WAIT_PAY，已付款：PAY，已取消：CANCEL，待收货：WAIT_RECEIVED，已收货：RECEIVED，待退款：WAIT_REFUND，已退款：REFUNDED，待退货：WAIT_RETURNED，已退货：RETURNED")
    private String orderStatus;

    /**
     * 订单总金额
     */
    @ApiModelProperty(value = "订单总金额")
    @Excel(name = "订单总金额")
    private BigDecimal totalPrice;

    /**
     * 收货人
     */
    @ApiModelProperty(value = "收货人")
    @Excel(name = "收货人")
    private String receiver;

    /**
     * 收货地址
     */
    @ApiModelProperty(value = "收货地址")
    @Excel(name = "收货地址")
    private String receiveAddress;

    /**
     * 联系电话
     */
    @ApiModelProperty(value = "联系电话")
    @Excel(name = "联系电话")
    private String phone;

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

    /**
     * 下班方式，手机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")
    private String orderChannel;

    /**
     * 护理站：NURSE_STATION，商城：SHOPPING_MALL 健康咨询：HEALTH_CONSULTATION
     */
    @ApiModelProperty(value = "护理站：NURSE_STATION，商城：SHOPPING_MALL 健康咨询：HEALTH_CONSULTATION")
    @Excel(name = "护理站：NURSE_STATION，商城：SHOPPING_MALL 健康咨询：HEALTH_CONSULTATION")
    private String buySource;

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

    /**
     * 退款退货类型：REFUND_MONEY_GOODS，仅退款：ONLY_REFUND_MONEY
     */
    private String refundType;

    /**
     * 退款原因类型字典表id
     */
    private Long refundReasonDictId;

    /**
     * 退货原因具体描述
     */
    @Length(max = 300, message = "退货原因具体描述不能超过50个字符", groups = {Insert.class, Update.class})
    private String refundReasonRemark;

    /**
     * 确认退款状态，未确认：NOT_CONFIRM，已确认：CONFIRMED
     */
    private String confirmRefundStatus;

    /**
     * 快递单号
     */
    @Length(max = 50, message = "快递单号不能超过50个字符", groups = {Insert.class, Update.class})
    private String expressNo;

    /**
     * 订单类型，积分兑换：INTEGRAL_EXCHANGE，直接购买：DIRECT_BUY，健康咨询：HEALTH_CONSULTATION
     */
    private String orderType;

    /**
     * 健康咨询人员表id，记录咨询订单中选择的医生
     */
    private Long hospitalPersonId;

    /**
     * 订单原始价格，优惠之前的价格即：商品数量 * 商品单价
     */
    private BigDecimal originalTotalPrice;

    /**
     * 健康咨询内容，健康咨询类型的订单使用
     **/
    private String healthConsultationContent;

    /**
     * 健康咨询预约时间，健康咨询订单使用
     **/
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date healthAppointDate;

    /**
     * 健康咨询专家名称，健康咨询类型的订单使用
     */
    private String hospitalPersonName;

    /**
     * 专家咨询信息表id
     */
    private Long consultationInfoId;

	/**
	 * 房间号--视频问诊用
	 */
	private String roomId;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("nurseStationId", getNurseStationId())
                .append("patientId", getPatientId())
                .append("orderNo", getOrderNo())
                .append("orderStatus", getOrderStatus())
                .append("totalPrice", getTotalPrice())
                .append("receiver", getReceiver())
                .append("receiveAddress", getReceiveAddress())
                .append("phone", getPhone())
                .append("orderTime", getOrderTime())
                .append("orderChannel", getOrderChannel())
                .append("buySource", getBuySource())
                .append("expressNo", getExpressNo())
                .append("remark", getRemark())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
	            .append("roomId", getRoomId())
                .toString();
    }
}
