package com.fzzy.igds.dzhwk.constant;
|
|
import java.util.Set;
|
|
/**
|
* 粮食品种,
|
* <p>
|
* 更新记录:
|
* 参考:LST1703-2017 标准重新定义
|
*/
|
public class FoodVariety {
|
|
/**
|
* 根据名称找编码
|
*
|
* @param msg
|
* @return
|
*/
|
public static String getCode(String msg) {
|
Set<String> keys = Constant.mapFoodVariety.keySet();
|
if (null == keys || keys.isEmpty()) return msg;
|
|
for (String key : keys) {
|
if (Constant.mapFoodVariety.get(key).equals(msg)) {
|
return key;
|
}
|
}
|
return msg;
|
}
|
|
/**
|
* 根据编码找名称
|
* @param code
|
* @return
|
*/
|
public static String getMsg(String code) {
|
if (null == code) return "未配置";
|
|
return Constant.mapFoodVariety.get(code);
|
}
|
}
|