using MaterialTraceability.Common; using MaterialTraceability.Entity.DTO; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MaterialTraceability.Business { public class MesAlarmInfo { private List mesAlarms = new List(); public MesAlarmInfo() { #region 涂布 mesAlarms.Add(new mesAlarm() { code = 13900, type = 1, message = "膜卷号状态不在当工序活动中,需要手动点击开始" }); mesAlarms.Add(new mesAlarm() { code = 13871, type = 1, message = "调整数量不能为0" }); mesAlarms.Add(new mesAlarm() { code = 24328, type = 1, message = "膜卷号工序状态不对,请在车间作业控制报告中查询状态" }); mesAlarms.Add(new mesAlarm() { code = 24327, type = 1, message = "膜卷号已经完工" }); mesAlarms.Add(new mesAlarm() { code = 13920, type = 1, message = "未做物料消耗、未扣料" }); mesAlarms.Add(new mesAlarm() { code = 15246, type = 1, message = "没有收集数据" }); mesAlarms.Add(new mesAlarm() { code = 13921, type = 1, message = "膜卷号有NC,联系PQE判定" }); mesAlarms.Add(new mesAlarm() { code = 13140, type = 1, message = "未做物料消耗、未扣料确" }); mesAlarms.Add(new mesAlarm() { code = 13001, type = 1, message = "膜卷号状态不对,请在车间作业控制报告中查询状态" }); mesAlarms.Add(new mesAlarm() { code = 13437, type = 1, message = "上料点没有料,请重新加载上料点" }); #endregion #region 冷压 mesAlarms.Add(new mesAlarm() { code = 24044, type = 11, message = "请检查涂布来料膜卷号是否已经使用,冷压工位是否已账,RFID绑定的膜卷号是否正确" }); mesAlarms.Add(new mesAlarm() { code = 13147, type = 11, message = "MES配置需要改" }); mesAlarms.Add(new mesAlarm() { code = 15246, type = 11, message = "下料前请先收集数据" }); mesAlarms.Add(new mesAlarm() { code = 24337, type = 11, message = "冷压没过账,库位不对" }); mesAlarms.Add(new mesAlarm() { code = 24344, type = 11, message = "涂布没完工" }); mesAlarms.Add(new mesAlarm() { code = 24325, type = 11, message = "上传的SFC格式不正确" }); mesAlarms.Add(new mesAlarm() { code = 24349, type = 11, message = "膜卷号没绑定RFID" }); mesAlarms.Add(new mesAlarm() { code = 13043, type = 11, message = "工单超产需要更换工单" }); mesAlarms.Add(new mesAlarm() { code = 21357, type = 11, message = "传参问题" }); mesAlarms.Add(new mesAlarm() { code = 13033, type = 11, message = "首件超时被锁机、上料点没激活" }); mesAlarms.Add(new mesAlarm() { code = 13920, type = 11, message = "未装配物料" }); #endregion } public string GetMesAlarmInfo(int code,string message) { AppConfigDto appConfig = AppConfigDto.Instance; int type = appConfig.machineId; if(mesAlarms.Count == 0) { return "日志为空"; } mesAlarm info = mesAlarms.Where(x => x.code == code && x.type == type).FirstOrDefault(); if (info == null) { return message; } string logMessage = String.Format("报错代码:{0};" + info.code + "报错内容:{1}", info.code, info.message); return logMessage; } } public class mesAlarm { public int code { get; set; } public int type { get; set; } public string message { get; set; } } }