package com.qmth.sop.business.bean.result;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.sop.common.enums.DelayWarnTypeEnum;
import com.qmth.sop.common.enums.ProjectExchangeFlowStatusEnum;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Objects;

/**
 * @Description: 表单控件result
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2023/7/18
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ProjectExchangeResult extends WorkTaskResult implements Serializable {

    @ApiModelProperty(value = "id")
    @JsonSerialize(using = ToStringSerializer.class)
    Long id;

    @ApiModelProperty(value = "提交时间")
    Long createTime;

    @ApiModelProperty(value = "变更原因")
    String reason;

    @ApiModelProperty(value = "变更类型，PLAN：项目信息及计划，TIME：处理时限，CANCEL：项目取消")
    DelayWarnTypeEnum exchangeType;

    @ApiModelProperty(value = "变更类型Str")
    String exchangeTypeStr;

    @ApiModelProperty(value = "项目计划变更流程状态，UN_APPROVE：待审核，APPROVE：已审核")
    ProjectExchangeFlowStatusEnum projectExchangeFlowStatus;

    @ApiModelProperty(value = "项目计划变更流程状态str")
    String projectExchangeFlowStatusStr;

    @ApiModelProperty(value = "审核人")
    String approveUsersName = "--";

    @ApiModelProperty(value = "是否是自己审核")
    boolean myself = false;

    public boolean isMyself() {
        return myself;
    }

    public void setMyself(boolean myself) {
        this.myself = myself;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public DelayWarnTypeEnum getExchangeType() {
        return exchangeType;
    }

    public void setExchangeType(DelayWarnTypeEnum exchangeType) {
        this.exchangeType = exchangeType;
    }

    public String getExchangeTypeStr() {
        if (Objects.nonNull(exchangeType)) {
            return exchangeType.getTitle();
        } else {
            return exchangeTypeStr;
        }
    }

    public void setExchangeTypeStr(String exchangeTypeStr) {
        this.exchangeTypeStr = exchangeTypeStr;
    }

    public ProjectExchangeFlowStatusEnum getProjectExchangeFlowStatus() {
        return projectExchangeFlowStatus;
    }

    public void setProjectExchangeFlowStatus(ProjectExchangeFlowStatusEnum projectExchangeFlowStatus) {
        this.projectExchangeFlowStatus = projectExchangeFlowStatus;
    }

    public String getProjectExchangeFlowStatusStr() {
        if (Objects.nonNull(projectExchangeFlowStatus)) {
            return projectExchangeFlowStatus.getTitle();
        } else {
            return projectExchangeFlowStatusStr;
        }
    }

    public void setProjectExchangeFlowStatusStr(String projectExchangeFlowStatusStr) {
        this.projectExchangeFlowStatusStr = projectExchangeFlowStatusStr;
    }

    public String getApproveUsersName() {
        return approveUsersName;
    }

    public void setApproveUsersName(String approveUsersName) {
        this.approveUsersName = approveUsersName;
    }
}
