package com.prolog.eis.dto.bindgridex;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * @Version: 1.0
 * @Author: wuhan
 * @Created: 2024/8/1 16:56
 */
@Getter
@Setter
public class BGDExGridGroupDto {
    @ApiModelProperty("分组号")
    private String gridGroupNo;

    @ApiModelProperty("格口集合")
    private List<BGDExGridDto> gridList = new ArrayList<>();

    //*****以下非查询*****
    @ApiModelProperty("空闲格口集合")
    private List<BGDExGridDto> freeGridList = new ArrayList<>();

//    private void recomputeFreeGridCount() {
//        long freeGridCount = this.getGridList().stream().filter(r -> r.getBindOrderId() == 0).count();
//        this.setFreeGridCount(freeGridCount);
//    }

//    public BGDGridDto findFreeGrid() {
//        BGDGridDto freeGrid = this.getGridList().stream().filter(r -> r.getBindOrderId() == 0).findFirst().orElse(null);
//        return freeGrid;
//    }
}
