package com.ruoyi.inventory.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 出库详情，用于记录药品出库的详细信息对象 healthcare_inventory_drugout_details
 *
 * @author 蒋松龙
 * @date 2024-10-07
 */
@Data
public class HealthcareInventoryDrugoutDetails extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 序号 */
    private Long id;

    /** 出库记录ID，关联出库记录表 */
    @Excel(name = "出库记录ID，关联出库记录表")
    private Long drugOutId;

    /** 药品ID */
    @Excel(name = "药品ID")
    private Long drugId;

    /** 库存ID */
    @Excel(name = "库存ID")
    private Long filingId;

    /** 药品名称 */
    @Excel(name = "药品名称")
    private String medicineName;

    /** 出库地点id */
    @Excel(name = "出库地点id")
    private Long outPointId;

    /** 出库地点名称 */
    @Excel(name = "出库地点名称")
    private String outPointName;

    /** 生产厂家 */
    @Excel(name = "生产厂家")
    private String manufacturer;

    /** 条码 */
    @Excel(name = "条码")
    private String barcode;

    /** 批次 */
    @Excel(name = "批次")
    private String outBatch;

    /** 生产日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expiryDate;

    /** 零售价 */
    @Excel(name = "含税价")
    private double retailPrice;

    /** 单位，如盒、瓶、包等 */
    private String unit;

    /** 出库单位类型（BOX/ PACK） */
    private String unitType;

    /** 大包装折算最小单位数量 */
    private Integer unitQuantity;

    /** 出库数量 */
    @Excel(name = "出库数量")
    private Integer quantity;

    /** 剩余盒数 */
    private Integer remainingQuantity;

    /** 剩余包数 */
    private Integer remainingPackQuantity;

    /** 库存盒数 */
    @Excel(name = "库存数量")
    private Integer boxCount;

    /** 大包装单位名称 */
    private String inventoryUnit;

    /** 最小包装单位名称 */
    private String splitUnit;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("drugOutId", getDrugOutId())
            .append("drugId", getDrugId())
            .append("filingId", getFilingId())
            .append("medicineName", getMedicineName())
            .append("outPointId", getOutPointId())
            .append("outPointName", getOutPointName())
            .append("manufacturer", getManufacturer())
            .append("barcode", getBarcode())
            .append("outBatch", getOutBatch())
            .append("expiryDate", getExpiryDate())
            .append("retailPrice", getRetailPrice())
            .append("unit", getUnit())
            .append("unitType", getUnitType())
            .append("unitQuantity", getUnitQuantity())
            .append("quantity", getQuantity())
            .append("remainingQuantity", getRemainingQuantity())
            .append("remainingPackQuantity", getRemainingPackQuantity())
            .append("boxCount", getBoxCount())
            .append("inventoryUnit", getInventoryUnit())
            .append("splitUnit", getSplitUnit())
            .append("createTime", getCreateTime())
            .append("createBy", getCreateBy())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}
