package cn.ysk.cashier.vo;

import com.alibaba.fastjson.JSONArray;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotBlank;
import java.util.List;
import java.util.Map;

/**
 * @author lyf
 */
@Data
public class ProductStockOperateVO {

    private Integer id;

    private String shopId;

    private JSONArray stockSnap;

    private String type;

    private Integer subType;

    private String batchNumber;

    private String remark;

    private Long stockTime;

    private Map<String,Object> operatorSnap;

    private Long createdAt;

    private Long updatedAt;

    private String purveyorId;

    private String purveyorName;

    private String status;

    public void setType() {
        switch (this.type) {
            case "purchase":
                this.type = "其他入库";
                break;
            case "other-out":
                this.type = "其他出库";
                break;
            case "reject":
                this.type = "供应商退货";
                break;
            case "purveyor":
                this.type = "供应商入库";
                break;
            case "cons_in":
                this.type="耗材入库";
                break;
            case "cons_out":
                this.type="耗材出库";
                break;
        }
    }
}
