package com.jjt.order.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * 白胚布库存
 *
 * @author ruoyi
 * @date 2024-12-30
 */
@ApiModel(value = "VmsStock", description = "白胚布库存")
@Data
public class VmsStock {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty("sku")
    private String sku;
    @ApiModelProperty("sku描述")
    private String desc;
    @ApiModelProperty("数量")
    private Integer num;
    @ApiModelProperty("总重")
    private Float qty;
    @ApiModelProperty("规格重量")
    private Integer weight;
    @ApiModelProperty("长/宽")
    private Float length;
    @ApiModelProperty("米克重")
    private Integer mick;
    @ApiModelProperty("平方米克重")
    private BigDecimal gsm;

    public void setGsm() {
        this.gsm = BigDecimal.ZERO;
        if (length > 0f) {
            this.gsm = BigDecimal.valueOf(mick).divide(BigDecimal.valueOf(length), 2, RoundingMode.HALF_UP);
        }
    }
}
