package cn.ysk.cashier.cons.service.dto;

import cn.ysk.cashier.utils.JSONUtil;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Data
public class ProskuInfo implements Serializable {

    private Integer productId;

    private Integer consInfoId;

    private BigDecimal surplusStock;

    private List<SkuInfo> skuInfos;

    private String status;


    @Data
    public static class SkuInfo{

        private Integer skuId;

        private Integer shopId;

        private Integer conInfoId;

        private BigDecimal surplusStock;

        private String status;
    }


    public static void main(String[] args){

        ProskuInfo info=   new ProskuInfo();

        info.setConsInfoId(1);
        info.setProductId(1);
        info.setSurplusStock(BigDecimal.ZERO);
        List<SkuInfo> skuInfos1=new ArrayList<>();

        SkuInfo skuInfo=new SkuInfo();
        skuInfo.setConInfoId(1);
        skuInfo.setSkuId(1);
        skuInfo.setShopId(1);
        skuInfo.setSurplusStock(BigDecimal.ZERO);
        skuInfo.setStatus("1");
        skuInfos1.add(skuInfo);

        info.setStatus("1");
        info.setSkuInfos(skuInfos1);


        System.out.println(JSONUtil.toJSONString(info));
    }
}
