kingno
2 天以前 bdbc8b1459c415f24c3a5da0d27a05e034f7ba08
src/Bro.M141.Process/MyMQTT.cs
@@ -15,6 +15,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZXing;
namespace Bro.M141.Process
{
@@ -167,12 +168,21 @@
            }
        }
        public async Task<string> MESForProduceAsync(ProductModel pro, string zwoid, int znonum, string endtray = "N", string line = "NQ216", int timeoutMs = 3000)
        public async Task<string> MESForProduceAsync(ProductModel pro, int znonum, string endtray = "N", string line = "NQ216", int timeoutMs = 3000)
        {
            var guid = Guid.NewGuid().ToString();
            var tcs = new TaskCompletionSource<string>(TaskCreationOptions.RunContinuationsAsynchronously);
            _pendingTask2[guid] = tcs;
            string zresult = "OK";
            if (string.IsNullOrWhiteSpace(pro.Result))
            {
                zresult = "NG";
            }
            else if (!"OK".Equals(pro.Result))
            {
                zresult = "NG";
            }
            var msgObj = new AutoLineMacBarcodeQueue
            {
@@ -180,10 +190,10 @@
                zdate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff"),
                zline = line,
                zbarcode = pro.SN,
                zresult = string.IsNullOrWhiteSpace(pro.Result) ? "NG" : pro.Result,
                zresult = zresult,
                zreson = pro.Result == "OK" ? "" : "SZ2014",
                zno = znonum.ToString(),
                zwoid = zwoid,
                zwoid = pro.Zword,
                endtray = endtray
            };