重构评论

This commit is contained in:
Van0313
2025-05-10 17:58:31 +08:00
parent 100462f3bb
commit 9250ed919d

View File

@@ -1602,6 +1602,17 @@ public class JDUtil {
getProductTypeMap();
// 检查是否命中“评”指令
if (!productTypeMap.containsKey(order.trim())) {
if (order.startsWith("添加型号")){
String replace = order.replace("添加型号-", "");
String[] split = replace.split("-");
if (split.length == 2){
addProductTypeMap(split[0], split[1]);
wxUtil.sendTextMessage(fromWxid, "添加型号成功", 1, fromWxid, false);
}else {
wxUtil.sendTextMessage(fromWxid, "添加型号格式错误,请输入正确的格式:添加型号-型号名称-型号SKU", 1, fromWxid, false);
}
return;
}
try {
StringBuilder productTypeStr = new StringBuilder();
for (Map.Entry<String, String> entry : productTypeMap.entrySet()) {
@@ -1617,18 +1628,6 @@ public class JDUtil {
wxUtil.sendTextMessage(fromWxid, "处理异常,请重新开始", 1, fromWxid, false);
}
} else {
if (order.startsWith("添加型号")){
String replace = order.replace("添加型号-", "");
String[] split = replace.split("-");
if (split.length == 2){
addProductTypeMap(split[0], split[1]);
wxUtil.sendTextMessage(fromWxid, "添加型号成功", 1, fromWxid, false);
return;
}else {
wxUtil.sendTextMessage(fromWxid, "添加型号格式错误,请输入正确的格式:添加型号-型号名称-型号SKU", 1, fromWxid, false);
}
}
// 如果未命中“评”指令,检查是否在生成评论流程中
handleCommentInteraction(fromWxid, order);
}
}