package com.jeeplus.modules.warehouse.shelves.utils;

import com.jeeplus.modules.warehouse.shelves.entity.Shelves;
import com.jeeplus.modules.warehouse.warehouse.entity.Warehouse;

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

public class ShelvesUtil {

    public static String mergeShevlesName(Set<Shelves> set) {

        return "";
    }

    /**
     * 整合仓库名称，返回（a,b,c）
     * @param warehousesNames
     * @return
     */
    public static String mergerWarehouseName(Set<String> warehousesNames) {
        List<String> wList = new ArrayList<>();
        for (String wName : warehousesNames) {
            wList.add(wName);
        }

        StringBuffer sb = new StringBuffer();
        for (int i =0; i < wList.size(); i ++) {
            if (0 != wList.size()) {
                sb.append(wList.get(i));
                if (i != wList.size() - 1) {
                    sb.append(",");
                }
            } else {
                sb.append(wList.get(i));
            }
        }
        return sb.toString();
    }
}
