diff --git a/src/main/java/cn/van/business/util/JDUtil.java b/src/main/java/cn/van/business/util/JDUtil.java index c4f807b..617cf9c 100644 --- a/src/main/java/cn/van/business/util/JDUtil.java +++ b/src/main/java/cn/van/business/util/JDUtil.java @@ -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 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); } }