| | |
| | | }); |
| | | }); |
| | | |
| | | head = $"PID,条码,汇总检测结果,"; |
| | | head = $"时间,PID,栏具码,物料码,条码,汇总检测结果,"; |
| | | |
| | | positionList = new List<string>(); |
| | | Details = Details.OrderBy(u => u.PositionName).ToList(); |
| | |
| | | }); |
| | | }); |
| | | |
| | | string data = $"{PID},{SN},{Result},"; |
| | | //时间,PID,栏具码,物料码,条码,汇总检测结果,"; |
| | | string data = $"{DateTime.Now.ToString("yyyyMMddHHmmss")}T,{PID},{BasketCode},{SEQUENCE},{SN},{Result},"; |
| | | positionList.ForEach(pName => |
| | | { |
| | | var detail = Details.FirstOrDefault(u => $"{u.STATION_CODE}_{u.PositionName}" == pName); |
| | |
| | | }); |
| | | }); |
| | | |
| | | head = $"时间,PID,序号,条码,"; |
| | | head = $"时间,栏具码,PID,序号,条码,"; |
| | | |
| | | foreach (var d in positionDetail) |
| | | { |
| | |
| | | }); |
| | | }); |
| | | |
| | | string data = $"{DateTime.Now.ToString("HH:mm:ss.fff")}T,{PID},{SEQUENCE},{SN},"; |
| | | string data = $"{DateTime.Now.ToString("HH:mm:ss.fff")}T,{BasketCode},{PID},{SEQUENCE},{SN},"; |
| | | positionDetail.ForEach(detail => |
| | | { |
| | | if (!detail.IsDone) |
| | |
| | | |
| | | public string SN { get; set; } = "NOREAD"; |
| | | |
| | | |
| | | public string BasketCode { get; set; } = "NOREAD"; |
| | | |
| | | public string Result { get; set; } = ""; |
| | | |
| | | [NotMapped] |
| | |
| | | public ImageFormat ImageFormatOK { get; set; } = ImageFormat.Png; |
| | | |
| | | |
| | | |
| | | [Category("数据库配置")] |
| | | [Description("IP")] |
| | | [DisplayName("IP")] |
| | | public string IPforall { get; set; } = "192.168.44.122"; |
| | | |
| | | [Category("数据库配置")] |
| | | [Description("是否为终点设备")] |
| | | [DisplayName("是否为终点设备")] |
| | | public bool IsfinDevice { get; set; } = false; |
| | | |
| | | |
| | | |
| | | |
| | | [Category("栏具条码配置")] |
| | | [Description("当前栏具码")] |
| | | [DisplayName("当前栏具码")] |
| | | public string basketcode { get; set; } = "NoRead"; |
| | | |
| | | [Category("栏具条码配置")] |
| | | [Description("本站是否读取栏具码")] |
| | | [DisplayName("本站是否读取栏具码")] |
| | | public bool Isreadbasketcode { get; set; } = false; |
| | | |
| | | |
| | | //[Category("数据库配置")] |
| | | //[Description("是否为终点设备")] |
| | | //[DisplayName("是否为终点设备")] |
| | | //public bool IsfinDevice { get; set; } = false; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | public class WorkPositionSet : IComplexDisplay |
| | | { |
| | | [Category("plc地址")] |
| | | [Description("是否取图即完成")] |
| | | [DisplayName("是否取图即完成")] |
| | | public bool ispiccover { get; set; } = false; |
| | | |
| | | |
| | | [Category("plc地址")] |
| | | [Description("完成地址")] |
| | | [DisplayName("完成地址")] |
| | | public int plcover { get; set; } |
| | |
| | | _positionCheckTimeDict.Clear(); |
| | | _positionSpecHeads.Clear(); |
| | | |
| | | mysqlhelper.IniDBIP(M141Config.IPforall); |
| | | |
| | | if (ThHeartPlc == null) |
| | | { |
| | |
| | | |
| | | if (isSaveDB) |
| | | { |
| | | if (M141Config.Isreadbasketcode) |
| | | { |
| | | p.BasketCode = M141Config.basketcode; |
| | | } |
| | | else |
| | | { |
| | | p.BasketCode = mysqlhelper.Getbasketcode(p.SEQUENCE); |
| | | } |
| | | |
| | | mysqlhelper.NewProduct(p); |
| | | } |
| | | |
| | |
| | | p.PID = p.PID + "_" + sequence.Split('_')[sequence.Split('_').Length - 1]; |
| | | |
| | | p.Initial(M141Config.StationCode, M141Config.WorkPositionCollection.Where(u => u.IsEnabled).Select(u => u.PositionName).ToList()); |
| | | //LogAsync(DateTime.Now, EnumHelper.LogLevel.Warning, $"未能从数据库获取产品对象,使用临时新建产品对象"); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Warning, $"未能从数据库获取产品对象,使用临时新建产品对象"); |
| | | } |
| | | |
| | | NewProductIntoList(p, false); |
| | |
| | | try |
| | | { |
| | | ConcurrentDictionary<MeasureBind, IImageSet> imgSetDicts = new ConcurrentDictionary<MeasureBind, IImageSet>(); |
| | | var positionSet = M141Config.WorkPositionCollection.Where(u => u.IsEnabled).FirstOrDefault(u => u.TriggerValue == triggerDatas[0]); |
| | | |
| | | measureBinds.AsParallel().ForAll(b => |
| | | { |
| | |
| | | try |
| | | { |
| | | imgSetDicts[b] = CollectHImage(camera, b.SnapshotOpConfig); |
| | | if (positionSet.ispiccover) |
| | | { |
| | | Plc1.WriteSingleAddress(positionSet.plcover,1,out _); |
| | | } |
| | | } |
| | | catch (Exception ea) |
| | | { |
| | |
| | | plcresult.Add(isOK); |
| | | List<string> specHeads = new List<string>(); |
| | | string head = p.GetCSVHead(ref specHeads, positionName); |
| | | if (!_positionSpecHeads.ContainsKey(positionName)) |
| | | { |
| | | _positionSpecHeads[positionName] = specHeads; |
| | | } |
| | | |
| | | _positionSpecHeads[positionName] = specHeads; |
| | | |
| | | string data = p.GetCSVData(_positionSpecHeads[positionName], positionName); |
| | | CSVRecordAsync($"{positionName}_Record_{DateTime.Now.ToString("yyyyMMdd")}.csv", data, head); |
| | |
| | | //UpdatePositionResultToDB(detail); |
| | | var seqData = p.SEQUENCE.Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries).ToList(); |
| | | |
| | | |
| | | mysqlhelper.UpdateProduct(p); |
| | | if (positionSet.IsLastPosition) |
| | | { |
| | | UpdateProductResultAsync(p); |
| | | mysqlhelper.NewForAll(p, M141Config.StationCode); |
| | | if (M141Config.IsfinDevice) |
| | | { |
| | | SummaryAllprodata(p); |
| | | } |
| | | } |
| | | }); |
| | | ReplyPlcData(positionSet, plcresult); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public void SummaryAllprodata(ProductModel p) |
| | | { |
| | | _taskFactory.StartNew(() => |
| | | { |
| | | try |
| | | { |
| | | |
| | | ProductModel newp = new ProductModel(); |
| | | newp.SEQUENCE = p.SEQUENCE; |
| | | newp.PID = p.PID; |
| | | newp.BasketCode = p.BasketCode; |
| | | newp.Result = p.Result; |
| | | newp.SN = p.SN; |
| | | newp.Details.AddRange(p.Details); |
| | | |
| | | var plist = mysqlhelper.GetProductList(p.SEQUENCE); |
| | | |
| | | if (plist != null) |
| | | { |
| | | foreach (var item in plist) |
| | | { |
| | | newp.Details.AddRange(item.Details); |
| | | } |
| | | } |
| | | |
| | | List<string> specHeadListforall = new List<string>(); |
| | | List<string> positionListforall = new List<string>(); |
| | | string csvHeadforall = p.GetCSVHead(ref specHeadListforall, ref positionListforall); |
| | | CSVRecordAsync($"AllDeviceProductRecord.csv", p.GetCSVData(specHeadListforall, positionListforall), csvHeadforall); |
| | | |
| | | } |
| | | catch(Exception exx) |
| | | { |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Error, "AllDeviceProductRecord数据汇总异常 " + exx.ToString()); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | [ProcessMethod("", "ProductDataUpload", "产品数据汇总", InvokeType.TestInvoke)] |
| | | public ResponseMessage ProductDataUpload(IOperationConfig config, IDevice invokeDevice, IDevice sourceDevice) |
| | | { |
| | |
| | | |
| | | return msg; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | _taskFactory.StartNew(() => |
| | | { |
| | | if (string.IsNullOrWhiteSpace(_csvHead)) |
| | | { |
| | | _csvHead = p.GetCSVHead(ref _specHeadList, ref _positionList); |
| | | } |
| | | _csvHead = p.GetCSVHead(ref _specHeadList, ref _positionList); |
| | | CSVRecordAsync($"ProductRecord_{DateTime.Now.ToString("yyyyMMdd")}.csv", p.GetCSVData(_specHeadList, _positionList), _csvHead); |
| | | //_manager_P_Product.UpdateProductResult(p.ID, p.PID, p.SN, p.Result); |
| | | }); |
| | |
| | | using Bro.Common.Helper; |
| | | using Bro.Common.Interface; |
| | | using Bro.M135.Common; |
| | | using MySql.Data.MySqlClient; |
| | | using Newtonsoft.Json; |
| | |
| | | public class M141Process_Mysql |
| | | { |
| | | |
| | | string connStrAll = "server=127.0.0.1;port=3306;user id=root;password=123456;database=BroDB;charset=utf8"; |
| | | string connStrLocal = "server=127.0.0.1;port=3306;user id=root;password=123456;database=BroDB;charset=utf8"; |
| | | string connStrAll = "server=localhost;port=3306;user id=root;password=123456;database=BroDB;charset=utf8"; |
| | | string connStrLocal = "server=localhost;port=3306;user id=root;password=123456;database=BroDB;charset=utf8"; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"数据库操作异常 {e.ToString()}"); |
| | | CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"数据库操作异常 {sql} {e.ToString()}"); |
| | | } |
| | | con.Close(); |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"数据库查询异常 {e.ToString()}"); |
| | | CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"数据库查询异常 {str} {e.ToString()}"); |
| | | } |
| | | con.Close(); |
| | | return dt; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"数据库查询数据异常 {e.ToString()}"); |
| | | CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"数据库查询数据异常 {str} {e.ToString()}"); |
| | | } |
| | | |
| | | con.Close(); |
| | |
| | | { |
| | | try |
| | | { |
| | | string mysqlstr = $"insert into forlocal (pid,plcnum,sn,data,time) values('{pro.PID}','{pro.SEQUENCE}','{pro.SN}','{JsonConvert.SerializeObject(pro)}','{DateTime.Now.ToString("yyyyMMddHHmmss")}')"; |
| | | //保留数据库最新的1000条数据 |
| | | //string destr = "delete from forlocal where id not in (select id from (select id from forlocal order BY id desc limit 1000) as subquery)"; |
| | | //Operatoremysql(destr, connStrAll); |
| | | |
| | | string str1 = "select id from forlocal order by id desc limit 1"; |
| | | string index = selectmysql(str1, connStrLocal); |
| | | |
| | | string str2 = $"delete from forlocal where id < ({index}-1000)"; |
| | | Operatoremysql(str2, connStrLocal); |
| | | |
| | | |
| | | string mysqlstr = $"insert into forlocal (basketcode,pid,plcnum,sn,data,time) values('{pro.BasketCode}','{pro.PID}','{pro.SEQUENCE}','{pro.SN}','{JsonConvert.SerializeObject(pro)}','{DateTime.Now.ToString("yyyyMMddHHmmss")}')"; |
| | | |
| | | Operatoremysql(mysqlstr, connStrLocal); |
| | | } |
| | |
| | | |
| | | public void NewForAll(ProductModel pro, string devicestr) |
| | | { |
| | | try |
| | | Task.Run(() => |
| | | { |
| | | string mysqlstr = $"insert into forall (device,plcnum,sn,data,time) values('{devicestr}','{pro.SEQUENCE}','{pro.SN}','{JsonConvert.SerializeObject(pro)}','{DateTime.Now.ToString("yyyyMMddHHmmss")}')"; |
| | | try |
| | | { |
| | | |
| | | Operatoremysql(mysqlstr, connStrAll); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"数据库forall插入数据异常 {e.ToString()}"); |
| | | } |
| | | //保留数据库最新的1000条数据 |
| | | //string destr = "delete from forall where id not in (select id from (select id from forall order BY id desc limit 1000) as subquery)"; |
| | | //Operatoremysql(destr, connStrAll); |
| | | |
| | | string str1 = "select id from forall order by id desc limit 1"; |
| | | string index = selectmysql(str1, connStrAll); |
| | | |
| | | string str2 = $"delete from forall where id < ({index}-1000)"; |
| | | Operatoremysql(str2, connStrAll); |
| | | |
| | | |
| | | string mysqlstr = $"insert into forall (basketcode,device,plcnum,sn,data,time) values('{pro.BasketCode}','{devicestr}','{pro.SEQUENCE}','{pro.SN}','{JsonConvert.SerializeObject(pro)}','{DateTime.Now.ToString("yyyyMMddHHmmss")}')"; |
| | | |
| | | Operatoremysql(mysqlstr, connStrAll); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"数据库forall插入数据异常 {e.ToString()}"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | public ProductModel GetProduct(string plcnum) |
| | | { |
| | | try |
| | | { |
| | | string mysqlstr = $"select data from forlocal where plcnum='{plcnum}'"; |
| | | string str= selectmysql(mysqlstr, connStrLocal); |
| | | string mysqlstr = $"select data from forlocal where plcnum='{plcnum}' order by id desc limit 1"; |
| | | string str = selectmysql(mysqlstr, connStrLocal); |
| | | if (string.IsNullOrEmpty(str)) |
| | | { |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | ProductModel p = JsonConvert.DeserializeObject<ProductModel>(str); |
| | | ProductModel p = JsonConvert.DeserializeObject<ProductModel>(str, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All }); |
| | | return p; |
| | | } |
| | | } |
| | |
| | | return null; |
| | | } |
| | | |
| | | public string Getbasketcode(string plcnum) |
| | | { |
| | | try |
| | | { |
| | | string mysqlstr = $"select basketcode from forall where plcnum='{plcnum}' && device='S2' order by id desc limit 1"; |
| | | string str = selectmysql(mysqlstr, connStrAll); |
| | | if (!string.IsNullOrEmpty(str)) |
| | | { |
| | | return str; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"数据库forlocal更新数据异常 {e.ToString()}"); |
| | | } |
| | | return "NoRead"; |
| | | } |
| | | |
| | | |
| | | public List<ProductModel> GetProductList(string plcnum) |
| | | { |
| | | try |
| | | { |
| | | string mysqlstr = $"select data from forall where plcnum='{plcnum}'"; |
| | | var dt = selectdt(mysqlstr, connStrAll); |
| | | if (dt == null) |
| | | { |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | List<ProductModel> plist = new List<ProductModel>(); |
| | | for (int i = 0; i < dt.Rows.Count; i++) |
| | | { |
| | | ProductModel p = JsonConvert.DeserializeObject<ProductModel>(dt.Rows[i][0].ToString(), new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All }); |
| | | |
| | | //JsonConvert.DeserializeObject<IProcessConfig>(_configBackupStr, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All }); |
| | | plist.Add(p); |
| | | } |
| | | return plist; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"数据库forall数据异常 {e.ToString()}"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | namespace Bro.M141.Process |
| | | { |
| | | [MenuNode("ProductStatus", "产品检测状态显示界面1", 1, EnumHelper.TopMenu.SystemInfo, MenuNodeType.Form)] |
| | | //[MenuNode("ProductStatus", "产品检测状态显示界面1", 1, EnumHelper.TopMenu.SystemInfo, MenuNodeType.Form)] |
| | | public partial class ProUI : MenuFormBase |
| | | |
| | | //public partial class ProUI : UserControl |
| | |
| | | |
| | | namespace Bro.M141.Process |
| | | { |
| | | [MenuNode("PrinterStatus", "打印机显示界面", 1, EnumHelper.TopMenu.SystemInfo, MenuNodeType.Form)] |
| | | [MenuNode("PrinterStatus", "打印机显示界面", 2, EnumHelper.TopMenu.SystemInfo, MenuNodeType.Form)] |
| | | public partial class UIPrinter : MenuFormBase |
| | | |
| | | //public partial class UIPrinter : UserControl |
| | | { |
| | | M141Config Config141 => Process.IConfig as M141Config; |
| | |
| | | #endregion |
| | | |
| | | AOI1Config ConfigAOI1 => Config as AOI1Config; |
| | | TcpClientWrapBase BarcodeScanner = null; |
| | | |
| | | |
| | | |
| | | public override void Open() |
| | | { |
| | | base.Open(); |
| | | BarcodeScanner = DeviceCollection.FirstOrDefault(u => u is TcpClientWrapBase) as TcpClientWrapBase; |
| | | |
| | | } |
| | | |
| | | [ProcessMethod("", "PositionCheck_P1", "工位1检测", InvokeType.TestInvoke)] |
| | | public ResponseMessage PositionCheck_P1(IOperationConfig config, IDevice invokeDevice, IDevice sourceDevice) |
| | | { |
| | | |
| | | var positionSet = M141Config.WorkPositionCollection.Where(u => u.IsEnabled).FirstOrDefault(u => u.TriggerValue == "1#"); |
| | | if (positionSet == null) |
| | | { |
| | |
| | | ResponseMessage msg = new ResponseMessage(); |
| | | if (config is IImageCheckOperationConfig opConfig) |
| | | { |
| | | var results = opConfig.Products.Select(u => |
| | | if (invokeDevice is TcpClientWrapBase BarcodeScanner) |
| | | { |
| | | DetectResult result = new DetectResult(); |
| | | result.PID = u.PID; |
| | | result.Specs = GetSpecListFromConfigSelection(opConfig.SpecCollection); |
| | | return result; |
| | | }).ToList(); |
| | | var results = opConfig.Products.Select(u => |
| | | { |
| | | DetectResult result = new DetectResult(); |
| | | result.PID = u.PID; |
| | | result.Specs = GetSpecListFromConfigSelection(opConfig.SpecCollection); |
| | | return result; |
| | | }).ToList(); |
| | | |
| | | msg.DataObj = results; |
| | | msg.DataObj = results; |
| | | |
| | | string barcode = BarcodeScannerCommunicate(); |
| | | string barcode = BarcodeScannerCommunicate(BarcodeScanner); |
| | | |
| | | List<double> ret = new List<double>(); |
| | | if ("NOREAD".Equals(barcode.ToUpper())) |
| | | { |
| | | ret.Add(999); |
| | | List<double> ret = new List<double>(); |
| | | if ("NOREAD".Equals(barcode.ToUpper())) |
| | | { |
| | | ret.Add(999); |
| | | } |
| | | else |
| | | { |
| | | ret.Add(1); |
| | | } |
| | | |
| | | FillSpecResults(results[0].PID, results[0].Specs, ret, opConfig.Products[0].SEQUENCE); |
| | | |
| | | |
| | | opConfig.Products[0].SN = barcode; |
| | | opConfig.Products[0].Details.ForEach(u => u.SN = barcode); |
| | | |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Action, $"产品{opConfig.Products[0].PID}条码获取为{barcode}"); |
| | | } |
| | | else |
| | | { |
| | | ret.Add(1); |
| | | } |
| | | |
| | | FillSpecResults(results[0].PID, results[0].Specs, ret, opConfig.Products[0].SEQUENCE); |
| | | |
| | | |
| | | opConfig.Products[0].SN = barcode; |
| | | opConfig.Products[0].Details.ForEach(u => u.SN = barcode); |
| | | |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Action, $"产品{opConfig.Products[0].PID}条码获取为{barcode}"); |
| | | |
| | | } |
| | | return msg; |
| | | } |
| | | |
| | | |
| | | [ProcessMethod("ImageCheck", "ReadBarcode2", "读栏具码", InvokeType.TestInvoke)] |
| | | public ResponseMessage ReadBarcode2(IOperationConfig config, IDevice invokeDevice, IDevice sourceDevice) |
| | | { |
| | | ResponseMessage msg = new ResponseMessage(); |
| | | |
| | | private string BarcodeScannerCommunicate() |
| | | if (invokeDevice is TcpClientWrapBase BarcodeScanner2) |
| | | { |
| | | string barcode = BarcodeScannerCommunicate(BarcodeScanner2); |
| | | if (string.IsNullOrEmpty(barcode) || "noread".Equals(barcode.ToLower())) |
| | | { |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"栏具码获取失败"); |
| | | Plc1.WriteSingleAddress(1524, 2, out _); |
| | | Plc1.WriteSingleAddress(1514, 1, out _); |
| | | } |
| | | else |
| | | { |
| | | Plc1.WriteSingleAddress(1524, 1, out _); |
| | | Plc1.WriteSingleAddress(1514, 1, out _); |
| | | ConfigAOI1.basketcode = barcode; |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Action, $"获取到栏具码为{barcode}"); |
| | | } |
| | | } |
| | | |
| | | return msg; |
| | | } |
| | | |
| | | |
| | | |
| | | private string BarcodeScannerCommunicate(TcpClientWrapBase client) |
| | | { |
| | | string barcode = ""; |
| | | |
| | | for (int i = 0; i < 3; i++) |
| | | { |
| | | if (BarcodeScanner.WriteAndRead("start", out string error, out barcode, true)) |
| | | if (client.WriteAndRead("start", out string error, out barcode, true)) |
| | | { |
| | | barcode = barcode.Trim(' ', '\r', '\n'); |
| | | if (CheckBarcodeValid(barcode)) |
| | | { |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"{BarcodeScanner.Name}扫码完成,反馈{barcode}"); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"{client.Name}扫码完成,反馈{barcode}"); |
| | | return barcode; |
| | | } |
| | | else |
| | | { |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"{BarcodeScanner.Name}第{i + 1}扫码完成,反馈{barcode},不是合法条码"); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"{client.Name}第{i + 1}扫码完成,反馈{barcode},不是合法条码"); |
| | | Thread.Sleep(200); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Error, $"{BarcodeScanner.Name}扫码失败,{error}"); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Error, $"{client.Name}扫码失败,{error}"); |
| | | break; |
| | | } |
| | | } |