服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-08-16 eec9f268552af1d0ce8c95312930770669f1cc18
Tiger.Business.MES/WorkAction/Assembly.cs
@@ -113,6 +113,7 @@
            //如果返回成功则认为当前行为可以开始执行,否则返回失败
            action.IsSuccessed = false;
            action.Data.ShortMsg = new("等待上料", ShortMessage.Types.Normal);
            return action;
        }
@@ -238,7 +239,8 @@
                        }
                        action.IsSuccessed = true;
                       action.Data.Data = CurAssembly;
                        action.Data.ShortMsg = new("上料成功", ShortMessage.Types.Success);
                        action.Data.Data = CurAssembly;
                       //action.LocaleMsg = new Locale($"扫描物料[{item.ItemInfo.ITEM_NAME}({item.ItemInfo.ITEM_CODE})的条码[{input.SN}]成功,请继续上料");
                       action.LocaleMsg = new Locale("MES.WorkAction.Assembly.LoadSuccess", item.ItemInfo.ITEM_NAME, item.ItemInfo.ITEM_CODE);
@@ -252,11 +254,13 @@
                }
                //都没有物料验证通过,则返回错误信息
                action.IsSuccessed = false;
                action.Data.ShortMsg = new("上料失败", ShortMessage.Types.Failed);
                //action.LocaleMsg = new($"条码[{input.SN}]验证失败,不是以下物料的条码:{string.Join(",", CurAssembly.Items.Where(q => !q.IsFinished).Select(q => $"{q.ItemInfo.ITEM_NAME}({q.ItemInfo.ITEM_CODE})"))}");
                action.LocaleMsg = new("MES.WorkAction.Assembly.LoadFail", input.SN, string.Join(",", CurAssembly.Items.Where(q => !q.IsFinished).Select(q => $"{q.ItemInfo.ITEM_NAME}({q.ItemInfo.ITEM_CODE})")));
            }
            catch (System.Exception ex)
            {
                action.Data.ShortMsg = new("上料异常", ShortMessage.Types.Exception);
                action.CatchExceptionWithLog(ex, $"上料行为:验证条码[{input.SN}]并保存数据异常");
                action.IsSuccessed = false;
                //action.LocaleMsg = new($"验证条码[{input.SN}]并保存数据异常,工序已重置,请重新扫描进站产品条码");
@@ -336,6 +340,7 @@
            };
            IsFinished = true;
            action.Data.ShortMsg = new("上料完成", ShortMessage.Types.Success);
            //action.LocaleMsg = new($"以下物料上料完成:{string.Join(",", CurAssembly.Items.Select(q => $"{q.ItemInfo.ITEM_NAME}({q.ItemInfo.ITEM_CODE})"))}");
            action.LocaleMsg = new("MES.WorkAction.Assembly.LoadFinish", string.Join(",", CurAssembly.Items.Select(q => $"{q.ItemInfo.ITEM_NAME}({q.ItemInfo.ITEM_CODE})")));
            return action;