刘磊
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
using Masuit.Tools;
using Newtonsoft.Json;
using OfficeOpenXml.Drawing.Chart;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA.Common;
using WIDESEA_Common;
using WIDESEA_Common.ZY;
using WIDESEA_Core;
using WIDESEA_Core.Enums;
using WIDESEA_Model.Models;
 
namespace WIDESEA_StoragIntegrationServices
{
    public partial class ToCheckService
    {
        public WebResponseContent GetCheckInfo(object jsondata)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                //RequsetMsg requsetMsg = JsonConvert.DeserializeObject<RequsetMsg>(jsondata.ToString());
 
                //string cltm = requsetMsg.CLTM;
                //if (string.IsNullOrEmpty(cltm)) throw new Exception("请求车轮号不能为空");
 
                Dt_Task task = _taskRepository.QueryFirst(x => /*x.PalletCode == cltm &&*/ x.TaskState == (int)TaskOutStatusEnum.Lien_Check);
 
                if (task == null) throw new Exception("未查询到任务");
 
                if (!string.IsNullOrEmpty(task.task_bak1))
                {
                    CheckInfo checkInfo = JsonConvert.DeserializeObject<CheckInfo>(task.task_bak1);
 
                    LogFactory.GetLog("测量设备获取轮盘数据").Info(true, $"\r\r--------------------------------------");
                    LogFactory.GetLog("测量设备获取轮盘数据").Info(true, checkInfo.ToJsonString());
 
                    return content.OK(data: checkInfo);
                }
                else
                {
                    string ipaddress = ZY_Interface + "/getCLInfostring";
 
                    CLInfo Info = new CLInfo { cltm = task.PalletCode };
 
                    var dic = Info.ToDictionary();
 
                    var responStr = HttpsClient.PostXml(ipaddress, dic);
 
                    //CLInfo_ZY info = JsonConvert.DeserializeObject<CLInfo_ZY>(responStr);
 
                    CLInfo_ZY inf2o = XMLSerializationTool.DeserializeXmlToObject<CLInfo_ZY>(responStr);
 
                    if (inf2o.FLAG != "S") throw new Exception($"智粤接口返回失败:{inf2o.ERROR}");
 
                    //CheckInfo checkInfo = new CheckInfo()
                    //{
                    //    CarType = "CR400AF",
                    //    MTType = "M",
                    //    CheckType = "1",
                    //    HubLevel = "等级1",
                    //    CLTM = task.PalletCode,
                    //    IsCheck = true,
                    //    Standards = "1"
                    //};
                    string checkType = "";
 
                    if (task.TaskType == (int)TaskOutboundTypeEnum.OutWheels)
                    {
                        if (task.wheels_mttype == "M")
                            checkType = "1";
                        else
                            checkType = "2";
                    }
                    else if (task.TaskType == (int)TaskOutboundTypeEnum.OutBrake)
                    {
                        checkType = "3";
                    }
 
 
                    CheckInfo checkInfo = new CheckInfo()
                    {
                        CarType = inf2o.CHEXING,
                        MTType = inf2o.MTTYPE,
                        CheckType = checkType,
                        HubLevel = inf2o.GKDJ,
                        CLTM = task.PalletCode,
                        IsCheck = task.IsCheck,
                        Standards = inf2o.NEWOLD
                    };
                    LogFactory.GetLog("测量设备获取轮盘数据").Info(true, $"\r\r--------------------------------------");
                    LogFactory.GetLog("测量设备获取轮盘数据").Info(true, checkInfo.ToJsonString());
                    return content.OK(data: checkInfo);
                }
            }
            catch (Exception ex)
            {
                LogFactory.GetLog("测量设备获取轮盘数据").Info(true, $"\r\r--------------------------------------");
                LogFactory.GetLog("测量设备获取轮盘数据").Info(true, ex.Message);
                return content.Error($"获取测量信息失败:{ex.Message}");
            }
        }
 
        //private string GetCheckType(TaskOutboundTypeEnum tasktype, string mtType)
        //{
        //    switch (TaskOutboundTypeEnum)
        //    {
        //        case
        //            TaskOutboundTypeEnum.OutWheels:
        //        default:
        //            break;
        //    }
        //}
    }
}