using Aborlen.Model; using FrameWork.Log; using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WorkStationBase; namespace Aborlen.WorkStation { public partial class WorkStation06 : StationBase { /// /// 扫描条码 /// /// /// /// public void BarCode(string stationCode, object value, DateTime triggerTime) { try { //读取产品型号 查询当前型号的最近订单 string barcode = value.ToString(); if (PresentOrder.xs_enable == 1) { if (barcode.Contains(PresentOrder.xs_rule)) { Barcode_Record = barcode; //已存在,更新上线时间 //写入扫描完成 Write(1080, (byte)1); //更新界面条码 //显示扫描条码 View.Barcodes.Where(p => p.PartCodeRule == PresentOrder.xs_rule).First().PartCode = barcode; //向前端发送更改 SendMsg.SendMsgToStation(StationInfo.StationCode, "Barcodes", View.Barcodes); SendMsg.SendMsgToStation(StationInfo.StationCode, "AlarmMsg", ""); } else { SendMsg.SendMsgToStation(StationInfo.StationCode, "AlarmMsg", "扫描条码错误。"); } } } catch (Exception ex) { LogHelper.WriteLog(LogHelper.GetMethodInfo(), ex); } } } }