package org.nl.acs.task.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.nl.acs.common.base.CommonModel;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
* @author jiaolm
* @date 2023-05-09
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("acs_task_feedback")
public class TaskFeedback extends CommonModel<TaskFeedback> implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "任务反馈标识")
    @TableId(type= IdType.ASSIGN_ID)
    private String taskback_id;

    @ApiModelProperty(value = "任务标识")
    private String task_id;

    @ApiModelProperty(value = "任务号")
    @NotBlank
    private String task_code;

    @ApiModelProperty(value = "载具号")
    private String vehicle_code;

    @ApiModelProperty(value = "载具类型")
    private String vehicle_type;

    @ApiModelProperty(value = "任务类型")
    @NotBlank
    private String task_type;

    @ApiModelProperty(value = "任务状态")
    @NotBlank
    private String task_status;

    @ApiModelProperty(value = "是否完成")
    @NotBlank
    private String is_finished;

    @ApiModelProperty(value = "错误编码")
    private String error_code;

    @ApiModelProperty(value = "开始时间")
    private String start_time;

    @ApiModelProperty(value = "完成时间")
    private String finish_time;

    @ApiModelProperty(value = "创建类型")
    @NotBlank
    private String create_type;

    @ApiModelProperty(value = "完成类型")
    @NotBlank
    private String finish_type;

    @ApiModelProperty(value = "重试次数")
    @NotBlank
    private String retry_times;

    @ApiModelProperty(value = "起始点位编码")
    private String start_point_code;

    @ApiModelProperty(value = "起始设备编码")
    private String start_device_code;

    @ApiModelProperty(value = "目标点位编码")
    private String next_point_code;

    @ApiModelProperty(value = "目标设备编码")
    private String next_device_code;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "是否启用")
    @NotBlank
    private String is_active;

    @ApiModelProperty(value = "是否删除")
    @NotBlank
    private String is_delete;

    @ApiModelProperty(value = "创建者")
    @NotBlank
    @TableField(fill= FieldFill.INSERT)
    private String create_by;

    @ApiModelProperty(value = "创建时间")
    @NotBlank
    @TableField(fill= FieldFill.INSERT)
    private String create_time;

    @ApiModelProperty(value = "修改者")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private String update_by;

    @ApiModelProperty(value = "修改时间")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private String update_time;

    @ApiModelProperty(value = "1-诺宝agv 2-叉车agv")
    private String agv_system_type;

    public void copyFrom(TaskFeedback source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
