package com.wms_main.model.bo.erp;

import com.wms_main.model.dto.request.ycwms.OrderInGoodsDetail;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.poi.hpsf.Decimal;

import java.math.BigDecimal;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ErpGoodsDetail {
    private String goodsId;
    private String goodsName;
    private String batch;
    private String goodsType;
    private String specification;
    private Double quantity;
    private String goodsDesc;
    private String goodsBarcode;
    private String xsfbillno;
    private Integer xsfseq;
    private String neibubianhao;

    public static ErpGoodsDetail of(OrderInGoodsDetail goodsDetail) {
        ErpGoodsDetail erpGoodsDetail = new ErpGoodsDetail();
        erpGoodsDetail.setGoodsId(goodsDetail.getGoodsId());
        erpGoodsDetail.setGoodsName(goodsDetail.getGoodsName());
        erpGoodsDetail.setBatch(goodsDetail.getBatch());
        erpGoodsDetail.setGoodsType(goodsDetail.getGoodsType());
        erpGoodsDetail.setSpecification(goodsDetail.getSpecification());
        erpGoodsDetail.setQuantity(goodsDetail.getQuantity());
        erpGoodsDetail.setGoodsDesc(goodsDetail.getGoodsDesc());
        erpGoodsDetail.setGoodsBarcode(goodsDetail.getGoodsBarcode());

        return erpGoodsDetail;
    }
}
