This commit is contained in:
Van0313
2025-06-08 19:26:17 +08:00
parent 9b97816127
commit 80c396cd81

View File

@@ -2041,6 +2041,7 @@ public class JDUtil {
}
return now;
}
/**
* 解析用户输入中的日期部分
*
@@ -2056,6 +2057,7 @@ public class JDUtil {
}
return null; // 没有带日期或格式错误,返回 null
}
public void LD(String input, String fromWxid) {
// 1⃣ 调用封装好的方法提取日期
LocalDate userDate = parseUserDateIfPresent(input);
@@ -2208,7 +2210,7 @@ public class JDUtil {
}
wxUtil.sendTextMessage(fromWxid, info, 1, null, true);
wxUtil.sendTextMessage(fromWxid, sb.toString(), 1, null, true);
}else if (input.startsWith("TF")){
} else if (input.startsWith("TF")) {
/*
ZQD130F-EB130 1 张林 17530176250 湖北省 武汉市 东西湖区 径河街道 径河街道临空港小区二期 8栋2单元2204联系15783450649转6316
切割出
@@ -2221,14 +2223,21 @@ public class JDUtil {
String modelNumber = parts[0]; // 型号
String quantityStr = parts[1]; // 数量
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();
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);
}
}
}