修改篮具上传超时时间,修改产品条码上传逻辑由一次性上传50片产品变成两片单独上传
2个文件已修改
28 ■■■■ 已修改文件
src/Bro.M141.Process/M141Process.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.M141.Process/MyMQTT.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.M141.Process/M141Process.cs
@@ -452,8 +452,6 @@
        }
        /// <summary>
        /// 网络预热
        /// </summary>
@@ -550,9 +548,7 @@
        Dictionary<string, List<int>> _positionCheckTimeDict = new Dictionary<string, List<int>>();
        Dictionary<string, List<string>> _positionSpecHeads = new Dictionary<string, List<string>>();
        volatile int uploadId = 0;
        public void NewProductIntoList(ProductModel p, bool isSaveDB)
        {
src/Bro.M141.Process/MyMQTT.cs
@@ -61,7 +61,6 @@
            _connection = _factory.CreateConnection();
            _sendChannel = _connection.CreateModel();
            if (channel == 0)
            {
                _receiveChannel1 = _connection.CreateModel();
@@ -159,7 +158,7 @@
        }
        int num = 0;
        public async Task<string> MESForBasketAsync(string ztype, string zlsn, string zlpn, string zstatus, string zversion, int timeoutMes = 30000)
        public async Task<string> MESForBasketAsync(string ztype, string zlsn, string zlpn, string zstatus, string zversion, int timeoutMes = 60000)
        {
            string keystr = ztype + "_" + zlsn + "_" + zlpn + "_" + zstatus;
@@ -168,29 +167,28 @@
            {
                CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Information, $"{keystr}匹配成功");
                num++;
                //var tem = MSGClasses.FirstOrDefault(u => u.key == keystr);
                var tem = MSGClasses.Where(u => u.key == "1" && !string.IsNullOrEmpty(u.receive)).ToList();
                //DateTime dt = DateTime.Now;
                var tem = MSGClasses.Where(u => u.key == keystr && !string.IsNullOrEmpty(u.receive)).ToList();
                if (num < 10)
                {
                    //while ((DateTime.Now - dt).TotalMilliseconds < timeoutMes)
                    //{
                    if (tem!=null)
                    {
                        if (tem.Count()>0)
                        {
                        if (!string.IsNullOrEmpty(tem[0].receive))
                        {
                            CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Information, $"RabbitMQ {keystr}二次接收 返回值正常 {tem[0].receive}");
                            return tem[0].receive;
                        }
                        Thread.Sleep(1000);
                    //}
                        }
                    }
                }
                else 
                {
                    num = 0;
                    CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Information, $"RabbitMQ超时处理次数超过十次");
                    //return null;
                }
                CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Information, $"RabbitMQ二次接收数据接收为空");
                //return null;
            }
            var guid = Guid.NewGuid().ToString();
@@ -215,7 +213,6 @@
            _sendChannel.BasicPublish("", "auto_line_mac_queue", null, body);
            var completed = await Task.WhenAny(tcs.Task, Task.Delay(timeoutMes));
            _pendingTask1.TryRemove(guid, out _);
            if (completed == tcs.Task)
@@ -272,8 +269,6 @@
            string zr = DefectCodeMap.TryGetValue(pro.Result, out var code) ? code : DefaultErrorCode;
            var msgObj = new AutoLineMacBarcodeQueue
            {
                zbguid = guid,
@@ -317,11 +312,8 @@
    public class MSGClass
    {
        public string key { get; set; }
        public string zguid { get; set; }
        public string receive { get; set; }
    }