package com.ruoyi.app.model;

import java.math.BigDecimal;

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

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotNull;

/**
 * 干损比例对象 dry_loss_ratio
 *
 * @author ruoyi
 * @date 2025-03-19
 */
public class DryLossRatio extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    private Long id;

    /**
     * 干损比例
     */
    @Excel(name = "干损比例")
    private BigDecimal dryLossRatio;

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private String startTime;

    public Integer getIsUse() {
        return isUse;
    }

    public void setIsUse(Integer isUse) {
        this.isUse = isUse;
    }

    private Integer isUse;

//    /** 结束时间 */
//    @JsonFormat(pattern = "yyyy-MM-dd")
//    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
//    private Date endTime;

    /**
     * 删除标志
     */
    private String delFlag;

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

    public Long getId() {
        return id;
    }

    public void setDryLossRatio(BigDecimal dryLossRatio) {
        this.dryLossRatio = dryLossRatio;
    }

    @NotNull(message = "干损比例不能为空")
    @DecimalMin(value = "0.01", inclusive = true, message = "干损比例输入超出设定范围限制（0.01~99.99）")
    @DecimalMax(value = "99.99", inclusive = true, message = "干损比例输入超出设定范围限制（0.01~99.99）")
    @Digits(integer = 2, fraction = 2, message = "干损比例输入的整数部分不能超过2位，小数部分不能超过2位")
    public BigDecimal getDryLossRatio() {
        return dryLossRatio;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    @NotNull(message = "开始时间不能为空")
    public String getStartTime() {
        return startTime;
    }

//    public void setEndTime(Date endTime)
//    {
//        this.endTime = endTime;
//    }
//
//    //目前需求不需要结束时间
//    public Date getEndTime()
//    {
//        return endTime;
//    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public String getDelFlag() {
        return delFlag;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("dryLossRatio", getDryLossRatio())
                .append("startTime", getStartTime())
                // .append("endTime", getEndTime())
                .append("remark", getRemark())
                .append("createTime", getCreateTime())
                .append("createBy", getCreateBy())
                .append("updateTime", getUpdateTime())
                .append("updateBy", getUpdateBy())
                .append("delFlag", getDelFlag())
                .append("isUse", getIsUse())
                .toString();
    }
}
