11
huanghongfeng
5 天以前 f4c3f82a3bd142bc555ec7f632dabc66ef86f5af
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
48
49
50
51
 
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
    {
        /// <summary>
        /// 获取车轴信息接口
        /// </summary>
        /// <param name="">车轮</param>
        /// <returns></returns>
        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<CLInfo_ZY>(responStr);1
 
                WheelSetMeasurement inf2o = XMLSerializationTool.DeserializeXmlToObject<WheelSetMeasurement>(responStr);
 
                if (inf2o.FLAG != "S") throw new Exception($"获取信息失败:接口返回失败:{inf2o.ERROR}");
                content.OK(data: inf2o);
            }
            catch (Exception ex)
            {
                content.Error("获取车轴信息失败.异常:" + ex.Message);
            }
            return content;
        }
    }
}