Commit c91d495d by jianan

出账检核-增加币种47

parent a139ccd6
...@@ -39,4 +39,22 @@ public enum FortuneTypeEnum { ...@@ -39,4 +39,22 @@ public enum FortuneTypeEnum {
public String getItemValue() { public String getItemValue() {
return itemValue; return itemValue;
} }
/**
* 根据业务值(itemValue)获取枚举实例
*
* @param itemValue 业务值,如 "2"
* @return 对应的枚举实例
*/
public static FortuneTypeEnum getByItemValue(String itemValue) {
if (itemValue == null) {
return null;
}
for (FortuneTypeEnum type : FortuneTypeEnum.values()) {
if (type.getItemValue().equals(itemValue)) {
return type;
}
}
throw new IllegalArgumentException("No enum constant for itemValue: " + itemValue);
}
} }
...@@ -304,7 +304,7 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe ...@@ -304,7 +304,7 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
String formattedPolicySuffix = String.format("%6s", last6Chars).replace(' ', '0'); String formattedPolicySuffix = String.format("%6s", last6Chars).replace(' ', '0');
// 3. 项目类型枚举转换为字符串 // 3. 项目类型枚举转换为字符串
String fortuneTypeCode = FortuneTypeEnum.valueOf(fortuneType).getItemLabel(); String fortuneTypeCode = FortuneTypeEnum.getByItemValue(fortuneType).getItemLabel();
// 4. 组装最终字符串 // 4. 组装最终字符串
return String.format("%s-%s-%d", return String.format("%s-%s-%d",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment