From 5cc2557fca5c755b6c884e7e0dc7bccfdca7e217 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Thu, 6 Nov 2025 21:41:07 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=93=E5=85=B7=E5=88=B8VIP=E5=90=8D?= =?UTF-8?q?=E5=AD=97=E5=8D=95=E7=8B=AC=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../propcoupon/PropCouponGrantCmdExe.java | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) 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() {