diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponGrantCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponGrantCmdExe.java index 0e9a5b90..b9e16562 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponGrantCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/propcoupon/PropCouponGrantCmdExe.java @@ -120,6 +120,8 @@ public class PropCouponGrantCmdExe { LocalDateTime now = LocalDateTime.now(); LocalDateTime expireTime = now.plusDays(cmd.getValidDays()); + // 转换贵族等级名称为VIP等级 + String displayPropName = convertNobleNameToVipLevel(cmd.getPropName()); for (Long userId : userIds) { PropCoupon propCoupon = new PropCoupon(); propCoupon.setCouponNo(generateCouponNo()); @@ -127,7 +129,7 @@ public class PropCouponGrantCmdExe { propCoupon.setCouponType(couponType); propCoupon.setPropId(cmd.getPropId()); propCoupon.setPropIcon(cmd.getPropIcon()); - propCoupon.setPropName(cmd.getPropName()); + propCoupon.setPropName(displayPropName); propCoupon.setValidDays(cmd.getValidDays()); propCoupon.setStatus(PropCouponStatus.UNUSED); propCoupon.setSource(PropCouponSource.ADMIN_GRANT); @@ -142,6 +144,35 @@ public class PropCouponGrantCmdExe { } /** + * 转换贵族等级名称为VIP等级 + * + * @param propName 道具名称 + * @return VIP等级名称 + */ + private String convertNobleNameToVipLevel(String propName) { + if (propName == null) { + return propName; + } + + // 贵族等级映射 + switch (propName.toUpperCase()) { + case "VISCOUNT": + return "VIP 1"; + case "EARL": + return "VIP 2"; + case "MARQUIS": + return "VIP 3"; + case "DUKE": + return "VIP 4"; + case "KING": + return "VIP 5"; + default: + return propName; + } + } + + + /** * 生成券编号(唯一) */ private String generateCouponNo() {