刘磊
2025-04-19 823752496e2a4cdb6a1fb36227cd15b8b7135336
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
52
53
54
55
 
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
    {
        /// <summary>
        /// 上传测量数据至智粤
        /// </summary>
        /// <param name="">车轮</param>
        /// <returns></returns>
        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<Basic_ZY>(responStr);
 
                if (result.FLAG != "S") throw new Exception($"上传信息失败:智粤接口返回失败:{result.ERROR}");
 
                content.OK();
            }
            catch (Exception ex)
            {
                content.Error("上传测量信息失败,异常:" + ex.Message);
            }
            return content;
        }
    }
}