LocationAreaUtils.java
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.huaheng.common.utils;
import com.huaheng.common.constant.StationConstant;
import com.huaheng.common.exception.BusinessException;
/**
* 库区 区域转换
* @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;
}
}