update 电单车

This commit is contained in:
Guoqs
2024-09-12 15:28:22 +08:00
parent ce3e62c2db
commit 64698a943f

View File

@@ -87,7 +87,13 @@ public class IdUtils {
public static String generateTransactionCode(String pileConnectorCode) {
String timeNow = DateUtils.dateTimeNow(DateUtils.YYMMDDHHMMSS);
// 随机生成一个四位整数
String randomNumber = RandomUtil.getRandomNumberStr(4);
String randomNumber = null;
if (pileConnectorCode.length() < 14) {
randomNumber = RandomUtil.getRandomNumberStr(8);
} else {
randomNumber = RandomUtil.getRandomNumberStr(4);
}
return pileConnectorCode + timeNow + randomNumber;
}