Admin
5 天以前 bd6818fc9d40f343547bafca0743658f3c0379dc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
    {
        /// <summary>
        /// 
        /// </summary>
 
        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<ErpWebService.WheelsetMatchResponse> res = client.WheelsetMatchAsync(ldcode, materielNumber, type);
                resultString = res.Result.Body.WheelsetMatchResult;
 
                WheelsetMatchXMLEntity xmlEntity = XMLSerializationTool.DeserializeXmlToObject<WheelsetMatchXMLEntity>(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;
        }
    }
}