重构评论
This commit is contained in:
@@ -1602,6 +1602,17 @@ public class JDUtil {
|
|||||||
getProductTypeMap();
|
getProductTypeMap();
|
||||||
// 检查是否命中“评”指令
|
// 检查是否命中“评”指令
|
||||||
if (!productTypeMap.containsKey(order.trim())) {
|
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 {
|
try {
|
||||||
StringBuilder productTypeStr = new StringBuilder();
|
StringBuilder productTypeStr = new StringBuilder();
|
||||||
for (Map.Entry<String, String> entry : productTypeMap.entrySet()) {
|
for (Map.Entry<String, String> entry : productTypeMap.entrySet()) {
|
||||||
@@ -1617,18 +1628,6 @@ public class JDUtil {
|
|||||||
wxUtil.sendTextMessage(fromWxid, "处理异常,请重新开始", 1, fromWxid, false);
|
wxUtil.sendTextMessage(fromWxid, "处理异常,请重新开始", 1, fromWxid, false);
|
||||||
}
|
}
|
||||||
} else {
|
} 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);
|
handleCommentInteraction(fromWxid, order);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user