package com.prolog.eis.dto.eis4;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

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

@Data
@AllArgsConstructor
@NoArgsConstructor
public class StationOBContainerDto {
    @ApiModelProperty("容器号")
    private String containerNo;

    @ApiModelProperty("容器任务集合")
    private List<StationOBContainerTaskDto> containerTaskList = new ArrayList<>();

    @ApiModelProperty("波次号（越小越优先）")
    private String boCi = "";

    @ApiModelProperty("优先级1")
    private int priority1;

    @ApiModelProperty("优先级2")
    private int priority2;

    @ApiModelProperty("优先级3")
    private int priority3;

    @ApiModelProperty("优先级4")
    private int priority4;

    @ApiModelProperty("优先级5")
    private int priority5;

    //*****以下为非查询获得*****
    @ApiModelProperty("所在区域编号")
    private String areaNo;

    @ApiModelProperty("所在区域优先级（一般用来区分站台缓存区、存储区、接驳口等的优先级）")
    private int areaPriority;

    @ApiModelProperty("所在货位的X坐标")
    private int x;

    @ApiModelProperty("所在货位的Y坐标")
    private int y;

//    public int findTargetAreaPriority(String areaNo) {
//        int minPriority = 999999;
//        if (this.containerTaskList == null || this.containerTaskList.size() == 0) {
//            return minPriority;
//        }
//
//        for (StationOBContainerTaskDto task : this.containerTaskList) {
//            if (task.getTaskTargetAreaNoList().contains(areaNo)) {
//                if (task.getPriority() < minPriority) {
//                    minPriority = task.getPriority();
//                }
//            }
//        }
//        return minPriority;
//    }
}
