package com.ruoyi.info.order.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ruoyi.common.annotation.ExcelDictFormat;
import com.ruoyi.common.annotation.Sensitive;
import com.ruoyi.common.convert.ExcelDictConvert;
import com.ruoyi.common.convert.ExcelEnumConvert;
import com.ruoyi.common.enums.SensitiveStrategy;
import com.ruoyi.common.filepathsplicing.FilePathValue;
import com.ruoyi.info.hospital.domain.vo.HospitalVo;
import com.ruoyi.info.order.enums.CancellationMethod;
import com.ruoyi.info.order.enums.OrderStatus;
import com.ruoyi.info.order.enums.PayMethod;
import com.ruoyi.info.patient.domain.vo.PatientVo;
import com.ruoyi.info.service.enums.ServiceUnit;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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


/**
 * 订单视图对象 tb_order
 *
 * @author ruoyi
 * @date 2025-09-20
 */
@Data
@ApiModel("订单视图对象")
@ExcelIgnoreUnannotated
public class OrderVo {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @ApiModelProperty("ID")
    private Long id;

    /**
     * 订单号
     */
    @ExcelProperty(value = "订单号", order = 1)
    @ApiModelProperty("订单号")
    private String orderNo;

    /**
     * C端用户ID
     */
    @ApiModelProperty("C端用户ID")
    private Long userId;
    @ExcelProperty(value = "下单人姓名", order = 2)
    @ApiModelProperty(value = "C端用户名称")
    private String userName;
    @ExcelProperty(value = "下单手机号", order = 3)
    @ApiModelProperty(value = "C端用户手机号")
    private String userMobile;

    /**
     * 状态
     */
    @ExcelProperty(value = "订单状态", converter = ExcelEnumConvert.class, order = 5)
    @ExcelDictFormat(readConverterExp = "1=待确认,2=待服务,3=进行中,5=已完成,6=已取消,7=已退款")
    @ApiModelProperty("状态")
    private OrderStatus status;

    /**
     * 医院ID
     */
    @ApiModelProperty("医院ID")
    private Long hospitalId;
    @ApiModelProperty("医院信息冗余")
    private String hospitalInfo;
    @ExcelProperty(value = "下单医院", order = 6)
    @ApiModelProperty(value = "医院名称")
    private String hospitalName;
    @ExcelProperty(value = "医院地址", order = 8)
    private String hospitalAddress;
    @FilePathValue
    @ApiModelProperty(value = "医院信息")
    private HospitalVo hospitalVo;

    /**
     * 医院科室ID
     */
    @ApiModelProperty("医院科室ID")
    private Long hospitalDepartmentId;
    @ApiModelProperty("医院科室信息冗余")
    private String hospitalDepartmentInfo;
    @ExcelProperty(value = "所在科室", order = 7)
    @ApiModelProperty(value = "医院科室名称")
    private String hospitalDepartmentName;

    /**
     * 房床号
     */
    @ExcelProperty(value = "房床号", order = 11)
    @ApiModelProperty("房床号")
    private String roomNumber;

    /**
     * 订单备注
     */
    @ExcelProperty(value = "订单备注", order = 16)
    @ApiModelProperty("订单备注")
    private String remarks;

    /**
     * 就诊人ID
     */
    @ApiModelProperty("就诊人ID")
    private Long patientId;
    @ApiModelProperty("就诊人信息冗余")
    private String patientInfo;
    @ApiModelProperty("就诊人信息")
    private PatientVo patientVo;
    @ExcelProperty(value = "就诊人姓名", order = 17)
    @ApiModelProperty("就诊人姓名")
    private String patientName;
    @Sensitive(strategy = SensitiveStrategy.PHONE)
    @ExcelProperty(value = "就诊人电话", order = 18)
    @ApiModelProperty("手机号")
    private String patientMobile;
    @ExcelProperty(value = "就诊人性别", converter = ExcelDictConvert.class, order = 19)
    @ExcelDictFormat(dictType = "sys_user_sex")
    @ApiModelProperty("性别 0：未知、1：男、2：女")
    private Integer patientGender;
    @ExcelProperty(value = "就诊人年龄", order = 20)
    @ApiModelProperty("年龄")
    private Integer patientAge;
    @ExcelProperty(value = "就诊人关系", converter = ExcelDictConvert.class, order = 21)
    @ExcelDictFormat(dictType = "patient_relationship")
    @ApiModelProperty("关系")
    private String patientRelationship;

    /**
     * 服务ID
     */
    @ApiModelProperty("服务ID")
    private Long serviceId;
    @ApiModelProperty("服务信息冗余")
    private String serviceInfo;
    @ExcelProperty(value = "服务名称", order = 10)
    @ApiModelProperty("服务名称")
    private String serviceName;
    /**
     * 服务单位
     */
    @ExcelProperty(value = "服务单位", converter = ExcelEnumConvert.class, order = 13)
    @ExcelDictFormat(readConverterExp = "0=天,1=小时,2=次,3=套")
    @ApiModelProperty("服务单位")
    private ServiceUnit serviceUnit;
    /**
     * 服务单位时长
     */
    @ApiModelProperty("服务单位时长")
    private Integer serviceUnitDuration;

    /**
     * 期望时间
     */
    @ExcelProperty(value = "期望时间", order = 9)
    @ApiModelProperty("期望时间")
    private Date expectedTime;

    /**
     * 下单数量
     */
    @ExcelProperty(value = "下单数量", order = 12)
    @ApiModelProperty("下单数量")
    private Integer orderNum;

    /**
     * 销售价
     */
    @ExcelProperty(value = "销售价", order = 14)
    @ApiModelProperty("销售价")
    private BigDecimal sellingPrice;

    /**
     * 应付价格
     */
    @ExcelProperty(value = "应付金额", order = 15)
    @ApiModelProperty("应付价格")
    private BigDecimal totalPrice;
    /**
     * 实付价格
     */
    @ExcelProperty(value = "实付金额")
    @ApiModelProperty("实付价格")
    private BigDecimal payPrice;
    /**
     * 支付方式
     */
    @ExcelProperty(value = "支付方式", converter = ExcelEnumConvert.class)
    @ExcelDictFormat(readConverterExp = "wx=微信")
    @ApiModelProperty("支付方式")
    private PayMethod payMethod;
    /**
     * 订单支付时间
     */
    @ExcelProperty(value = "订单支付时间")
    @ApiModelProperty("订单支付时间")
    private Date payTime;
    /**
     * 订单支付流水号
     */
    @ExcelProperty(value = "订单支付流水号")
    @ApiModelProperty("订单支付流水号")
    private String payTradeNo;
    /**
     * 护工ID
     */
    @ApiModelProperty("护工ID")
    private Long workerId;

    /**
     * 订单取消方式(10用户取消,20平台取消,30未支付自动取消)
     */
    @ApiModelProperty("订单取消方式")
    private CancellationMethod cancellationMethod;
    /**
     * 订单取消时间
     */
    @ApiModelProperty("订单取消时间")
    private Date cancellationTime;
    /**
     * 订单取消原因
     */
    @ApiModelProperty("订单取消原因")
    private String cancellationReason;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "下单时间", order = 4)
    @ApiModelProperty("创建时间")
    private Date createTime;

    /**
     * 修改时间
     */
    @ApiModelProperty("修改时间")
    private Date updateTime;

    @ApiModelProperty("订单护工信息")
    private OrderWorkerChangeRecordVo orderWorkerChangeRecord;

    @ApiModelProperty("订单评价信息")
    private OrderReviewsVo orderReviews;
}
