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

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.sop.common.enums.DeviceDeliveryStatusEnum;
import com.qmth.sop.common.enums.DeviceUsageTypeEnum;
import com.qmth.sop.common.enums.InOutTypeEnum;
import io.swagger.annotations.ApiModelProperty;

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

/**
 * @Description: 设备发货管理result（带导出）
 * @Author: wangliang
 * @Date: 2023/11/30
 */
@ColumnWidth(value = 30)
@HeadStyle(fillForegroundColor = 11)
@HeadFontStyle(color = 1)
public class TBDeviceDeliveryResult implements Serializable {

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

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

    @ApiModelProperty("项目单号")
    @ExcelProperty(value = "项目单号")
    private String crmNo;

    @ApiModelProperty("用途")
    @ExcelProperty(value = "用途")
    private String usageTypeStr;

    @ApiModelProperty("出库/入库")
    @ExcelProperty(value = "出库/入库")
    private String deliveryTypeStr;

    @ApiModelProperty("供应商")
    @ExcelProperty(value = "供应商")
    private String supplierName;

    @ApiModelProperty("设备编号")
    @ExcelProperty(value = "设备编号")
    private String deviceNo;

    @ApiModelProperty("序列号")
    @ExcelProperty(value = "序列号")
    private String serialNo;

    @ApiModelProperty("品牌")
    @ExcelProperty(value = "品牌")
    private String brand;

    @ApiModelProperty("型号")
    @ExcelProperty(value = "型号")
    private String model;

    @ApiModelProperty("邮寄地址")
    @ExcelProperty(value = "邮寄地址")
    private String mailingAddress;

    @ApiModelProperty("收件人")
    @ExcelProperty(value = "收件人")
    private String consignee;

    @ApiModelProperty("收件人联系电话")
    @ExcelProperty(value = "收件人联系电话")
    private String consigneePhone;

    @ApiModelProperty("快递单号")
    @ExcelProperty(value = "快递单号")
    private String expressNo;

    @ApiModelProperty("发货状态")
    @ExcelProperty(value = "发货状态")
    private String statusStr;

    @ApiModelProperty("发货时间")
    @ExcelProperty(value = "发货时间")
    private String deliverTimeStr;

    @ApiModelProperty("发货人")
    @ExcelProperty(value = "发货人")
    private String deliverUserName;

    @ApiModelProperty("签收时间")
    @ExcelProperty(value = "签收时间")
    private String receiveTimeStr;

    @ApiModelProperty("快递单截图")
    @ExcelIgnore
    private String expressPhotoPath;

    @ApiModelProperty("用途")
    @ExcelIgnore
    private DeviceUsageTypeEnum usageType;

    @ApiModelProperty("出库/入库")
    @ExcelIgnore
    private InOutTypeEnum deliveryType;

    @ApiModelProperty("发货状态")
    @ExcelIgnore
    private DeviceDeliveryStatusEnum status;

    @ApiModelProperty("发货时间")
    @ExcelIgnore
    private Long deliverTime;

    @ApiModelProperty("签收时间")
    @ExcelIgnore
    private Long receiveTime;

    @ApiModelProperty("生命周期")
    @ExcelIgnore
    private Boolean effect;

    public Long getId() {
        return id;
    }

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

    public String getServiceName() {
        return serviceName;
    }

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

    public String getCrmNo() {
        return crmNo;
    }

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

    public String getUsageTypeStr() {
        return usageTypeStr;
    }

    public void setUsageTypeStr(String usageTypeStr) {
        this.usageTypeStr = usageTypeStr;
    }

    public String getDeliveryTypeStr() {
        if (Objects.nonNull(deliveryType)) {
            String[] strs = deliveryType.getTitle().split("｜");
            return strs[0];
        } else {
            return deliveryTypeStr;
        }
    }

    public void setDeliveryTypeStr(String deliveryTypeStr) {
        this.deliveryTypeStr = deliveryTypeStr;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public String getDeviceNo() {
        return deviceNo;
    }

    public void setDeviceNo(String deviceNo) {
        this.deviceNo = deviceNo;
    }

    public String getSerialNo() {
        return serialNo;
    }

    public void setSerialNo(String serialNo) {
        this.serialNo = serialNo;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public String getMailingAddress() {
        return mailingAddress;
    }

    public void setMailingAddress(String mailingAddress) {
        this.mailingAddress = mailingAddress;
    }

    public String getConsignee() {
        return consignee;
    }

    public void setConsignee(String consignee) {
        this.consignee = consignee;
    }

    public String getConsigneePhone() {
        return consigneePhone;
    }

    public void setConsigneePhone(String consigneePhone) {
        this.consigneePhone = consigneePhone;
    }

    public String getExpressNo() {
        return expressNo;
    }

    public void setExpressNo(String expressNo) {
        this.expressNo = expressNo;
    }

    public String getStatusStr() {
        return statusStr;
    }

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

    public String getDeliverTimeStr() {
        return deliverTimeStr;
    }

    public void setDeliverTimeStr(String deliverTimeStr) {
        this.deliverTimeStr = deliverTimeStr;
    }

    public String getDeliverUserName() {
        return deliverUserName;
    }

    public void setDeliverUserName(String deliverUserName) {
        this.deliverUserName = deliverUserName;
    }

    public String getReceiveTimeStr() {
        return receiveTimeStr;
    }

    public void setReceiveTimeStr(String receiveTimeStr) {
        this.receiveTimeStr = receiveTimeStr;
    }

    public String getExpressPhotoPath() {
        return expressPhotoPath;
    }

    public void setExpressPhotoPath(String expressPhotoPath) {
        this.expressPhotoPath = expressPhotoPath;
    }

    public DeviceUsageTypeEnum getUsageType() {
        return usageType;
    }

    public void setUsageType(DeviceUsageTypeEnum usageType) {
        this.usageType = usageType;
    }

    public InOutTypeEnum getDeliveryType() {
        return deliveryType;
    }

    public void setDeliveryType(InOutTypeEnum deliveryType) {
        this.deliveryType = deliveryType;
    }

    public DeviceDeliveryStatusEnum getStatus() {
        return status;
    }

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

    public Long getDeliverTime() {
        return deliverTime;
    }

    public void setDeliverTime(Long deliverTime) {
        this.deliverTime = deliverTime;
    }

    public Long getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(Long receiveTime) {
        this.receiveTime = receiveTime;
    }

    public Boolean getEffect() {
        return effect;
    }

    public void setEffect(Boolean effect) {
        this.effect = effect;
    }
}
