| | |
| | | |
| | | using iWare.Wms.Core; |
| | | using iWare_SCADA_Model; |
| | | using log4net; |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 监控上线 |
| | | /// 监控点位 |
| | | /// </summary> |
| | | /// <param name="value"></param> |
| | | /// <returns></returns> |
| | | public static void MonitorTestForLine(DataCaptureConfig _dataCaptureConfig, object value, List<DataCaptureColumnConfig> colConfig, WorkPieceLog wplog) |
| | | public static void MonitorTestForLine(DataCaptureConfig _dataCaptureConfig, object value, List<DataCaptureColumnConfig> colConfig, string workPieceID) |
| | | { |
| | | Task.Run(() => |
| | | { |
| | |
| | | var str = ""; |
| | | |
| | | |
| | | str += $",上线获取二维码值 ,值是{wplog.WorkPieceID.ToString()}"; |
| | | str += $",获取二维码值 ,值是{workPieceID}"; |
| | | //str += $",整体对象 wplog是{JsonConvert.SerializeObject(wplog)}"; |
| | | |
| | | Log4NetHelper.WriteInfoLog(_LogType, str); |
| | | |
| | | //不正常的码写入数据库 |
| | | var isRight = SystemBussinessHelper.ValidateIsRightWorkPieceID(workPieceID); |
| | | PieceLogTypeEnum pieceLogTypeEnum = PieceLogTypeEnum.正常; |
| | | if (isRight == false) |
| | | { |
| | | pieceLogTypeEnum = PieceLogTypeEnum.读码值异常; |
| | | } |
| | | WorkPieceLog workPieceLog = new WorkPieceLog() |
| | | { |
| | | Id = Yitter.IdGenerator.YitIdHelper.NextId(), |
| | | WorkPieceID = workPieceID, |
| | | WorkingProcedure = _dataCaptureConfig.WorkingProcedure, |
| | | CreatedTime = DateTime.Now, |
| | | CreatedUserName = _dataCaptureConfig.DataCapturePointCode, |
| | | MyRemarks = "", |
| | | Remarks = pieceLogTypeEnum.ToString(), |
| | | PieceLogType = (int)pieceLogTypeEnum, |
| | | PieceLogTypeName = pieceLogTypeEnum.ToString() |
| | | }; |
| | | using (DbModel db = new DbModel()) |
| | | { |
| | | db.WorkPieceLog.Add(workPieceLog); |
| | | db.SaveChanges(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |