package com.xinelu.manage.domain.nursestationconsumable;

import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 护理站耗材信息对象 nurse_station_consumable
 *
 * @author xinyilu
 * @date 2022-09-05
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "护理站耗材信息对象", description = "nurse_station_consumable")
public class NurseStationConsumable extends BaseDomain implements Serializable {
    private static final long serialVersionUID = -279751860921592017L;
    /**
     * 主键id
     */
    private Long id;

    /**
     * 护理站id
     */
    @NotNull(message = "护理站id不能为空", groups = {Insert.class, Update.class})
    private Long nurseStationId;

    /**
     * 创建人id
     */
    @ApiModelProperty(value = "创建人id")
    @Excel(name = "创建人id")
    private Long userId;

    /**
     * 耗材包编号
     */
    @ApiModelProperty(value = "耗材包编号")
    @Excel(name = "耗材包编号")
    private String consumableCode;

    /**
     * 服务项目耗材包详情
     */
    @ApiModelProperty(value = "服务项目耗材包详情")
    @Excel(name = "服务项目耗材包详情")
    @NotNull(message = "服务项目耗材包详情不能为空", groups = {Insert.class, Update.class})
    @Length(max = 100, message = "服务项目耗材包详情不能超过100个字符", groups = {Insert.class, Update.class})
    private String consumableDetail;

    /**
     * 耗材包单位
     */
    @ApiModelProperty(value = "耗材包单位")
    @Excel(name = "耗材包单位")
    @NotNull(message = "耗材包单位不能为空", groups = {Insert.class, Update.class})
    @Length(max = 10, message = "耗材包单位不能超过10个字符", groups = {Insert.class, Update.class})
    private String consumableUnit;

    /**
     * 耗材包价格
     */
    @ApiModelProperty(value = "耗材包价格")
    @Excel(name = "耗材包价格")
    @NotNull(message = "耗材包价格不能为空", groups = {Insert.class, Update.class})
    private BigDecimal consumablePrice;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    @Excel(name = "排序")
    @NotNull(message = "排序不能为空", groups = {Insert.class, Update.class})
    private Integer sort;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("userId", getUserId())
                .append("consumableCode", getConsumableCode())
                .append("consumableDetail", getConsumableDetail())
                .append("consumableUnit", getConsumableUnit())
                .append("consumablePrice", getConsumablePrice())
                .append("sort", getSort())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}