有两个接口:
url: http:xxx/api/1
{
"Header": {
"sMesUser": "JXYD",
"sLanguage": "S",
"sFactoryNo": "0",
"sUserNo": "sa",
"sClientIp": "127.0.0.1",
"sInterfaceType": "TIMS_CHECK_LOTCARD_CARRIER_SN_STATION"
},
"Body": {
"data": [{
"SN": "",
"TYPE": "PANEL_SN",
"CARRIER_NO": "",
"LOTCARD_NO": "",
"EQUIPMENT_NO": "",
"TERMINAL_NO": "",
"STATUS": "OK",
"EQUIPCODE": "",
"PRO_NAME": "",
"PRO_UPDATE_DATE": "2024-01-02",
"PRESSURE_VALUE":"12",
"PRESSING_DATE":"2024-01-02",
"TEMPERATURE":"20"
"IS_CHECK_FEED_MATERIAL": "Y",
"IS_CHECK_STATION": "Y"
}]
}
另一个:
url: http:xxx/api/2
{
"Header": {
"sMesUser": "JXYD",
"sLanguage": "S",
"sFactoryNo": "0",
"sUserNo": "sa",
"sClientIp": "127.0.0.1",
"sInterfaceType": "TIMS_LOTCARD_CARRIER_SN_STATION"
},
"Body": {
"data": [{
"SN": "",
"TYPE": "PANEL_SN",
"CARRIER_NO": "",
"LOTCARD_NO": "",
"EQUIPMENT_NO": "",
"TERMINAL_NO": "",
"STATUS": "OK",
"EQUIPCODE": "",
"PRO_NAME": "",
"PRO_UPDATE_DATE": "2024-01-02",
"PRESSURE_VALUE":"12",
"PRESSING_DATE":"2024-01-02",
"TEMPERATURE":"20"
"IS_DEDUCT":"Y",
"Detail": [{
"FID": "1",
"QTY": "10"
}, {
"FID": "2",
"QTY": "11"
}]
}
都是Post请求。
参考下面的代码写代码:
userInfo.EmployeeID = txtEmployeeID.Text;
userInfo.DeviceNumber = txtDeviceNumber.Text;
userInfo.ProjectCode = txtProjectCode.Text;
userInfo.ComputerID = txtComputerID.Text;
userInfo.StationCode = txtStationCode.Text;
userInfo.LineCode = txtLineCode.Text;
userInfo.Instrument = txtInstrument.Text;
userInfo.LotNumber = txtLotNumber.Text;
userInfo.FixtureName = txtFixtureName.Text;
operationData.PanelId = userInfo.panelId;
operationData.IsPass = true; //校验ok
operationData.OperationTime = DateTime.Now.ToString();
operationData.OperationType = userInfo.operationType;
operationData.OperationSequence = 1;
operationData.OperationDuration = plcData.OperationDuration;
operationData.OperationDurationUpperLimit = plcData.OperationDurationUpperLimit;
operationData.OperationDurationLowerLimit = plcData.OperationDurationLowerLimit;
operationData.ResultPressureUpperLimit = plcData.ResultPressureUpperLimit;
operationData.ResultPressureLowerLimit = plcData.ResultPressureLowerLimit;
operationData.PressureUpperLimit = plcData.PressureUpperLimit;
operationData.PressureLowerLimit = plcData.PressureLowerLimit;
operationData.UpsideTemperatureUpperLimit = plcData.UpsideTemperatureUpperLimit;
operationData.UpsideTemperatureLowerLimit = plcData.UpsideTemperatureLowerLimit;
operationData.DownsideTemperatureUpperLimit = plcData.DownsideTemperatureUpperLimit;
operationData.DownsideTemperatureLowerLimit = plcData.DownsideTemperatureLowerLimit;
operationData.EmployeeName = userInfo.EmployeeID;
operationData.MachineName = userInfo.DeviceNumber;
operationData.ToolName = userInfo.FixtureName;
operationData.TotalPressure = d_values[i];
operationData.IsSubmitted = false;
operationData.SubmissionTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
string json = SerializeOperationData(data);