录单
This commit is contained in:
@@ -2041,6 +2041,7 @@ public class JDUtil {
|
|||||||
}
|
}
|
||||||
return now;
|
return now;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解析用户输入中的日期部分
|
* 解析用户输入中的日期部分
|
||||||
*
|
*
|
||||||
@@ -2056,6 +2057,7 @@ public class JDUtil {
|
|||||||
}
|
}
|
||||||
return null; // 没有带日期或格式错误,返回 null
|
return null; // 没有带日期或格式错误,返回 null
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LD(String input, String fromWxid) {
|
public void LD(String input, String fromWxid) {
|
||||||
// 1️⃣ 调用封装好的方法提取日期
|
// 1️⃣ 调用封装好的方法提取日期
|
||||||
LocalDate userDate = parseUserDateIfPresent(input);
|
LocalDate userDate = parseUserDateIfPresent(input);
|
||||||
@@ -2221,14 +2223,21 @@ public class JDUtil {
|
|||||||
String modelNumber = parts[0]; // 型号
|
String modelNumber = parts[0]; // 型号
|
||||||
String quantityStr = parts[1]; // 数量
|
String quantityStr = parts[1]; // 数量
|
||||||
String address = parts[2]; // 地址
|
String address = parts[2]; // 地址
|
||||||
|
// 使用正则表达式提取中文字符
|
||||||
|
Pattern pattern = Pattern.compile("[\\u4E00-\\u9FA5]+");
|
||||||
|
Matcher matcher = pattern.matcher(input);
|
||||||
|
|
||||||
|
if (matcher.find()) {
|
||||||
|
address = 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);
|
||||||
sendOrderToWxByOrderD(order.toString(), fromWxid);
|
sendOrderToWxByOrderD(order.toString(), fromWxid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user