using System;
using System.Collections.Generic;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using WIDESEA.Common;
using WIDESEA.Core.Utilities;
using WIDESEA.Services.Services.ToMes;
using WIDESEA_Common.LogEnum;
namespace WIDESEA.Services.Services
{
public partial class CommonFunction
{
///
///
///
public static string WheelsetMatch(string ldcode, string materielNumber, string type)
{
string result = string.Empty;
string resultString = string.Empty;
try
{
EndpointAddress address = new EndpointAddress(ToMesService.POSTURL);
ErpWebService.Service_EQPSoapClient client = new ErpWebService.Service_EQPSoapClient(new BasicHttpBinding(), address);
Task res = client.WheelsetMatchAsync(ldcode, materielNumber, type);
resultString = res.Result.Body.WheelsetMatchResult;
WheelsetMatchXMLEntity xmlEntity = XMLSerializationTool.DeserializeXmlToObject(resultString);
if (null != xmlEntity && "S".Equals(xmlEntity.FLAG))
result = "上传MES成功.";
else
result = "上传MES失败:" + xmlEntity.ERROR;
}
catch
{
}
finally
{
LogRecord.WriteLog((int)LogEnum.Mes, $"选配上传MES,轮对号:{ldcode},轴承编号:{materielNumber},类型:{type},结果:{resultString}");
}
return result;
}
}
}