Add new query methods for order and contract retrieval in CRM service
This commit is contained in:
parent
a737168b1c
commit
88ef47c0eb
@ -152,7 +152,48 @@ public class CrmMcpService {
|
||||
return executeRequest("ai/query/listClientsByMainNumInTime", requestBody);
|
||||
}
|
||||
|
||||
@Tool(description = "获取当前时间(涉及到时间的问题时,必须调用此函数)")
|
||||
@Tool(description = "根据客户编码或客户名称查询时间区间内的订单列表")
|
||||
public String listOrdersByClientInTime(
|
||||
@ToolParam(description = "客户编码,一般类似于'XX.XX.XXXX.XXX'格式,例如:01.01.0023.024。与clientName必须二选一", required = false) String clientCode,
|
||||
@ToolParam(description = "客户名称,一般类似于'某某课题组'或'某某公司'或'某某实验室'或'某某经营部'或'某某研究院'或'某某研究所'或'某某测试'等组织,例如:张三课题组,广州小懒科技有限公司,金域测试、金域课题组111、玉尘测试A01、睿展小组3号。与clientCode必须二选一", required = false) String clientName,
|
||||
@ToolParam(description = "开始时间,一般类似于'yyyy-MM-dd HH:mm:ss'格式,例如:2024-01-01 00:00:00。非必填", required = false) String startTime,
|
||||
@ToolParam(description = "结束时间,一般类似于'yyyy-MM-dd HH:mm:ss'格式,例如:2024-01-01 00:00:00。非必填", required = false) String endTime
|
||||
) {
|
||||
JSONObject requestBody = new JSONObject();
|
||||
requestBody.put("clientCode", clientCode);
|
||||
requestBody.put("clientName", clientName);
|
||||
requestBody.put("startTime", startTime);
|
||||
requestBody.put("endTime", endTime);
|
||||
|
||||
return executeRequest("ai/query/listOrdersByClientInTime", requestBody);
|
||||
}
|
||||
|
||||
@Tool(description = "根据订单编码查询订单信息。orderCode是必填项,如果提取不到则输出:请告知需要查询的订单号")
|
||||
public JSONObject getOrderInfoByCode(
|
||||
@ToolParam(description = "订单编码(即订单号),值一般是由字母、数字和'-'组成,特征一般类似于'NJ00027202506090001',或'NJ00027202506090001-G'或'NJ00027202506090001-T-1',或'dev-NJ00027202506090001'") String orderCode
|
||||
) {
|
||||
Assert.isTrue(StrUtil.isNotEmpty(orderCode), "订单编码不能为空");
|
||||
|
||||
JSONObject requestBody = new JSONObject();
|
||||
requestBody.put("orderCode", orderCode);
|
||||
|
||||
String executed = executeRequest("ai/query/getOrderInfoByCode", requestBody);
|
||||
return JSONObject.parseObject(executed);
|
||||
}
|
||||
|
||||
@Tool(description = "根据合同编码查询下游订单编码列表。contractCode是必填项,如果提取不到则输出:请告知需要查询的合同编码")
|
||||
public String listOrdersByContractCode(
|
||||
@ToolParam(description = "合同编码,值一般是由字母、数字和'-'组成的合同标识符") String contractCode
|
||||
) {
|
||||
Assert.isTrue(StrUtil.isNotEmpty(contractCode), "合同编码不能为空");
|
||||
|
||||
JSONObject requestBody = new JSONObject();
|
||||
requestBody.put("conCode", contractCode);
|
||||
|
||||
return executeRequest("ai/query/listOrdersByContractCode", requestBody);
|
||||
}
|
||||
|
||||
@Tool(description = "调用此函数以获取当前准确时间(包括日期和时区),用于代替模型默认推理")
|
||||
public String getCurrentTime() {
|
||||
return DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user