czt
9 天以前 db67639449287bcec461916a7dca6003ee5dd03c
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
package com.fzzy.igds.constant;
 
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
 
/**
 * @Description 出入库流程枚举
 * @Author CZT
 * @Date 2025/11/25 13:22
 */
public class InoutProgress {
 
    /**
     * 用于存放粮类型code -name
     */
    public static Map<String, String> mapProgressName = new HashMap<>();
 
    /**
     * 根据名称找编码
     *
     * @param msg
     * @return
     */
    public static String getCode(String msg) {
        Set<String> keys = mapProgressName.keySet();
        if (null == keys || keys.isEmpty()) return msg;
 
        for (String key : keys) {
            if (mapProgressName.get(key).equals(msg)) {
                return key;
            }
        }
        return msg;
    }
 
    /**
     * 根据编码找名称
     * @param code
     * @return
     */
    public static String getMsg(String code) {
        if (null == code) return "未配置";
 
        return mapProgressName.get(code);
    }
}