package com.friday.distributor.po;

import com.friday.operation.api.distributor.dto.JobExecuteLogDto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class JobExecuteLogPo {
    private Integer id;

    private Integer invokeId;

    private String taskId;

    private String taskType;

    private String tenant;

    private String empNo;

    private String businessType;

    private String missionName;

    private String processName;

    private String processVersion;

    private String module;

    private String step;

    private String logLevel;

    private Date logTime;

    private Date processStartTime;

    private Date processEndTime;

    private String imgPath;

    private String videoPath;

    private String robotIp;

    private String robotUser;

    private String operator;

    private String startType;

    private String executeMethod;

    private String supplier;

    private Date createTime;

    private Date updateTime;

    private String logContent;
    
    public JobExecuteLogPo(JobExecuteLogDto log) {
		this.invokeId = log.getInvokeId();
		this.taskId = log.getTaskId();
		this.taskType = log.getTaskType();
		this.tenant = log.getTenant();
		this.empNo = log.getEmpNo();
		this.businessType = log.getBusinessType();
		this.missionName = log.getMissionName();
		this.processName = log.getProcessName();
		this.processVersion = log.getProcessVersion();
		this.module = log.getModule();
		this.step = log.getStep();
		this.logLevel = log.getLogLevel();
		this.logTime = log.getLogTime();
		this.processStartTime = log.getProcessStartTime();
		this.processEndTime = log.getProcessEndTime();
		this.imgPath = log.getImgPath();
		this.videoPath = log.getVideoPath();
		this.robotIp = log.getRobotIp();
		this.robotUser = log.getRobotUser();
		this.operator = log.getOperator();
		this.startType = log.getStartType();
		this.executeMethod = log.getExecuteMethod();
		this.supplier = log.getSupplier();
		this.logContent = log.getLogContent();
    }

    public JobExecuteLogDto createDto() {
    	return JobExecuteLogDto.builder()
    			.invokeId(invokeId)
    			.taskId(taskId)
    			.taskType(taskType)
    			.tenant(tenant)
    			.empNo(empNo)
    			.businessType(businessType)
    			.missionName(missionName)
    			.processName(processName)
    			.processVersion(processVersion)
    			.module(module)
    			.step(step)
    			.logLevel(logLevel)
    			.logTime(logTime)
    			.processStartTime(processStartTime)
    			.processEndTime(processEndTime)
    			.imgPath(imgPath)
    			.videoPath(videoPath)
    			.robotIp(robotIp)
    			.robotUser(robotUser)
    			.operator(operator)
    			.startType(startType)
    			.executeMethod(executeMethod)
    			.supplier(supplier)
    			.logContent(logContent)
    			.build();
    }
}