录单
This commit is contained in:
@@ -1699,7 +1699,7 @@ public class JDUtil {
|
|||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
redisTemplate.opsForValue().set(redisKey, String.valueOf(count - 1), 1, TimeUnit.DAYS);
|
redisTemplate.opsForValue().set(redisKey, String.valueOf(count - 1), 1, TimeUnit.DAYS);
|
||||||
}
|
}
|
||||||
wxUtil.sendTextMessage(fromWxid, "今日剩余单数:" + count, 1, fromWxid, false);
|
wxUtil.sendTextMessage(fromWxid, "今日剩余单数:" + (count-1), 1, fromWxid, false);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Redis操作失败: {}", e.getMessage(), e);
|
logger.error("Redis操作失败: {}", e.getMessage(), e);
|
||||||
}
|
}
|
||||||
@@ -2241,16 +2241,16 @@ public class JDUtil {
|
|||||||
if (parts.length >= 3) {
|
if (parts.length >= 3) {
|
||||||
String modelNumber = parts[0].replace("\n", ""); // 型号
|
String modelNumber = parts[0].replace("\n", ""); // 型号
|
||||||
String quantityStr = parts[1]; // 数量
|
String quantityStr = parts[1]; // 数量
|
||||||
String address = "";
|
StringBuilder address = new StringBuilder();
|
||||||
for (int i = 2; i < parts.length; i++) {
|
for (int i = 2; i <= parts.length; i++) {
|
||||||
address += parts[i];
|
address.append(parts[i]);
|
||||||
}
|
}
|
||||||
// 使用正则表达式提取中文字符
|
// 使用正则表达式提取中文字符
|
||||||
Pattern pattern = Pattern.compile("[\\u4E00-\\u9FA5]+");
|
Pattern pattern = Pattern.compile("[\\u4E00-\\u9FA5]+");
|
||||||
Matcher matcher = pattern.matcher(input);
|
Matcher matcher = pattern.matcher(input);
|
||||||
|
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
address = matcher.group();
|
address = new StringBuilder(matcher.group());
|
||||||
}
|
}
|
||||||
StringBuilder order = new StringBuilder();
|
StringBuilder order = new StringBuilder();
|
||||||
order.append("单").append("\n").append("H-TF").append("\n").append(modelNumber).append("\n").append(" ").append("\n").append(quantityStr).append("\n").append(address);
|
order.append("单").append("\n").append("H-TF").append("\n").append(modelNumber).append("\n").append(" ").append("\n").append(quantityStr).append("\n").append(address);
|
||||||
|
|||||||
Reference in New Issue
Block a user