using Masuit.Tools;
using Newtonsoft.Json;
using WIDESEA.Common;
using WIDESEA_Common;
using WIDESEA_Common.ZY;
using WIDESEA_Core;
using WIDESEA_Core.Helper;
namespace WIDESEA_StoragIntegrationServices
{
public partial class ToZYService
{
///
/// 获取车轴信息接口
///
/// 车轮
///
public WebResponseContent getCZInfo(SaveModel saveModel)
{
WebResponseContent content = new WebResponseContent();
try
{
string cztm = saveModel.MainData["cztm"].ToString();
//cltm = "L E1700844 0037";
if (string.IsNullOrEmpty(cztm)) throw new Exception("请求车轴条码不能为空");
string ipaddress = ZY_Interface + "/getCZInfo";
CZinfo Info = new CZinfo { s_barcode = cztm };
var dic = Info.ToDictionary();
var responStr = HttpsClient.PostXml(ipaddress, dic);
//CLInfo_ZY info = JsonConvert.DeserializeObject(responStr);1
WheelSetMeasurement inf2o = XMLSerializationTool.DeserializeXmlToObject(responStr);
if (inf2o.FLAG != "S") throw new Exception($"获取信息失败:接口返回失败:{inf2o.ERROR}");
content.OK(data: inf2o);
}
catch (Exception ex)
{
content.Error("获取车轴信息失败.异常:" + ex.Message);
}
return content;
}
}
}