bug fix
This commit is contained in:
@@ -1531,25 +1531,28 @@ public class JDUtil {
|
|||||||
num = Integer.parseInt(split[2]);
|
num = Integer.parseInt(split[2]);
|
||||||
} catch (NumberFormatException ignored) {
|
} catch (NumberFormatException ignored) {
|
||||||
}
|
}
|
||||||
if (s != null) {
|
for (int i = 0; i < num; i++){
|
||||||
count = Integer.parseInt(s) + num; // 递增计数器
|
if (s != null) {
|
||||||
|
count = Integer.parseInt(s) + 1; // 递增计数器
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将新的计数器值保存回 Redis
|
||||||
|
redisTemplate.opsForValue().set(redisKey, String.valueOf(count), 1, TimeUnit.DAYS);
|
||||||
|
|
||||||
|
// 生成订单号
|
||||||
|
String orderID = today + String.format("%03d", count); // 格式化为 3 位数字,不足补零
|
||||||
|
|
||||||
|
// 替换模板中的占位符
|
||||||
|
temp = temp.replace("{单号}", orderID);
|
||||||
|
temp = temp.replace("{地址}", split[3]);
|
||||||
|
temp = temp.replace("{型号}", split[1]);
|
||||||
|
temp = temp.replaceAll("[|]", "");
|
||||||
|
|
||||||
|
|
||||||
|
// 发送订单信息到微信
|
||||||
|
wxUtil.sendTextMessage(fromWxid, temp, 1, fromWxid, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 将新的计数器值保存回 Redis
|
|
||||||
redisTemplate.opsForValue().set(redisKey, String.valueOf(count), 1, TimeUnit.DAYS);
|
|
||||||
|
|
||||||
// 生成订单号
|
|
||||||
String orderID = today + String.format("%03d", count); // 格式化为 3 位数字,不足补零
|
|
||||||
|
|
||||||
// 替换模板中的占位符
|
|
||||||
temp = temp.replace("{单号}", orderID);
|
|
||||||
temp = temp.replace("{地址}", split[3]);
|
|
||||||
temp = temp.replace("{型号}", split[1]);
|
|
||||||
temp = temp.replaceAll("[|]", "");
|
|
||||||
|
|
||||||
|
|
||||||
// 发送订单信息到微信
|
|
||||||
wxUtil.sendTextMessage(fromWxid, temp, 1, fromWxid, true);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("生成订单号时发生异常 - 用户: {}, 日期: {}", fromWxid, today, e);
|
logger.error("生成订单号时发生异常 - 用户: {}, 日期: {}", fromWxid, today, e);
|
||||||
|
|||||||
Reference in New Issue
Block a user