package jnpf.model.personnels.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import jnpf.base.entity.SuperBaseEntity;
import jnpf.model.personnels.vo.config.FtbPersonnelsAuditConfigVO;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

/**
 * 人事流程审核配置主表 
 * @author admin
 * @create 2024-02-01 
 */

@Getter
@Setter
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName(value = "ftb_personnels_audit_master_config")
public class FtbPersonnelsAuditMasterConfig extends SuperBaseEntity.SuperCUDBaseEntity<String> implements Serializable {

    private static final long serialVersionUID = 7557604767360759457L;

    /**
     * 组织id
     */
    @TableField(value = "F_OrgId")
    private String orgId;

    /**
     * 组织id
     */
    @TableField(value = "F_OrgName")
    private String orgName;


    /**;
     * 审批配置类型
     * 1 审批配置类型 2 入职审批配置  3转正审批配置  4调岗审批配置 5离职审批配置 6晋升审批配置
     */
    @TableField(value = "F_ConfigType")
    private Integer configType;

    /**
     * 是否填写审批意见(0否,1是)
     */
    @TableField(value = "F_IsApprovalComments")
    private Integer isApprovalComments;

    /**
     * 一人审批通过即视为该流程全部审批通过(0否,1是)
     */
    @TableField(value = "F_IsOnePersonPasses")
    private Integer isOnePersonPasses;

    /**
     * 是否有效(1无效,0有效)
     */
    @TableField(value = "F_EnableMark")
    private String enableMark;

    public static FtbPersonnelsAuditConfigVO coverFtbPersonnelsAuditConfigVO(FtbPersonnelsAuditMasterConfig config) {
        if (config == null) {
            return null;
        }
        FtbPersonnelsAuditConfigVO ftbPersonnelsAuditConfigVO = new FtbPersonnelsAuditConfigVO();
        ftbPersonnelsAuditConfigVO.setOrgId(config.getOrgId());
        ftbPersonnelsAuditConfigVO.setOrgName(config.getOrgName());
        ftbPersonnelsAuditConfigVO.setConfigType(config.getConfigType());
        ftbPersonnelsAuditConfigVO.setIsApprovalComments(config.getIsApprovalComments());
        ftbPersonnelsAuditConfigVO.setIsOnePersonPasses(config.getIsOnePersonPasses());
        ftbPersonnelsAuditConfigVO.setId(config.getId());
        return ftbPersonnelsAuditConfigVO;
    }
}
