/*
 * Author: wangjian
 * 生成entity
 */
package com.tofly.dispatch.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.List;
import java.util.stream.Collectors;


/**
 * 指令管理
 *
 * @author admin
 * @date Fri Nov 11 00:00:00 CST 2022
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "TF_DIS_DISPATCH_ORDER_W", resultMap = "dispatchOrderMap")
@KeySequence("TF_DIS_DISPATCH_ORDER_W")
@ApiModel
public class DispatchOrder extends Model<DispatchOrder> {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "ID", type = IdType.INPUT)
    @ApiModelProperty(value = "主键")
    private Long id;
    /**
     * 指令内容
     */
    @ApiModelProperty(value = "指令内容")
    private String orderContent;
    /**
     * 指令类型（1常规指令，2紧急指令）
     */
    @ApiModelProperty(value = "指令类型（1常规指令，2紧急指令）")
    private String orderType;
    /**
     * 发送状态（0未发送，1已发送）
     */
    @ApiModelProperty(value = "发送状态（0未发送，1已发送）")
    private String sendState;

    /**
     * 发发送时间
     */
    @ApiModelProperty(value = "发送时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date sendTime;


    /**
     * 指令状态（-1,未发送、0未接收、1已接收、2已拒绝，3已完成）
     */
    @ApiModelProperty(value = "指令状态（-1,未发送、0未接收、1已接收、2已拒绝，3已完成）")
    private String orderState;
    /**
     * 执行时间
     */
    @ApiModelProperty(value = "执行时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date executionTime;
    /**
     * 关联调度方案id
     */
    @ApiModelProperty(value = "关联调度方案id")
    private Long dispatchId;


    /**
     * 指令接受部门
     */
    @ApiModelProperty(value = "指令接受部门")
    private Long departmentId;

    /**
     * 指令接受部门名称
     */
    @ApiModelProperty(value = "指令接受部门名称",hidden = true)
    @TableField(exist = false)
    private String departmentName;


    @ApiModelProperty(value = "调度方案信息",hidden = true)
    @TableField(exist = false)
    private Dispatch dispatchInfo;

    @ApiModelProperty(value = "调度指令回复",hidden = true)
    @TableField(exist = false)
    private List<DispatchOrderReply> listReply;

    /**
     * 拒绝原因
     */
    @ApiModelProperty(value = "拒绝原因")
    private String refuseReason;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remark;
    /**
     * 附件IDS，多个附件id用英文等号分割“,”,关联公共文件表TF_YWPN_FILE _W主键
     */
    @ApiModelProperty(value = "附件IDS，多个附件id用英文等号分割“,”,关联公共文件表TF_YWPN_FILE _W主键")
    private String uploadFileids;

    /**
     * 文件列表
     */
    @ApiModelProperty(value = "文件列表",hidden = true)
    @TableField(exist = false)
    private List<File> fileUpLoadList;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @TableField(value = "CREATE_USER", fill = FieldFill.INSERT)
    private Long createUser;
    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private String createUserName;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
    private Date createTime;
    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "UPDATE_TIME", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    /**
     * 更新人员
     */
    @ApiModelProperty(value = "更新人员")
    @TableField(value = "UPDATE_USER", fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;
    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private String updateUserName;

}
