using Masuit.Tools;
using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json;
using WIDESEA.Common;
using WIDESEA_Common;
using WIDESEA_Common.ZY;
using WIDESEA_Core;
using WIDESEA_Core.Helper;
using WIDESEA_Model.Models;
namespace WIDESEA_StoragIntegrationServices
{
public partial class ToZYService
{
///
/// 上传测量数据至智粤
///
/// 车轮
///
public WebResponseContent ReportToSCE(Dt_CheckResult checkResult)
{
WebResponseContent content = new WebResponseContent();
try
{
//cltm = "L E1700844 0037";
if (string.IsNullOrEmpty(checkResult.CLTM)) throw new Exception("请求车轴号不能为空");
string ipaddress = ZY_CheckResultInterface + "/ReportToSCE";
var dic = checkResult.ToDictionary();
//dic.Remove("ID");
//dic.Remove("IsUploadMES");
RequestReportToSCE_ZY Info = new RequestReportToSCE_ZY { s_eqptno = "CL", s_source = JsonConvert.SerializeObject(dic) };
var infos = Info.ToDictionary();
var responStr = HttpsClient.PostXml(ipaddress, infos);
Basic_ZY result = XMLSerializationTool.DeserializeXmlToObject(responStr);
if (result.FLAG != "S") throw new Exception($"上传信息失败:智粤接口返回失败:{result.ERROR}");
content.OK();
}
catch (Exception ex)
{
content.Error("上传测量信息失败,异常:" + ex.Message);
}
return content;
}
}
}