package digital.laboratory.platform.entrustment.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import digital.laboratory.platform.common.aop.annotation.DlpFeign;
import digital.laboratory.platform.sys.feign.RemoteOrgService;
import digital.laboratory.platform.sys.feign.RemoteUserService;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDate;

/**
 * 申请修改委托消息表 vo类
 * @TableName b_entrust_alter_apply
 */
@Data
@ApiModel(value = "EntrustAlterApplyVO", description = "申请修改委托消息表 vo类, 返回到前台显示")
public class EntrustAlterApplyVO {
    /**
     * 主键标识
     */
    @ApiModelProperty(value = "主键标识")
    private String id;

    /**
     * 关联的委托id
     */
    @ApiModelProperty(value = "关联的委托id")
    private String entrustId;

    /**
     * 关联的案件id
     */
    @ApiModelProperty(value = "关联的案件id")
    private String caseId;

    /**
     * 关联的委托案件名称
     */
    @ApiModelProperty(value = "关联的委托案件名称")
    private String caseName;

    /**
     * 申请人id
     */
    @ApiModelProperty(value = "申请人id")
    private String applicant;

    /**
     * 申请人名称
     */
    @ApiModelProperty(value = "申请人名称")
    @DlpFeign(feignClient = RemoteUserService.class, methodName = "innerGetById", params = {"applicant"}, resultField = "name")
    private String applicantName;

    /**
     * 申请日期
     */
    @ApiModelProperty(value = "申请日期")
    private LocalDate applyDate;

    /**
     * 申请单位
     */
    @ApiModelProperty(value = "申请单位")
    private String applyOrgId;

    /**
     * 申请原因
     */
    @ApiModelProperty(value = "申请原因")
    private String applyReason;

    /**
     * 申请单位名称
     */
    @ApiModelProperty(value = "申请单位名称")
    @DlpFeign(feignClient = RemoteOrgService.class, methodName = "getById", params = {"applyOrgId"}, resultField = "name")
    private String applyOrgName;

    /**
     * 审核人id
     */
    @ApiModelProperty(value = "审核人id ")
    private String reviewer;

    /**
     * 审核人名字
     */
    @ApiModelProperty(value = "审核人名字 ")
    @DlpFeign(feignClient = RemoteUserService.class, methodName = "innerGetById", params = {"reviewer"}, resultField = "name")
    private String reviewerName;

    /**
     * 状态 === 0 待提交申请， 1 提交申请待审核，2申请通过，-1 申请不通过，9 申请已完成
     */
    @ApiModelProperty(value = "状态 === 0 待提交申请， 1 提交申请待审核，2申请通过，-1 申请不通过，9 申请已完成")
    private Integer status;

    /**
     * 状态名称 === 0 待提交申请， 1 提交申请待审核，2申请通过，-1 申请不通过，9 申请已完成
     */
    @ApiModelProperty(value = "状态名称 === 0 待提交申请， 1 提交申请待审核，2申请通过，-1 申请不通过，9 申请已完成")
    private String statusName;

    /**
     * 原因
     */
    @ApiModelProperty(value = "原因")
    private String reason;

    /**
     * 更新操作记录，记录着更改前的信息和更改后的信息
     */
    @ApiModelProperty(value = "更新操作记录，记录着更改前的信息和更改后的信息")
    private String updateRecord;

    @ApiModelProperty(value="委托类型: 0=常规毒品, 1=生物样本")
    private Integer entrustmentType;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        EntrustAlterApplyVO other = (EntrustAlterApplyVO) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getEntrustId() == null ? other.getEntrustId() == null : this.getEntrustId().equals(other.getEntrustId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getEntrustId() == null) ? 0 : getEntrustId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", entrustId=").append(entrustId);
        sb.append(", applicant=").append(applicant);
        sb.append(", applyDate=").append(applyDate);
        sb.append(", applyOrgId=").append(applyOrgId);
        sb.append(", reviewer=").append(reviewer);
        sb.append(", status=").append(status);
        sb.append(", reason=").append(reason);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
