3.添加任务Post http://localhost:63300/api/Pms/TaskAdd 发送Body例子 { "WareHouseCode": "原材料", "LocationCode": "", "MaterialId": "满托盘", "TargetWareHouseCode": "", "TargetLocationCode": "工位1" } 返回值 { "code": 20000, "data": { "ID": "44076b2c-5549-4bf0-8058-dfb71b2c24b1", "OrderId": "20221121", "TaskId": "202211211517010827554", "ParentTaskId": "", "TemplateName": "原材料-工位", "Status": 1, "Parameters": "{\"U1\":\"原材料3\",\"U2\":\"工位1\"}", "Priority": 0, "AgvId": 0, "AgvType": "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15", "CreateTime": "2022-11-21T07:17:01.0837524Z", "reserved1": "", "reserved2": "0", "reserved3": "", "reserved4": "", "reserved5": "", "reserved6": "", "reserved7": "", "reserved8": "", "reserved9": "", "reserved10": "" }, "message": "任务添加成功:任务号202211211517010827554" }
时间: 2023-08-22 19:05:39 浏览: 41
根据您提供的信息,这是一个使用 HTTP POST 方法向 `http://localhost:63300/api/Pms/TaskAdd` 发送 JSON 格式数据的例子。其中 JSON 数据包含多个属性,用于添加一个新的任务。具体属性含义如下:
- `WareHouseCode`:任务所在的仓库编号。
- `LocationCode`:任务所在的库位编号。
- `MaterialId`:任务所需的物料编号。
- `TargetWareHouseCode`:任务目标仓库编号。
- `TargetLocationCode`:任务目标库位编号。
API 接口需要能够接收 POST 请求,从请求中读取 JSON 数据,然后根据数据创建一个新的任务。在任务创建成功后,需要返回一个 JSON 格式的响应,包含任务的相关信息,例如任务编号、创建时间等。具体实现方式可以参考您所使用的 Web 框架的文档或示例代码。
相关问题
用c#向http://localhost:63300/api/Pms/GetLocationProperty?WareHouseCode=上料 api接口发出请求
好的,以下是使用 C# 向 http://localhost:63300/api/Pms/GetLocationProperty 接口发出 HTTP GET 请求的示例代码:
```csharp
using System;
using System.Net.Http;
using System.Threading.Tasks;
public class Program
{
static async Task Main(string[] args)
{
var url = "http://localhost:63300/api/Pms/GetLocationProperty?WareHouseCode=上料";
using (var client = new HttpClient())
{
var response = await client.GetAsync(url);
if (response.IsSuccessStatusCode)
{
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
else
{
Console.WriteLine($"Failed with status code {response.StatusCode}");
}
}
}
}
```
此示例使用 HttpClient 类创建 HTTP 客户端,然后使用 GetAsync 方法发出 GET 请求。如果请求成功,则使用 ReadAsStringAsync 方法从响应内容中读取数据并打印到控制台。如果请求失败,则打印响应状态码。注意,此示例中的 URL 中包含 WareHouseCode 参数,其值为“上料”。您可以根据需要更改参数值。
2.更新库位信息 Post http://localhost:63300/api/Pms/UpdateLocationProperty 发送Body例子 { "LocationCode": "原材料1", "Status": 2 } { "LocationCode": "原材料1", "Status": 1 } Status状态 1:满 2:空
根据您提供的信息,这是一个使用 HTTP POST 方法向 `http://localhost:63300/api/Pms/UpdateLocationProperty` 发送 JSON 格式数据的例子。其中 JSON 数据包含两个属性 `LocationCode` 和 `Status`,用于更新库位信息。属性 `LocationCode` 表示库位编号,属性 `Status` 表示库位状态,可选值为 1 和 2,分别表示满和空。
您需要编写一个能够接收 POST 请求的 API 接口,从请求中读取 JSON 数据,然后根据 `LocationCode` 属性更新对应库位的状态。具体实现方式可以参考您所使用的 Web 框架的文档或示例代码。