package cn.estsh.i3plus.pojo.wms.bean;

import cn.estsh.i3plus.pojo.base.annotation.DynamicField;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * @Description : 仓库健康度指标
 * @Reference :
 * @Author : siliter.yuan
 * @CreateDate : 2020-05-13 13:54
 * @Modify:
 **/
@Data
@Entity
@Table(name="WMS_HEALTH_INDICATOR", indexes = {
        @Index(columnList = "INDICATOR_CODE"),
        @Index(columnList = "GROUP_NAME")
})
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api(value="仓库健康度指标",description = "仓库健康度指标")
public class WmsHealthIndicator extends BaseBean {

    private static final long serialVersionUID = 7332606119041273554L;

    @Column(name = "INDICATOR_CODE")
    @ApiParam(value = "指标代码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String indicatorCode;

    @Column(name = "INDICATOR_NAME")
    @ApiParam(value = "指标名称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String indicatorName;

    @Column(name = "GROUP_NAME")
    @ApiParam(value = "模块名称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String groupName;

    @Column(name = "CALC_FORMULA")
    @ApiParam(value = "指标测算公式")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String calcFormula;

    @Transient
    @ApiParam(value = "指标等级")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String indicatorGrade;

    @Transient
    @ApiParam(value = "指标颜色")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String indicatorColor;

    @Transient
    @ApiParam(value = "指标测算值")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.NUMBER)
    private Double indicatorCalcValue;
}
