用枚举转字符串方式
/**
* 枚举
*/
private enum SupeGroup{
J1,J2,J3,J4,J5,J6,J7,J8,JZ
}
/**
* 字符串转枚举
* @param str
* @return
*/
public SupeGroup toSupeGroup(String str){
return SupeGroup.valueOf(str);
}
switch(toSupeGroup(supeGroupCode)){
case J1:
str="监督一组";
break;
case J2:
str="监督二组";
break;
case J3:
str="监督三组";
break;
case J4:
str="监督四组";
break;
case J5:
str="监督五组";
break;
case J6:
str="监督六组";
break;
case J7:
str="监督七组";
break;
case J8:
str="监督八组";
break;
case JZ:
str="技术质量组";
break;
}
时间: 2024-11-07 09:37:19