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

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

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

/**
 * @Description: sop result
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/8/6
 */
public class SopInfoResult implements Serializable {

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

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

    @ApiModelProperty(value = "crm单号")
    private String crmNo;

    @ApiModelProperty(value = "crm名称")
    private String crmName;

    @ApiModelProperty(value = "客户id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long customId;

    @ApiModelProperty(value = "客户名称")
    private String customName;

    @ApiModelProperty(value = "客户类型")
    private ProductTypeEnum customType;

    @ApiModelProperty(value = "客户类型str")
    private String customTypeStr;

    @ApiModelProperty(value = "服务单元id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long serviceId;

    @ApiModelProperty(value = "服务单元名称")
    private String serviceName;

    public Long getServiceId() {
        return serviceId;
    }

    public void setServiceId(Long serviceId) {
        this.serviceId = serviceId;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public ProductTypeEnum getCustomType() {
        return customType;
    }

    public void setCustomType(ProductTypeEnum customType) {
        this.customType = customType;
    }

    public String getCustomTypeStr() {
        if (Objects.nonNull(customType)) {
            return customType.getTitle();
        } else {
            return customTypeStr;
        }
    }

    public void setCustomTypeStr(String customTypeStr) {
        this.customTypeStr = customTypeStr;
    }

    public Long getCustomId() {
        return customId;
    }

    public void setCustomId(Long customId) {
        this.customId = customId;
    }

    public String getCustomName() {
        return customName;
    }

    public void setCustomName(String customName) {
        this.customName = customName;
    }

    public Long getId() {
        return id;
    }

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

    public String getSopNo() {
        return sopNo;
    }

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

    public String getCrmNo() {
        return crmNo;
    }

    public void setCrmNo(String crmNo) {
        this.crmNo = crmNo;
    }

    public String getCrmName() {
        return crmName;
    }

    public void setCrmName(String crmName) {
        this.crmName = crmName;
    }
}
