package com.gxwebsoft.clinic.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gxwebsoft.shop.entity.ShopOrder;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

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

/**
 * 处方主表

 *
 * @author 科技小王子
 * @since 2025-10-22 02:01:13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "ClinicPrescription对象", description = "处方主表")
public class ClinicPrescription implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "患者")
    private Integer userId;

    @Schema(description = "患者名称")
    @TableField(exist = false)
    private String realName;

    @Schema(description = "年龄")
    @TableField(exist = false)
    private String age;

    @Schema(description = "身高")
    @TableField(exist = false)
    private String height;

    @Schema(description = "体重")
    @TableField(exist = false)
    private String weight;

    @Schema(description = "医生")
    private Integer doctorId;

    @Schema(description = "医生名称")
    @TableField(exist = false)
    private String doctorName;

    @Schema(description = "医生资格")
    @TableField(exist = false)
    private String qualification;

    @Schema(description = "订单编号")
    private String orderNo;

    @Schema(description = "0未付款，1已付款")
    @TableField(exist = false)
    private Boolean payStatus;

    @Schema(description = "0未使用，1已完成，2已取消，3取消中，4退款申请中，5退款被拒绝，6退款成功，7客户端申请退款")
    @TableField(exist = false)
    private Integer orderStatus;

    @Schema(description = "关联就诊表")
    private Integer visitRecordId;

    @Schema(description = "处方类型 0中药 1西药")
    private Integer prescriptionType;

    @Schema(description = "诊断结果")
    private String diagnosis;

    @Schema(description = "治疗方案")
    private String treatmentPlan;

    @Schema(description = "煎药说明")
    private String decoctionInstructions;

    @Schema(description = "上传附件")
    private String image;

    @Schema(description = "订单总金额")
    private BigDecimal orderPrice;

    @Schema(description = "单价")
    private BigDecimal price;

    @Schema(description = "实付金额")
    private BigDecimal payPrice;

    @Schema(description = "订单是否失效(0未失效 1已失效)")
    private Integer isInvalid;

    @Schema(description = "结算(0未结算 1已结算)")
    private Integer isSettled;

    @Schema(description = "结算时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime settleTime;

    @Schema(description = "状态, 0正常, 1已完成，2已支付，3已取消")
    private Integer status;

    @Schema(description = "备注")
    private String comments;

    @Schema(description = "商城ID")
    private Integer tenantId;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @Schema(description = "处方明细")
    @TableField(exist = false)
    private List<ClinicPrescriptionItem> items;

}
