package com.zg.project.wisdom.domain;

import com.zg.framework.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;

/**
 * 单据照片对象 stock_photo
 * 按 bill_no 聚合查询；仅存一个可访问的 URL；photo_type：0=入库、1=出库
 */
public class StockPhoto extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 单据号（对应 rk_info.bill_no，用于聚合查询） */
    private String billNo;

    /** 照片业务类型：0=入库相关，1=出库相关 */
    private String photoType;

    /** 实际文件名（含扩展名），示例：I202508110001_101360951_项目名_时间戳_序号.jpg */
    private String fileName;

    /** 可直接访问的图片URL（形如 /photo/2025-09-01/xxx.jpg 或完整http地址） */
    private String url;

    /** 删除标记：0=正常，1=已删除 */
    private String isDelete;

    /* ========== Getter / Setter ========== */

    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }

    public String getBillNo() {
        return billNo;
    }
    public void setBillNo(String billNo) {
        this.billNo = billNo;
    }

    public String getPhotoType() {
        return photoType;
    }
    public void setPhotoType(String photoType) {
        this.photoType = photoType;
    }

    public String getFileName() {
        return fileName;
    }
    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }

    public String getIsDelete() {
        return isDelete;
    }
    public void setIsDelete(String isDelete) {
        this.isDelete = isDelete;
    }

    /* ========== toString（RuoYi 风格） ========== */
    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("billNo", getBillNo())
            .append("photoType", getPhotoType())
            .append("fileName", getFileName())
            .append("url", getUrl())
            .append("isDelete", getIsDelete())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}
