package com.prolog.eis.dto.buildwave;

import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;

@Getter
@Setter
public class PObPickOrderDto {
    private HashSet<String> spPicHs = new HashSet<>();
    private List<PObOrderDto> orderList = new ArrayList<>();
    //拣选单总体积
    private BigDecimal totalVolume = new BigDecimal(0);

    public void addYunDan(PObOrderDto yd) {
        this.getOrderList().add(yd);

        for (PObOrderDetailDto sp : yd.getDetailList()) {
            if (!this.getSpPicHs().contains(sp.getItemNo()))
                this.getSpPicHs().add(sp.getItemNo());
        }
    }

    public String toString() {
        return String.format("商品种类数:%s,总体积:%s", this.getSpPicHs().size(), this.getTotalVolume());
    }
}
