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

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.sop.common.enums.InOutTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * @Description: 出入库提交参数
 * @Author: CaoZixuan
 * @Date: 2023-08-24
 */
public class DeviceInOutSubmitParam implements Serializable {

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

    @ApiModelProperty("派单号")
    private String crmNo;

    @ApiModelProperty("sop号")
    private String sopNo;

    @ApiModelProperty("出入库时间")
    @NotNull(message = "缺少出入库时间")
    @Range(min = 1L, message = "缺少出入库时间")
    private Long inOutTime;

    @ApiModelProperty("出入库类型")
    @NotNull(message = "缺少出入库类型")
    private InOutTypeEnum inOutType;

    @ApiModelProperty("推送供应商签收")
    private Boolean pushSupplier;

    @ApiModelProperty("出入库登记单")
    @NotEmpty(message = "缺少出入库登记单")
    private List<DeviceInOutForm> deviceInOutFormList;

    public DeviceInOutSubmitParam() {

    }

    public DeviceInOutSubmitParam(Long serviceUnitId, String crmNo, String sopNo, Long inOutTime, InOutTypeEnum inOutType,Boolean pushSupplier, List<DeviceInOutForm> deviceInOutFormList) {
        this.serviceUnitId = serviceUnitId;
        this.crmNo = crmNo;
        this.sopNo = sopNo;
        this.inOutTime = inOutTime;
        this.inOutType = inOutType;
        this.pushSupplier = pushSupplier;
        this.deviceInOutFormList = deviceInOutFormList;
    }

    public Long getServiceUnitId() {
        return serviceUnitId;
    }

    public void setServiceUnitId(Long serviceUnitId) {
        this.serviceUnitId = serviceUnitId;
    }

    public String getCrmNo() {
        return crmNo;
    }

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

    public String getSopNo() {
        return sopNo;
    }

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

    public Long getInOutTime() {
        return inOutTime;
    }

    public void setInOutTime(Long inOutTime) {
        this.inOutTime = inOutTime;
    }

    public InOutTypeEnum getInOutType() {
        return inOutType;
    }

    public void setInOutType(InOutTypeEnum inOutType) {
        this.inOutType = inOutType;
    }

    public Boolean getPushSupplier() {
        return pushSupplier;
    }

    public void setPushSupplier(Boolean pushSupplier) {
        this.pushSupplier = pushSupplier;
    }

    public List<DeviceInOutForm> getDeviceInOutFormList() {
        return deviceInOutFormList;
    }

    public void setDeviceInOutFormList(List<DeviceInOutForm> deviceInOutFormList) {
        this.deviceInOutFormList = deviceInOutFormList;
    }
}
