| | |
| | | } |
| | | String text = message.trim(); |
| | | |
| | | if (containsAny(text, "排行", "排名", "前几", "前五", "前十") && containsAny(text, "物料", "产品", "原材料", "采购金额", "金额")) { |
| | | return purchaseAgentTools.rankPurchaseMaterials( |
| | | memoryId, |
| | | extractStartDate(text), |
| | | extractEndDate(text), |
| | | text, |
| | | extractLimit(text) |
| | | ); |
| | | } |
| | | if (containsAny(text, "未入库", "待入库", "没有入库", "还未入库")) { |
| | | return purchaseAgentTools.listUnstockedPurchaseOrders( |
| | | memoryId, |
| | | extractStartDate(text), |
| | | extractEndDate(text), |
| | | extractKeyword(text), |
| | | extractLimit(text) |
| | | ); |
| | | } |
| | | if (containsAny(text, "到货异常", "到货有异常", "异常到货", "到货问题", "供应商到货异常")) { |
| | | return purchaseAgentTools.listArrivalExceptions( |
| | | memoryId, |
| | | extractStartDate(text), |
| | | extractEndDate(text), |
| | | text, |
| | | extractLimit(text) |
| | | ); |
| | | } |
| | | if (containsAny(text, "待付款", "未付款", "未付清", "待支付", "应付")) { |
| | | return purchaseAgentTools.listPendingPaymentOrders( |
| | | memoryId, |
| | | extractStartDate(text), |
| | | extractEndDate(text), |
| | | extractKeyword(text), |
| | | extractLimit(text) |
| | | ); |
| | | } |
| | | if (containsAny(text, "退货", "退料", "拒收")) { |
| | | return purchaseAgentTools.listPurchaseReturns( |
| | | memoryId, |
| | | extractStartDate(text), |
| | | extractEndDate(text), |
| | | extractKeyword(text), |
| | | extractLimit(text) |
| | | ); |
| | | } |
| | | if (isStatsIntent(text)) { |
| | | return purchaseAgentTools.getPurchaseStats( |
| | | memoryId, |
| | |
| | | if (containsAny(text, "详情", "明细") && extractId(text) != null) { |
| | | return purchaseAgentTools.getPurchaseLedgerDetail(memoryId, extractId(text)); |
| | | } |
| | | if (containsAny(text, "台账", "采购单", "合同", "列表", "查询")) { |
| | | if (containsAny(text, "台账", "采购单", "采购订单", "订单", "合同", "列表", "查询")) { |
| | | return purchaseAgentTools.listPurchaseLedgers( |
| | | memoryId, |
| | | extractKeyword(text), |
| | |
| | | } |
| | | |
| | | private boolean isStatsIntent(String text) { |
| | | if (containsAny(text, "统计", "分析", "报表", "汇总", "趋势", "数据看板")) { |
| | | if (containsAny(text, "统计", "分析", "报表", "汇总", "趋势", "数据看板", "情况", "有多少")) { |
| | | return true; |
| | | } |
| | | boolean queryWord = containsAny(text, "查询", "查看", "看下", "看看", "获取"); |
| | |
| | | .replace("查询", "") |
| | | .replace("查看", "") |
| | | .replace("采购", "") |
| | | .replace("采购单", "") |
| | | .replace("采购订单", "") |
| | | .replace("订单", "") |
| | | .replace("台账", "") |
| | | .replace("列表", "") |
| | | .replace("哪些", "") |
| | | .replace("列出", "") |
| | | .replace("帮我", "") |
| | | .replace("最近10条", "") |
| | | .replace("前10条", "") |
| | | .trim(); |