package com.sagacloud.endpointService;

import com.sagacloud.dict.EqStaticInfo;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class EquipmentService {

    public static Set<String> getEquipTypeByCategoryOrSystemEquipType(String pjId, String category) {
        if(category == null)
            return null;
        EqStaticInfo eqStaticInfo = new EqStaticInfo(pjId);
        Set<String> equipTypes = new HashSet<>();
        if(category.length() == 4){   // 如果是4位设备类型
            equipTypes.add(category);
        }else if( eqStaticInfo.getMajorToEqMap().containsKey(category)){  // 如果是2位的专业
            equipTypes = eqStaticInfo.getMajorToEqMap().get(category);
        }else {    // 是2位的系统
            equipTypes = EqStaticInfo.systemToEqMap.get(category);
        }

        return equipTypes;
    }
}
