package org.springblade.business.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import org.springblade.core.mp.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 实体类
 *
 * @author BladeX
 * @since 2022-06-14
 */
@Data
@TableName("u_contract_tree_drawings")
@EqualsAndHashCode(callSuper = true)
public class ContractTreeDrawings extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 上传图纸的工程划分节点
     */
    private Long processId;
    /**
     * 文件url
     */
    private String fileUrl;

    public ContractTreeDrawings(String primaryKeyId, String fileUrl, Long createUser, String createDept){
        this.processId = Long.parseLong(primaryKeyId);
        this.fileUrl = fileUrl;
        this.setCreateUser(createUser);
        this.setCreateDept(createDept.contains(",") ? Long.parseLong(createDept.split(",")[0]) : Long.parseLong(createDept));
        this.setCreateTime(new Date());
    }

    public ContractTreeDrawings(){}

}
