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

import cn.estsh.i3plus.pojo.aps.annotation.FieldAnnotation;
import cn.estsh.i3plus.pojo.aps.annotation.MainKey;
import cn.estsh.i3plus.pojo.aps.common.BaseAPS;
import cn.estsh.i3plus.pojo.aps.validator.InsertGroup;
import cn.estsh.i3plus.pojo.aps.validator.UpdateGroup;
import cn.estsh.i3plus.pojo.base.enumutil.ApsEnumUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @Description : 标准工序
 * @Reference :
 * @Author : jason.niu
 * @CreateDate : 2019-09-17
 * @Modify:
 **/
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "APS_STAND_OPERATION")
@Api("标准工序")
@MainKey(groups = {InsertGroup.class, UpdateGroup.class})
public class StandOperation extends BaseAPS {
    private static final long serialVersionUID = -6869403951765771775L;
    @Column(name="CODE")
    @ApiParam(value ="编码")
    @FieldAnnotation(popSearch = true, mainkey = true)
    private String code;

    @Column(name="NAME")
    @ApiParam(value ="名称")
    @FieldAnnotation(popSearch = true)
    private String name;

    @Column(name="DIRECTION")
    @ApiParam(value ="排程方向")
    @FieldAnnotation(defaultValue = "POSITIVE")
    private ApsEnumUtil.DIRECTION direction;

    @Column(name="RATIO")
    @ApiParam(value ="分割比例")
    private String ratio;

    @Column(name="COUNT")
    @ApiParam(value ="分割的工作个数")
    private Integer count;

    @Column(name="BATCH", columnDefinition = "decimal(18,8)")
    @ApiParam(value ="分割批量")
    private Double batch;

    @Column(name="REMAINDER", columnDefinition = "decimal(18,8)")
    @ApiParam(value ="分割余数")
    private Double remainder;

    @Column(name="COMB_TYPE")
    @ApiParam(value ="生产组合方式")
    @FieldAnnotation(defaultValue = "MAX_ALL_RESOURCE")
    private ApsEnumUtil.RES_COMB_TIME_TYPE combType;

    @Column(name="LOCK_TYPE")
    @ApiParam(value ="锁定组合方式")
    @FieldAnnotation(defaultValue = "MAX_ALL_RESOURCE")
    private ApsEnumUtil.RES_COMB_LOCK_TYPE lockType;
}
