package com.qianhe.zqcz.xmrylsjl.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.qianhe.common.annotation.Excel;
import com.qianhe.common.core.domain.BaseEntity;
import com.qianhe.common.utils.SecurityUtils;
import com.qianhe.zqcz.ryxx.domain.ZqczRyxxVo;
import com.qianhe.zqcz.xmgl.domain.ZqczXmglVo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 最强操作-项目人员 历史记录 Model
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ZqczXmRyLsjl extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    private Long xmryid;
    /**
     * 基层任务ID：关联zqcz_zsrw.zsrwid
     */
    private Long zsrwid;
    /**
     * 基层任务ID：关联zqcz_jcrw.jcrwid
     */
    private Long jcrwid;
    /**
     * 基层单位名称 关联 zqcz_jcdw.jcdwid
     */
    private Long jcdwid;
    /**
     * 项目名称
     */
    private String xmmc;
    /**
     * 项目专业：1-采油专业 2-集输专业
     */
    private String xmzy;
    /**
     * 项目类别：1-个人应急项目 2-团队应急项目 3-单人/双人操作项目 4-团队操作项目 字典：zqcz_xmlb
     */
    private String xmlb;
    /**
     * 工作场景码表：采油zqcz_cyzy_gzcj 集输zqcz_jszy_gzcj
     */
    private String gzcj;
    /**
     * 人员名称
     */
    private String rymc;
    /**
     * 单位名称（存储上传的单位名称，领导班子、三室一中心、班站）
     */
    private String dwmc;
    /**
     * 创建者
     */
    private String create_by;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date create_time;
    /**
     * 修改人
     */
    private String update_by;
    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date update_time;
    /**
     * 备注
     */
    private String remark;
    /**
     * 预留1
     */
    private String yl1;
    /**
     * 预留2
     */
    private String yl2;
    /**
     * 预留3
     */
    private String yl3;
    /**
     * 预留4
     */
    private String yl4;
    /**
     * 预留5
     */
    private String yl5;

    public ZqczXmRyLsjl(Long zsrwid, Long jcrwid, Long jcdwid, ZqczRyxxVo ryxxVo, ZqczXmglVo xmglVo) {
        this.zsrwid = zsrwid;
        this.jcrwid = jcrwid;
        this.jcdwid = jcdwid;
        this.xmmc = xmglVo.getXmmc();
        this.xmzy = xmglVo.getXmzy();
        this.xmlb = xmglVo.getXmlb();
        this.gzcj = xmglVo.getGzcj();
        this.rymc = ryxxVo.getRymc();
        this.dwmc = ryxxVo.getDwmc();
        this.create_by = SecurityUtils.getLoginUser().getUsername();
        this.update_by = SecurityUtils.getLoginUser().getUsername();
        this.create_time = new Date();
    }

    public ZqczXmRyLsjl(Long zsrwid, Long jcrwid, Long jcdwid, ZqczXmglVo bzhczXmglVo, String dwmc, String rymc){
        this.zsrwid = zsrwid;
        this.jcrwid = jcrwid;
        this.jcdwid = jcdwid;
        this.xmmc = bzhczXmglVo.getXmmc();
        this.xmzy = bzhczXmglVo.getXmzy();
        this.xmlb = bzhczXmglVo.getXmlb();
        this.gzcj = bzhczXmglVo.getGzcj();
        this.rymc = rymc;
        this.dwmc = dwmc;
        this.create_by = SecurityUtils.getLoginUser().getUsername();
        this.update_by = SecurityUtils.getLoginUser().getUsername();
        this.create_time = new Date();
    }
}
