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.business.bean.BaseFlowData;
import com.qmth.sop.common.enums.FlowStatusEnum;
import io.swagger.annotations.ApiModelProperty;

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

/**
 * @Description: 流程查看result
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/8/6
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class FlowViewResult extends BaseFlowData implements Serializable {

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

    @ApiModelProperty(value = "流程状态")
    FlowStatusEnum status;

    @ApiModelProperty(value = "流程状态")
    String statusStr;

    @ApiModelProperty(value = "sop单号")
    String sopNo;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "流程任务id集合")
    private List<Long> taskIdList;

    @ApiModelProperty(value = "当前流程节点")
    private FlowTaskResult currFlowTaskResult;

    @ApiModelProperty(value = "历史流程节点信息")
    List<FlowTaskResult> flowTaskHistoryList;

    @ApiModelProperty(value = "流程审批信息")
    List<TFFlowViewLogResult> flowApproveHistoryList;

    @ApiModelProperty(value = "crm信息")
    CrmProjectResult crmInfo;

    @ApiModelProperty(value = "甲方审核意见集合")
    List<FlowFormSuggestionJiaResult> flowFormSuggestionJiaResultList;

    @ApiModelProperty(value = "甲方审核意见集合")
    List<FlowFormSuggestionYiResult> flowFormSuggestionYiResultList;

    public List<FlowFormSuggestionJiaResult> getFlowFormSuggestionJiaResultList() {
        return flowFormSuggestionJiaResultList;
    }

    public void setFlowFormSuggestionJiaResultList(List<FlowFormSuggestionJiaResult> flowFormSuggestionJiaResultList) {
        this.flowFormSuggestionJiaResultList = flowFormSuggestionJiaResultList;
    }

    public List<FlowFormSuggestionYiResult> getFlowFormSuggestionYiResultList() {
        return flowFormSuggestionYiResultList;
    }

    public void setFlowFormSuggestionYiResultList(List<FlowFormSuggestionYiResult> flowFormSuggestionYiResultList) {
        this.flowFormSuggestionYiResultList = flowFormSuggestionYiResultList;
    }

    public CrmProjectResult getCrmInfo() {
        return crmInfo;
    }

    public void setCrmInfo(CrmProjectResult crmInfo) {
        this.crmInfo = crmInfo;
    }

    public FlowViewResult() {

    }

    public FlowViewResult(Long flowId, FlowStatusEnum status, String sopNo, List<Long> taskIdList,
                          List<FlowTaskResult> flowTaskHistoryList, FlowTaskResult currFlowTaskResult,
                          List<TFFlowViewLogResult> flowApproveHistoryList, CrmProjectResult crmInfo,
                          List<FlowFormSuggestionJiaResult> flowFormSuggestionJiaResultList,
                          List<FlowFormSuggestionYiResult> flowFormSuggestionYiResultList) {
        this.flowId = flowId;
        this.status = status;
        this.sopNo = sopNo;
        this.taskIdList = taskIdList;
        this.flowTaskHistoryList = flowTaskHistoryList;
        this.flowApproveHistoryList = flowApproveHistoryList;
        this.currFlowTaskResult = currFlowTaskResult;
        this.crmInfo = crmInfo;
        this.flowFormSuggestionJiaResultList = flowFormSuggestionJiaResultList;
        this.flowFormSuggestionYiResultList = flowFormSuggestionYiResultList;
    }

    public Long getFlowId() {
        return flowId;
    }

    public void setFlowId(Long flowId) {
        this.flowId = flowId;
    }

    public FlowStatusEnum getStatus() {
        return status;
    }

    public void setStatus(FlowStatusEnum status) {
        this.status = status;
    }

    public String getStatusStr() {
        if (Objects.nonNull(status)) {
            return status.getTitle();
        } else {
            return statusStr;
        }
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = statusStr;
    }

    public String getSopNo() {
        return sopNo;
    }

    public void setSopNo(String sopNo) {
        this.sopNo = sopNo;
    }

    public List<Long> getTaskIdList() {
        return taskIdList;
    }

    public void setTaskIdList(List<Long> taskIdList) {
        this.taskIdList = taskIdList;
    }

    public FlowTaskResult getCurrFlowTaskResult() {
        return currFlowTaskResult;
    }

    public void setCurrFlowTaskResult(FlowTaskResult currFlowTaskResult) {
        this.currFlowTaskResult = currFlowTaskResult;
    }

    public List<FlowTaskResult> getFlowTaskHistoryList() {
        return flowTaskHistoryList;
    }

    public void setFlowTaskHistoryList(List<FlowTaskResult> flowTaskHistoryList) {
        this.flowTaskHistoryList = flowTaskHistoryList;
    }

    public List<TFFlowViewLogResult> getFlowApproveHistoryList() {
        return flowApproveHistoryList;
    }

    public void setFlowApproveHistoryList(List<TFFlowViewLogResult> flowApproveHistoryList) {
        this.flowApproveHistoryList = flowApproveHistoryList;
    }
}
