From 7ec2cb36d363aab771c1e5bf7be422907b14faf7 Mon Sep 17 00:00:00 2001 From: lin <642018748@qq.com> Date: Tue, 14 Feb 2023 18:04:49 +0800 Subject: [PATCH] fix car pay --- .../iformall/service/impl/WxCouponPasswordServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java index 0a5d6213d..5576955a4 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java @@ -96,7 +96,7 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { @Override public void mkPasswords(TenantEntity tenantEntity, Long couponId, Integer inventory) { - String strAll = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + String strAll = "0123456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"; // 1.获取 coupon short 1 int couponShort = 0; String couponShortStr = "0"; @@ -104,14 +104,15 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService { pwQ.updateTenantInfo(tenantEntity); List pwgList = wxCouponPasswordMapper.findCouponGroupList(pwQ); couponShort = pwgList.size(); - couponShortStr = String.valueOf(strAll.charAt(couponShort%62)); + int dospt = strAll.length(); + couponShortStr = String.valueOf(strAll.charAt(couponShort%dospt)); // 2.随机字符 Random rand = new Random(); List pwList = new ArrayList<>(); while (true) { StringBuilder sb = new StringBuilder(); for (int j = 0; j < 9; j++) { - int f = (int) (Math.random() * 62); + int f = (int) (Math.random() * dospt); sb.append(strAll.charAt(f)); if (j == 4) { sb.append(couponShortStr);