Преглед изворни кода

fix car pay

release_toaliyun_real
lin пре 3 година
родитељ
комит
7ec2cb36d3
1 измењених фајлова са 4 додато и 3 уклоњено
  1. +4
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java

+ 4
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxCouponPasswordServiceImpl.java Прегледај датотеку

@@ -96,7 +96,7 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService {
@Override @Override
public void mkPasswords(TenantEntity tenantEntity, Long couponId, Integer inventory) { public void mkPasswords(TenantEntity tenantEntity, Long couponId, Integer inventory) {
String strAll = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
String strAll = "0123456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ";
// 1.获取 coupon short 1 // 1.获取 coupon short 1
int couponShort = 0; int couponShort = 0;
String couponShortStr = "0"; String couponShortStr = "0";
@@ -104,14 +104,15 @@ public class WxCouponPasswordServiceImpl implements WxCouponPasswordService {
pwQ.updateTenantInfo(tenantEntity); pwQ.updateTenantInfo(tenantEntity);
List<WxCouponPassword> pwgList = wxCouponPasswordMapper.findCouponGroupList(pwQ); List<WxCouponPassword> pwgList = wxCouponPasswordMapper.findCouponGroupList(pwQ);
couponShort = pwgList.size(); couponShort = pwgList.size();
couponShortStr = String.valueOf(strAll.charAt(couponShort%62));
int dospt = strAll.length();
couponShortStr = String.valueOf(strAll.charAt(couponShort%dospt));
// 2.随机字符 // 2.随机字符
Random rand = new Random(); Random rand = new Random();
List<String> pwList = new ArrayList<>(); List<String> pwList = new ArrayList<>();
while (true) { while (true) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (int j = 0; j < 9; j++) { for (int j = 0; j < 9; j++) {
int f = (int) (Math.random() * 62);
int f = (int) (Math.random() * dospt);
sb.append(strAll.charAt(f)); sb.append(strAll.charAt(f));
if (j == 4) { if (j == 4) {
sb.append(couponShortStr); sb.append(couponShortStr);


Loading…
Откажи
Сачувај