LocationAreaUtils.java 2.33 KB
package com.huaheng.common.utils;

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

/**
 * 库区 区域转换
 * @author huaheng
 */
public class LocationAreaUtils {

    /**
     * 包装区对应区域限制验证
     * @param  station
     * @return
     */
    public static String checkHLocationCheck(String station, String area) {
        String locationArea = "";
//        switch (station) {
//            case StationConstant.H1:
//                if (!area.equals(StationConstant.HL1) && !area.equals(StationConstant.HL2)) {
//                    throw new BusinessException("不能跨区域分配任务");
//                }
//                break;
//            case StationConstant.H2:
//                if (!area.equals(StationConstant.HL1) && !area.equals(StationConstant.HL2) && !area.equals(StationConstant.HL3)) {
//                    throw new BusinessException("不能跨区域分配任务");
//                }
//                break;
//            case StationConstant.H3:
//                if (!area.equals(StationConstant.HL2) && !area.equals(StationConstant.HL3)) {
//                    throw new BusinessException("不能跨区域分配任务");
//                }
//                break;
//            case StationConstant.H4:
//                if (!area.equals(StationConstant.HL4) && !area.equals(StationConstant.HL5)) {
//                    throw new BusinessException("不能跨区域分配任务");
//                }
//                break;
//            case StationConstant.H5:
//                if (!area.equals(StationConstant.HL4) && !area.equals(StationConstant.HL5)) {
//                    throw new BusinessException("不能跨区域分配任务");
//                }
//                break;
//            default:
//                break;
//        }
        return locationArea;
    }

    public static List<String> getRoadWaysByArea(Integer area) {
        List<String> roadWays = new ArrayList<>();
        switch (area) {
            case 1:
            case 7:
                roadWays.add("1");
                roadWays.add("2");
                break;
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 8:
                roadWays.add("1");
                break;
            default:
                break;
        }
        return roadWays;
    }

}