服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-08-16 eec9f268552af1d0ce8c95312930770669f1cc18
增加客户端需要的工序信息和短消息
已修改14个文件
339 ■■■■ 文件已修改
Tiger.Api/Language.db 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/Transaction/CollectNode.cs 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/Transaction/PackingNode.cs 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/Transaction/Position.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/Transaction/TestNode.cs 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/WorkAction/Assembly.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/WorkAction/IPQC.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/WorkAction/PackingAction.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/WorkAction/PrintLabel.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/WorkAction/Weighing.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/WorkAction/WipExtInfo.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business/MES/WoContext.cs 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Model.Net/Entitys/Api/Base.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Model.Net/Entitys/MES/ParameterEntity/PositionParameter.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Api/Language.db
Binary files differ
Tiger.Business.MES/Transaction/CollectNode.cs
@@ -47,7 +47,10 @@
                    if (!CurBatch.IsNullOrEmpty() && CurBatch.IsFirstNode(PostCode))
                    {
                        action = NodeSubmit(action, input);
                        return action;
                        //更新工序信息
                        var info = WoContext.GetSnOperInfo(input.SN).Data;
                        info.InputQty = OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty;
                        action.Data.OperInfo = info;
                    }
                    //当前岗位在当前工单不是首站,则查找条码已绑定的工单当作当前工单
                    else
@@ -60,10 +63,11 @@
                        {
                            if (wosns.First().Batch.ACT_LINE != CurLine.LINE_CODE)
                            {
                                action.Data.ShortMsg = new("产线错误", ShortMessage.Types.Error);
                                action.Data.OperInfo = new();
                                action.IsSuccessed = false;
                                //action.LocaleMsg = new($"条码[{0}]已在产线[{1}]投入生产,请在正确岗位扫描");
                                action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.NotCorrectLine", input.SN, wosns.First().Batch.ACT_LINE);
                                return action;
                            }
                            else
                            {
@@ -73,6 +77,8 @@
                                    var result = await SelectOrder(new() { AuthOption = input.AuthOption, OrderNo = wosns.First().Batch.ORDER_NO });
                                    if (!result.IsSuccessed)
                                    {
                                        action.Data.ShortMsg = new("工单异常", ShortMessage.Types.Error);
                                        action.Data.OperInfo = new();
                                        action.IsSuccessed = result.IsSuccessed;
                                        action.LocaleMsg = result.LocaleMsg;
                                        return action;
@@ -80,7 +86,7 @@
                                }
                                //条码过站
                                action = NodeSubmit(action, input);
                                return action;
                                action.Data.OperInfo = SetOperNodeInfo(OperInfoDic[CurBatch.Batch.BATCH_NO]);
                            }
                        }
                        //查找不到条码已绑定的工单
@@ -89,18 +95,20 @@
                            //没有当前工单,则先选择工单后再扫描条码
                            if (CurBatch.IsNullOrEmpty())
                            {
                                action.Data.ShortMsg = new("未选择工单", ShortMessage.Types.Error);
                                action.Data.OperInfo = new();
                                action.IsSuccessed = false;
                                //action.LocaleMsg = new($"未选择工单,请先选择要生产的工单");
                                action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.NotSelectOrderException");
                                return action;
                            }
                            //有当前工单且不是投入,则提示条码未投入生产,请先去首站扫描
                            else
                            {
                                action.Data.ShortMsg = new("未投入生产", ShortMessage.Types.Error);
                                action.Data.OperInfo = new();
                                action.IsSuccessed = false;
                                //action.LocaleMsg = new($"条码[{input.SN}]尚未投入生产,请先去首站扫描", input.SN);
                                action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.NotInputException", input.SN);
                                return action;
                            }
                        }
                    }
@@ -112,7 +120,7 @@
                    if (submitStep.IsNullOrEmpty())
                    {
                        action = BeginNextActionStep(input);
                        return action;
                        action.Data.OperInfo = OperInfoDic[CurBatch.Batch.BATCH_NO];
                    }
                    else
                    {
@@ -138,19 +146,28 @@
                        //如果所有工步都完成
                        if (IsFinishAllSteps)
                        {
                            return DoIfFinishAllSteps(result);
                            result = DoIfFinishAllSteps(result);
                        }
                        result.Data.OperInfo = OperInfoDic[CurBatch.Batch.BATCH_NO];
                        return result;
                    }
                }
                //没有可执行的工步
                else
                {
                    action.Data.ShortMsg = new("重置扫描", ShortMessage.Types.Error);
                    action.Data.OperInfo = OperInfoDic.ContainsKey(CurBatch?.Batch?.BATCH_NO ?? "") ? OperInfoDic[CurBatch.Batch.BATCH_NO] : new();
                ResetNode();
                action.IsSuccessed = false;
                //action.LocaleMsg = new($"岗位[{CurPosition.POST_CODE}]工步执行异常,请重新扫描产品条码", CurPosition.POST_CODE);
                action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.WorkStepException", CurPosition.POST_CODE);
            }
            }
            catch (Exception ex)
            {
                action.Data.ShortMsg = new("工序异常", ShortMessage.Types.Error);
                action.Data.OperInfo = OperInfoDic.ContainsKey(CurBatch?.Batch?.BATCH_NO ?? "") ? OperInfoDic[CurBatch.Batch.BATCH_NO] : new();
                ResetNode();
                //action.CatchExceptionWithLog(ex, $"采集工序:提交操作数据异常");
                action.CatchExceptionWithLog(ex, Biz.L("MES.Transaction.CollectNode.SubmitException"));
            }
@@ -172,9 +189,10 @@
                var woStatus = CurBatch.CheckCanProduce(curNode);
                if (!woStatus.IsSuccessed)
                {
                    woStatus.Data.ShortMsg = new("工单异常", ShortMessage.Types.Error);
                    return woStatus;
                }
                //非法过站防呆:进入工序时要增加判断条码是否按流程过站
                var wipSNs = Biz.Db.Queryable<MES_WIP_DATA>().IncludesAllFirstLayer().Where(q => (q.SN == input.SN || q.TRAY_SN == input.SN) && q.WORK_ORDER == CurBatch.WO.ORDER_NO).ToList();
                if (wipSNs.IsNullOrEmpty())
                {
@@ -195,9 +213,33 @@
                    };
                    wipSNs.Add(wipSN);
                }
                //如果条码不是当前工单或者产线的则报错
                if (wipSNs.Any(q => q.WORK_ORDER != CurBatch.WO.ORDER_NO || q.LINE_CODE != CurLine.LINE_CODE))
                {
                    if (wipSNs.First().LINE_CODE == CurLine.LINE_CODE)
                    {
                        action.Data.ShortMsg = new("工单错误", ShortMessage.Types.Error);
                        action.IsSuccessed = false;
                        //action.LocaleMsg = new($"产品[{CurSN}]不属于当前工单,请切换到工单[{wipSNs.First().WORK_ORDER}]后再扫描");
                        action.LocaleMsg = new("MES.Transaction.CollectNode.NodeSubmit.WoError", CurSN, wipSNs.First().WORK_ORDER);
                        return action;
                    }
                    else
                    {
                        action.Data.ShortMsg = new("产线错误", ShortMessage.Types.Error);
                        action.IsSuccessed = false;
                        //action.LocaleMsg = new($"产品[{CurSN}]已在产线[{wipSNs.First().LINE_CODE}]投产,请到产线[{wipSNs.First().LINE_CODE}]扫描");
                        action.LocaleMsg = new("MES.Transaction.CollectNode.NodeSubmit.LineError", CurSN, wipSNs.First().LINE_CODE);
                        return action;
                    }
                }
                //非法过站防呆:进入工序时要增加判断条码是否按流程过站
                var canGotoNext = CurBatch.CanGotoNext(input, wipSNs.First(), curNode);
                if (!canGotoNext.IsSuccessed)
                {
                    woStatus.Data.ShortMsg = new("进站错误", ShortMessage.Types.Error);
                    return canGotoNext;
                }
@@ -435,8 +477,8 @@
            }
            catch (Exception ex)
            {
                action.Data.ShortMsg = new("工步异常", ShortMessage.Types.Error);
                ResetNode();
                action.CatchExceptionWithLog(ex, $"采集工序:工序节点工步提交数据异常");
                //action.CatchExceptionWithLog(ex, $"{curNode.NODE_NAME}:工序节点工步提交数据异常,请检查工序节点设置");
                action.CatchExceptionWithLog(ex, Biz.L("MES.Transaction.CollectNode.NodeSubmitException", curNode.NODE_NAME));
            }
@@ -454,6 +496,8 @@
            SaveStepsCommitActionToDB();
            //保存成功,返回过站消息
            OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty += CurWipSNs.Count;
            action.Data.ShortMsg = new("过站成功", ShortMessage.Types.Success);
            //action.LocaleMsg = new($"工单[{CurWipSN.WORK_ORDER}]的条码[{CurWipSN.SN}]在岗位[{CurWipSN.POST_CODE}]工序[{CurWipSN.NODE_NAME}]过站成功,状态[{CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()}]");
            action.LocaleMsg = new("MES.Transaction.CollectNode.ScanSn.PassSuccess", CurWipSNs.First().WORK_ORDER, CurSN, CurWipSNs.First().POST_CODE, CurWipSNs.First().NODE_NAME,CurWipSNs.First().STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>());
            //重置工序
Tiger.Business.MES/Transaction/PackingNode.cs
@@ -55,9 +55,9 @@
                    //如果行为被标记成已完成,则重置工序
                    if (TempPkgAction.IsFinished)
                    {
                        action.Data.OperInfo = OperInfoDic.ContainsKey(CurBatch?.Batch?.BATCH_NO ?? "") ? OperInfoDic[CurBatch.Batch.BATCH_NO] : new();
                        ResetNode();
                    }
                    return action;
                }
                //NodeSubmit:产品过站,正常产品过站逻辑
                else
@@ -70,7 +70,10 @@
                        if (!CurBatch.IsNullOrEmpty() && CurBatch.IsFirstNode(PostCode))
                        {
                            action = NodeSubmit(action, input);
                            return action;
                            //更新工序信息
                            var info = WoContext.GetSnOperInfo(input.SN).Data;
                            info.InputQty = OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty;
                            action.Data.OperInfo = info;
                        }
                        //当前岗位在当前工单不是首站,则查找条码已绑定的工单当作当前工单
                        else
@@ -83,6 +86,8 @@
                            {
                                if (wosns.Count > 1 && wosns.Any(q => q.SN.TRAY_SN != q.SN.OUTER_SN))
                                {
                                    action.Data.ShortMsg = new("请扫描产品", ShortMessage.Types.Error);
                                    action.Data.OperInfo = new();
                                    action.IsSuccessed = false;
                                    action.LocaleMsg = new($"条码[{0}]是载具条码,请扫描载具中的产品条码继续包装操作");
                                    action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.OnlyMinPackage", input.SN);
@@ -90,10 +95,11 @@
                                }
                                if (wosns.First().Batch.ACT_LINE != CurLine.LINE_CODE)
                                {
                                    action.Data.ShortMsg = new("产线错误", ShortMessage.Types.Error);
                                    action.Data.OperInfo = new();
                                    action.IsSuccessed = false;
                                    //action.LocaleMsg = new($"条码[{0}]已在产线[{1}]投入生产,请在正确岗位扫描");
                                    action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.NotCorrectLine", input.SN, wosns.First().Batch.ACT_LINE);
                                    return action;
                                } 
                                else
                                {
@@ -103,6 +109,8 @@
                                        var result = await SelectOrder(new() { AuthOption = input.AuthOption, OrderNo = wosns.First().Batch.ORDER_NO });
                                        if (!result.IsSuccessed)
                                        {
                                            action.Data.ShortMsg = new("工单异常", ShortMessage.Types.Error);
                                            action.Data.OperInfo = new();
                                            action.IsSuccessed = result.IsSuccessed;
                                            action.LocaleMsg = result.LocaleMsg;
                                            return action;
@@ -110,7 +118,7 @@
                                    }
                                    //条码过站
                                    action = NodeSubmit(action, input);
                                    return action;
                                    action.Data.OperInfo = SetOperNodeInfo(OperInfoDic[CurBatch.Batch.BATCH_NO]);
                                }
                            }
                            //查找不到条码已绑定的工单
@@ -119,18 +127,20 @@
                                //没有当前工单,则先选择工单后再扫描条码
                                if (CurBatch.IsNullOrEmpty())
                                {
                                    action.Data.ShortMsg = new("未选择工单", ShortMessage.Types.Error);
                                    action.Data.OperInfo = new();
                                    action.IsSuccessed = false;
                                    //action.LocaleMsg = new($"未选择工单,请先选择要生产的工单");
                                    action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.NotSelectOrderException");
                                    return action;
                                }
                                //有当前工单且不是投入,则提示条码未投入生产,请先去首站扫描
                                else
                                {
                                    action.Data.ShortMsg = new("未投入生产", ShortMessage.Types.Error);
                                    action.Data.OperInfo = new();
                                    action.IsSuccessed = false;
                                    //action.LocaleMsg = new($"条码[{input.SN}]尚未投入生产,请先去首站扫描", input.SN);
                                    action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.NotInputException", input.SN);
                                    return action;
                                }
                            }
                        }
@@ -142,7 +152,7 @@
                        if (submitStep.IsNullOrEmpty())
                        {
                            action = BeginNextActionStep(input);
                            return action;
                            action.Data.OperInfo = OperInfoDic[CurBatch.Batch.BATCH_NO];
                        }
                        else
                        {
@@ -168,20 +178,28 @@
                            //如果所有工步都完成
                            if (IsFinishAllSteps)
                            {
                                return DoIfFinishAllSteps(result);
                                result = DoIfFinishAllSteps(result);
                            }
                            result.Data.OperInfo = OperInfoDic[CurBatch.Batch.BATCH_NO];
                            return result;
                        }
                    }
                    //没有可执行的工步
                    else
                    {
                        action.Data.ShortMsg = new("重置扫描", ShortMessage.Types.Error);
                        action.Data.OperInfo = OperInfoDic.ContainsKey(CurBatch?.Batch?.BATCH_NO ?? "") ? OperInfoDic[CurBatch.Batch.BATCH_NO] : new();
                    ResetNode();
                    action.IsSuccessed = false;
                    //action.LocaleMsg = new($"岗位[{CurPosition.POST_CODE}]工步执行异常,请重新扫描产品条码", CurPosition.POST_CODE);
                    action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.WorkStepException", CurPosition.POST_CODE);
                }
            }
            }
            catch (Exception ex)
            {
                action.Data.ShortMsg = new("工序异常", ShortMessage.Types.Error);
                action.Data.OperInfo = OperInfoDic.ContainsKey(CurBatch?.Batch?.BATCH_NO ?? "") ? OperInfoDic[CurBatch.Batch.BATCH_NO] : new();
                //action.CatchExceptionWithLog(ex, $"包装工序:提交操作数据异常");
                action.CatchExceptionWithLog(ex, Biz.L("MES.Transaction.PackingNode.SubmitException"));
            }
@@ -203,9 +221,10 @@
                var woStatus = CurBatch.CheckCanProduce(curNode);
                if (!woStatus.IsSuccessed)
                {
                    woStatus.Data.ShortMsg = new("工单异常", ShortMessage.Types.Error);
                    return woStatus;
                }
                //非法过站防呆:进入工序时要增加判断条码是否按流程过站
                var wipSNs = Biz.Db.Queryable<MES_WIP_DATA>().IncludesAllFirstLayer().Where(q => (q.SN == input.SN || q.TRAY_SN == input.SN) && q.WORK_ORDER == CurBatch.WO.ORDER_NO).ToList();
                if (wipSNs.IsNullOrEmpty())
                {
@@ -226,9 +245,33 @@
                    };
                    wipSNs.Add(wipSN);
                }
                //如果条码不是当前工单或者产线的则报错
                if (wipSNs.Any(q => q.WORK_ORDER != CurBatch.WO.ORDER_NO || q.LINE_CODE != CurLine.LINE_CODE))
                {
                    if (wipSNs.First().LINE_CODE == CurLine.LINE_CODE)
                    {
                        action.Data.ShortMsg = new("工单错误", ShortMessage.Types.Error);
                        action.IsSuccessed = false;
                        //action.LocaleMsg = new($"产品[{CurSN}]不属于当前工单,请切换到工单[{wipSNs.First().WORK_ORDER}]后再扫描");
                        action.LocaleMsg = new("MES.Transaction.PackingNode.NodeSubmit.WoError", CurSN, wipSNs.First().WORK_ORDER);
                        return action;
                    }
                    else
                    {
                        action.Data.ShortMsg = new("产线错误", ShortMessage.Types.Error);
                        action.IsSuccessed = false;
                        //action.LocaleMsg = new($"产品[{CurSN}]已在产线[{wipSNs.First().LINE_CODE}]投产,请到产线[{wipSNs.First().LINE_CODE}]扫描");
                        action.LocaleMsg = new("MES.Transaction.PackingNode.NodeSubmit.LineError", CurSN, wipSNs.First().LINE_CODE);
                        return action;
                    }
                }
                //非法过站防呆:进入工序时要增加判断条码是否按流程过站
                var canGotoNext = CurBatch.CanGotoNext(input, wipSNs.First(), curNode);
                if (!canGotoNext.IsSuccessed)
                {
                    woStatus.Data.ShortMsg = new("进站错误", ShortMessage.Types.Error);
                    return canGotoNext;
                }
@@ -466,6 +509,7 @@
            }
            catch (Exception ex)
            {
                action.Data.ShortMsg = new("工步异常", ShortMessage.Types.Error);
                ResetNode();
                //action.CatchExceptionWithLog(ex, $"{curNode.NODE_NAME}:工序节点工步提交数据异常,请检查工序节点设置");
                action.CatchExceptionWithLog(ex, Biz.L("MES.Transaction.PackingNode.NodeSubmitException", curNode.NODE_NAME));
@@ -484,13 +528,12 @@
            SaveStepsCommitActionToDB();
            //保存成功,返回过站消息
            OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty += CurWipSNs.Count;
            action.Data.ShortMsg = new("过站成功", ShortMessage.Types.Success);
            //action.LocaleMsg = new($"工单[{CurWipSN.WORK_ORDER}]的条码[{CurWipSN.SN}]在岗位[{CurWipSN.POST_CODE}]工序[{CurWipSN.NODE_NAME}]过站成功,状态[{CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()}]");
            action.LocaleMsg = new("MES.Transaction.CollectNode.ScanSn.PassSuccess", CurWipSNs.First().WORK_ORDER, CurSN, CurWipSNs.First().POST_CODE, CurWipSNs.First().NODE_NAME,CurWipSNs.First().STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>());
            //重置工序
            //if (!isClone)
            {
                ResetNode();
            }
            
            return action;
        }
Tiger.Business.MES/Transaction/Position.cs
@@ -56,7 +56,7 @@
        public WorkBatch CurBatch { get; set; }
        public IWorkBatch WorkBatch => CurBatch;
        public List<MES_WIP_DATA> CurWipSNs { get; set; } = new();
        public string CurSN => CurWipSNs.Any() ? (CurWipSNs.First().TRAY_SN.IsNullOrEmpty() ? CurWipSNs.First().SN : CurWipSNs.First().TRAY_SN) : "";
        public string CurSN => (CurWipSNs.Any() ? (CurWipSNs.First().TRAY_SN.IsNullOrEmpty() ? CurWipSNs.First().SN : CurWipSNs.First().TRAY_SN) : "");
        public List<MES_WIP_HIS> CurWipSNHiss { get; set; } = new();
        public List<MES_WIP_DFT> CurDefects { get; set; } = new();
        public Dictionary<string, object> Context { get; set; } = new();
@@ -73,7 +73,8 @@
        public bool NeedTemporaryStoreDBCommitAction { get; set; } = false;
        protected List<Action> DBCommitList { get; set; } = new();
        protected List<Position> NodeCommitList { get; set; } = new();
        protected Dictionary<string, OperInfo> OperInfoDic { get; set; } = new();
        protected OperInfo CurOperInfo { get; set; }
        #endregion Propertys & Variables
        #region Functions
@@ -125,6 +126,7 @@
                    WoContext.WoBatchDic.Add(wb.Batch.BATCH_NO, wb);
                }
                CurBatch = WoContext.GetBatch(input.OrderNo, CurLine.LINE_CODE);
                OperInfoDic.Add(CurBatch.Batch.BATCH_NO, new());
                action.Data = new { WorkOrder = CurBatch.WO, Bacth = CurBatch.Batch };
            }
            catch (Exception ex)
@@ -184,6 +186,24 @@
        }
        /// <summary>
        /// 设置当前条码的工序信息
        /// </summary>
        public OperInfo SetOperNodeInfo(OperInfo info)
        {
            if (CurWipSNs.Any())
            {
                info.CurNode = CurWipSNs.First().NODE_NAME;
                info.NextNode = string.Join(",", CurBatch.GetNextNodes(CurWipSNs.First()).Select(q => q.NODE_NAME));
            }
            else
            {
                info.CurNode = "   —   ";
                info.NextNode = "   —   ";
            }
            return info;
        }
        /// <summary>
        /// 生成传入工步后续的行为到工步列表
        /// </summary>
        /// <param name="parent"></param>
Tiger.Business.MES/Transaction/TestNode.cs
@@ -38,6 +38,7 @@
        public async Task<ApiAction<SubmitOutput>> Submit(SubmitInput input)
        {
            var action = new ApiAction<SubmitOutput>(new SubmitOutput());
            try
            {
                //工步列表为空或者工序节点工步有未完成时,优先完成工序节点工步
@@ -47,7 +48,10 @@
                    if (!CurBatch.IsNullOrEmpty() && CurBatch.IsFirstNode(PostCode))
                    {
                        action = NodeSubmit(action, input);
                        return action;
                        //更新工序信息
                        var info = WoContext.GetSnOperInfo(input.SN).Data;
                        info.InputQty = OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty;
                        action.Data.OperInfo = info;
                    }
                    //当前岗位在当前工单不是首站,则查找条码已绑定的工单当作当前工单
                    else
@@ -60,10 +64,11 @@
                        {
                            if (wosns.First().Batch.ACT_LINE != CurLine.LINE_CODE)
                            {
                                action.Data.ShortMsg = new("产线错误", ShortMessage.Types.Error);
                                action.Data.OperInfo = new();
                                action.IsSuccessed = false;
                                //action.LocaleMsg = new($"条码[{0}]已在产线[{1}]投入生产,请在正确岗位扫描");
                                action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.NotCorrectLine", input.SN, wosns.First().Batch.ACT_LINE);
                                return action;
                            }
                            else
                            {
@@ -73,6 +78,8 @@
                                    var result = await SelectOrder(new() { AuthOption = input.AuthOption, OrderNo = wosns.First().Batch.ORDER_NO });
                                    if (!result.IsSuccessed)
                                    {
                                        action.Data.ShortMsg = new("工单异常", ShortMessage.Types.Error);
                                        action.Data.OperInfo = new();
                                        action.IsSuccessed = result.IsSuccessed;
                                        action.LocaleMsg = result.LocaleMsg;
                                        return action;
@@ -80,7 +87,7 @@
                                }
                                //条码过站
                                action = NodeSubmit(action, input);
                                return action;
                                action.Data.OperInfo = SetOperNodeInfo(OperInfoDic[CurBatch.Batch.BATCH_NO]);
                            }
                        }
                        //查找不到条码已绑定的工单
@@ -89,31 +96,32 @@
                            //没有当前工单,则先选择工单后再扫描条码
                            if (CurBatch.IsNullOrEmpty())
                            {
                                action.Data.ShortMsg = new("未选择工单", ShortMessage.Types.Error);
                                action.Data.OperInfo = new();
                                action.IsSuccessed = false;
                                //action.LocaleMsg = new($"未选择工单,请先选择要生产的工单");
                                action.LocaleMsg = new("MES.Transaction.TestNode.Submit.NotSelectOrderException");
                                return action;
                            }
                            //有当前工单且不是投入,则提示条码未投入生产,请先去首站扫描
                            else
                            {
                                action.Data.ShortMsg = new("未投入生产", ShortMessage.Types.Error);
                                action.Data.OperInfo = new();
                                action.IsSuccessed = false;
                                //action.LocaleMsg = new($"条码[{input.SN}]尚未投入生产,请先去首站扫描", input.SN);
                                action.LocaleMsg = new("MES.Transaction.TestNode.Submit.NotInputException", input.SN);
                                return action;
                            }
                        }
                    }
                }
                //完成第一步,后开始执行当前工序的行为列表
                //完成工序节点工步后,后开始执行当前工序的行为工步
                //完成工序节点工步后,开始执行当前工序的行为工步
                else if (IsFinishNodeSteps && !IsFinishAllSteps)
                {
                    var submitStep = Steps.Where(q => q.ID == input.CurStepID && !q.IsFinished).FirstOrDefault();
                    if (submitStep.IsNullOrEmpty())
                    {
                        action = BeginNextActionStep(input);
                        return action;
                        action.Data.OperInfo = OperInfoDic[CurBatch.Batch.BATCH_NO];
                    }
                    else
                    {
@@ -139,19 +147,27 @@
                        //如果所有工步都完成
                        if (IsFinishAllSteps)
                        {
                            return DoIfFinishAllSteps(result);
                            result = DoIfFinishAllSteps(result);
                        }
                        result.Data.OperInfo = OperInfoDic[CurBatch.Batch.BATCH_NO];
                        return result;
                    }
                }
                //没有可执行的工步
                else
                {
                    action.Data.ShortMsg = new("重置扫描", ShortMessage.Types.Error);
                    action.Data.OperInfo = OperInfoDic.ContainsKey(CurBatch?.Batch?.BATCH_NO ?? "") ? OperInfoDic[CurBatch.Batch.BATCH_NO] : new();
                ResetNode();
                action.IsSuccessed = false;
                //action.LocaleMsg = new($"岗位[{CurPosition.POST_CODE}]工步执行异常,请重新扫描产品条码", CurPosition.POST_CODE);
                action.LocaleMsg = new("MES.Transaction.TestNode.Submit.WorkStepException", CurPosition.POST_CODE);
            }
            }
            catch (Exception ex)
            {
                action.Data.ShortMsg = new("工序异常", ShortMessage.Types.Error);
                action.Data.OperInfo = OperInfoDic.ContainsKey(CurBatch?.Batch?.BATCH_NO ?? "") ? OperInfoDic[CurBatch.Batch.BATCH_NO] : new();
                //action.CatchExceptionWithLog(ex, $"测试工序:提交操作数据异常");
                action.CatchExceptionWithLog(ex, Biz.L("MES.Transaction.TestNode.SubmitException"));
            }
@@ -173,9 +189,10 @@
                var woStatus = CurBatch.CheckCanProduce(curNode);
                if (!woStatus.IsSuccessed)
                {
                    woStatus.Data.ShortMsg = new("工单异常", ShortMessage.Types.Error);
                    return woStatus;
                }
                //非法过站防呆:进入工序时要增加判断条码是否按流程过站
                var wipSNs = Biz.Db.Queryable<MES_WIP_DATA>().IncludesAllFirstLayer().Where(q => (q.SN == input.SN || q.TRAY_SN == input.SN) && q.WORK_ORDER == CurBatch.WO.ORDER_NO).ToList();
                if (wipSNs.IsNullOrEmpty())
                {
@@ -196,9 +213,33 @@
                    };
                    wipSNs.Add(wipSN);
                }
                //如果条码不是当前工单或者产线的则报错
                if (wipSNs.Any(q => q.WORK_ORDER != CurBatch.WO.ORDER_NO || q.LINE_CODE != CurLine.LINE_CODE))
                {
                    if (wipSNs.First().LINE_CODE == CurLine.LINE_CODE)
                    {
                        action.Data.ShortMsg = new("工单错误", ShortMessage.Types.Error);
                        action.IsSuccessed = false;
                        //action.LocaleMsg = new($"产品[{CurSN}]不属于当前工单,请切换到工单[{wipSNs.First().WORK_ORDER}]后再扫描");
                        action.LocaleMsg = new("MES.Transaction.TestNode.NodeSubmit.WoError", CurSN, wipSNs.First().WORK_ORDER);
                        return action;
                    }
                    else
                    {
                        action.Data.ShortMsg = new("产线错误", ShortMessage.Types.Error);
                        action.IsSuccessed = false;
                        //action.LocaleMsg = new($"产品[{CurSN}]已在产线[{wipSNs.First().LINE_CODE}]投产,请到产线[{wipSNs.First().LINE_CODE}]扫描");
                        action.LocaleMsg = new("MES.Transaction.TestNode.NodeSubmit.LineError", CurSN, wipSNs.First().LINE_CODE);
                        return action;
                    }
                }
                //非法过站防呆:进入工序时要增加判断条码是否按流程过站
                var canGotoNext = CurBatch.CanGotoNext(input, wipSNs.First(), curNode);
                if (!canGotoNext.IsSuccessed)
                {
                    woStatus.Data.ShortMsg = new("进站错误", ShortMessage.Types.Error);
                    return canGotoNext;
                }
@@ -436,6 +477,7 @@
            }
            catch (Exception ex)
            {
                action.Data.ShortMsg = new("工步异常", ShortMessage.Types.Error);
                ResetNode();
                //action.CatchExceptionWithLog(ex, $"{curNode.NODE_NAME}:工序节点工步提交数据异常,请检查工序节点设置");
                action.CatchExceptionWithLog(ex, Biz.L("MES.Transaction.TestNode.NodeSubmitException", curNode.NODE_NAME));
@@ -454,6 +496,8 @@
            SaveStepsCommitActionToDB();
            //保存成功,返回过站消息
            OperInfoDic[CurBatch.Batch.BATCH_NO].InputQty += CurWipSNs.Count;
            action.Data.ShortMsg = new("过站成功", ShortMessage.Types.Success);
            //action.LocaleMsg = new($"工单[{CurWipSN.WORK_ORDER}]的条码[{CurWipSN.SN}]在岗位[{CurWipSN.POST_CODE}]工序[{CurWipSN.NODE_NAME}]过站成功,状态[{CurWipSN.STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>()}]");
            action.LocaleMsg = new("MES.Transaction.CollectNode.ScanSn.PassSuccess", CurWipSNs.First().WORK_ORDER, CurSN, CurWipSNs.First().POST_CODE, CurWipSNs.First().NODE_NAME, CurWipSNs.First().STATUS.GetEnumDesc<MES_WIP_DATA.STATUSs>());
            //重置工序
Tiger.Business.MES/WorkAction/Assembly.cs
@@ -113,6 +113,7 @@
            //如果返回成功则认为当前行为可以开始执行,否则返回失败
            action.IsSuccessed = false;
            action.Data.ShortMsg = new("等待上料", ShortMessage.Types.Normal);
            return action;
        }
@@ -238,6 +239,7 @@
                        }
                        action.IsSuccessed = true;
                        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;
Tiger.Business.MES/WorkAction/IPQC.cs
@@ -60,6 +60,7 @@
            //如果根据输入可以开始执行当前行为则标记为成功,否则失败
            action.IsSuccessed = false;
            action.Data.ShortMsg = new("打印开始", ShortMessage.Types.Success);
            return action;
        }
        /// <summary>
@@ -85,6 +86,7 @@
            //提交数据执行失败
            else
            {
                action.Data.ShortMsg = new("测试失败", ShortMessage.Types.Failed);
                action.IsSuccessed = false;
                //action.LocaleMsg = new($"执行失败");
                action.LocaleMsg = new("MES.WorkAction.IPQC.Fail");
@@ -163,7 +165,8 @@
            };
            IsFinished = true;
            action.LocaleMsg = new($"行为结束");
            action.Data.ShortMsg = new("测试完成", ShortMessage.Types.Success);
            action.LocaleMsg = new($"测试结束");
            //action.LocaleMsg = new("MES.WorkAction.IPQC.Finish");
            return action;
        }
Tiger.Business.MES/WorkAction/PackingAction.cs
@@ -175,6 +175,7 @@
                CurCmd = data;
                PrintTimes++;
                action.Data.Data = data;
                action.Data.ShortMsg = new("打印标签", ShortMessage.Types.Normal);
                //action.LocaleMsg = new Locale($"开始第{PrintTimes}次打印第{min.PKG_LEVEL}层包装[{min.PkgType.PKG_NAME}]的标签[{LabelDic[min.PKG_LEVEL]?.LABEL_CODE}: {LabelDic[min.PKG_LEVEL].LABEL_NAME}]");
                action.LocaleMsg = new Locale("MES.WorkAction.PackingAction.BeginPrint", PrintTimes, min.PKG_LEVEL, min.PkgType.PKG_NAME, LabelDic[min.PKG_LEVEL]?.LABEL_CODE, LabelDic[min.PKG_LEVEL].LABEL_NAME);
            }
@@ -203,6 +204,7 @@
                        if (!pInput.IsFinish || pInput.PkgSN.IsNullOrEmpty())
                        {
                            var dtl = PkgRule.Details.First(q => q.PKG_LEVEL == pInput.PkgLevel);
                            action.Data.ShortMsg = new("扫描错误", ShortMessage.Types.Error);
                            action.IsSuccessed = false;
                            //action.LocaleMsg = new($"条码扫描失败,请重新扫描第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签条码");
                            action.LocaleMsg = new("MES.WorkAction.PackingAction.ScanFail", dtl.PKG_LEVEL, dtl.PkgType.PKG_NAME);
@@ -212,6 +214,7 @@
                        if (GetPackageList(CurPkg.Item).Any(q => q.SN == pInput.PkgSN))
                        {
                            var dtl = PkgRule.Details.First(q => q.PKG_LEVEL == pInput.PkgLevel);
                            action.Data.ShortMsg = new("扫描错误", ShortMessage.Types.Error);
                            action.IsSuccessed = false;
                            //action.LocaleMsg = new($"条码[{pInput.PkgSN}]无需重复扫描,请扫描第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签条码");
                            action.LocaleMsg = new("MES.WorkAction.PackingAction.ScanRepeat", pInput.PkgSN, dtl.PKG_LEVEL, dtl.PkgType.PKG_NAME);
@@ -221,6 +224,10 @@
                        CurCmd = null;
                        PrintTimes = 0;
                        action = SavePkgData(input, action);
                        if (action.IsSuccessed)
                        {
                            action.Data.ShortMsg = new("扫描成功", ShortMessage.Types.Success);
                        }
                    }
                    break;
                //Print:打印,打印当前包装层级的标签
@@ -238,6 +245,7 @@
                            data.PkgLevel = dtl.PKG_LEVEL;
                            CurCmd = data;
                            action.Data.Data = data;
                            action.Data.ShortMsg = new("扫描标签", ShortMessage.Types.Normal);
                            //action.LocaleMsg = new($"请扫描第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签条码");
                            action.LocaleMsg = new("MES.WorkAction.PackingAction.PleaseScanLabel", dtl.PKG_LEVEL, dtl.PkgType.PKG_NAME);
                        } 
@@ -249,6 +257,7 @@
                            {
                                PrintTimes++;
                                action.Data.Data = CurCmd;
                                action.Data.ShortMsg = new("重新打印", ShortMessage.Types.Normal);
                                //action.LocaleMsg = new Locale($"开始{PrintTimes}次打印第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签[{LabelDic[dtl.PKG_LEVEL]?.LABEL_CODE}: {LabelDic[dtl.PKG_LEVEL].LABEL_NAME}]");
                                action.LocaleMsg = new Locale("MES.WorkAction.PackingAction.BeginPrint", PrintTimes, dtl.PKG_LEVEL, dtl.PkgType.PKG_NAME, LabelDic[dtl.PKG_LEVEL]?.LABEL_CODE, LabelDic[dtl.PKG_LEVEL].LABEL_NAME);
                            }
@@ -256,6 +265,7 @@
                            {
                                CurCmd = null;
                                PrintTimes = 0;
                                action.Data.ShortMsg = new("打印失败", ShortMessage.Types.Failed);
                                action.IsSuccessed = false;
                                //action.LocaleMsg = new($"尝试第{PrintTimes}次打印第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签[{LabelDic[dtl.PKG_LEVEL]?.LABEL_CODE}: {LabelDic[dtl.PKG_LEVEL].LABEL_NAME}]失败,工序已重置,请重新扫描进站产品条码");
                                action.LocaleMsg = new("MES.WorkAction.PackingAction.PrintFail3Times", PrintTimes, dtl.PKG_LEVEL, dtl.PkgType.PKG_NAME, LabelDic[dtl.PKG_LEVEL]?.LABEL_CODE, LabelDic[dtl.PKG_LEVEL].LABEL_NAME);
@@ -277,6 +287,7 @@
                            data.PkgLevel = CurPkgItem.PKG_LEVEL;
                            CurCmd = data;
                            action.Data.Data = data;
                            action.Data.ShortMsg = new("包装成功", ShortMessage.Types.Success);
                            //action.LocaleMsg = new($"请把包装[{CurPkgItem.Package.SN}]上称称重");
                            action.LocaleMsg = new("MES.WorkAction.PackingAction.PleaseWeighing", CurPkgItem.Package.SN);
                        }
@@ -301,6 +312,7 @@
                        else
                        {
                            action.IsSuccessed = false;
                            action.Data.ShortMsg = new("称重失败", ShortMessage.Types.Failed);
                            //action.LocaleMsg = new($"包装[{CurPkgItem.Package.SN}]称重数据异常,请重新上称称重");
                            action.LocaleMsg = new("MES.WorkAction.PackingAction.PleaseWeighingAgain", CurPkgItem.Package.SN);
                            return action;
@@ -331,6 +343,7 @@
                            data.PkgLevel = dtl.PKG_LEVEL;
                            CurCmd = data;
                            action.Data.Data = data;
                            action.Data.ShortMsg = new("扫描标签", ShortMessage.Types.Normal);
                            //action.LocaleMsg = new($"请扫描第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签条码");
                            action.LocaleMsg = new("MES.WorkAction.PackingAction.PleaseScanLabel", dtl.PKG_LEVEL, dtl.PkgType.PKG_NAME);
                        }
@@ -346,6 +359,7 @@
                            CurCmd = data;
                            PrintTimes++;
                            action.Data.Data = data;
                            action.Data.ShortMsg = new("打印标签", ShortMessage.Types.Normal);
                            //action.LocaleMsg = new Locale($"开始第{PrintTimes}次打印第{min.PKG_LEVEL}层包装[{min.PkgType.PKG_NAME}]的标签[{LabelDic[min.PKG_LEVEL]?.LABEL_CODE}: {LabelDic[min.PKG_LEVEL].LABEL_NAME}]");
                            action.LocaleMsg = new Locale("MES.WorkAction.PackingAction.BeginPrint", PrintTimes, dtl.PKG_LEVEL, dtl.PkgType.PKG_NAME, LabelDic[dtl.PKG_LEVEL]?.LABEL_CODE, LabelDic[dtl.PKG_LEVEL].LABEL_NAME);
                        }
@@ -522,6 +536,7 @@
                    //数据异常
                    else
                    {
                        action.Data.ShortMsg = new("包装错误", ShortMessage.Types.Error);
                        var pdtl = PkgRule.Details.First(q => q.PKG_LEVEL == pInput.PkgLevel);
                        action.IsSuccessed = false;
                        //action.LocaleMsg = new($"客户端提交的包装层级[{pdtl.PKG_LEVEL}]({pdtl.PkgType.PKG_NAME})数据不是正在处理的包装层级[{dtl.PKG_LEVEL}]({dtl.PkgType.PKG_NAME}),工序已重置,请重新扫描进站产品条码");
@@ -532,6 +547,7 @@
            }
            catch (System.Exception ex)
            {
                action.Data.ShortMsg = new("包装异常", ShortMessage.Types.Exception);
                var dtl = PkgRule.Details.First(q => q.PKG_LEVEL == pInput.PkgLevel);
                action.CatchExceptionWithLog(ex, $"包装行为:扫描第{dtl.PKG_LEVEL}层包装[{dtl.PkgType.PKG_NAME}]的标签条码[{input.SN}]后保存数据失败");
                action.IsSuccessed = false;
@@ -562,6 +578,7 @@
            data.PkgLevel = CurPkg.Item.PKG_LEVEL;
            CurCmd = data;
            action.Data.Data = data;
            action.Data.ShortMsg = new("保存包装数据", ShortMessage.Types.Normal);
            //action.LocaleMsg = new($"第{CurPkg.Item.PKG_LEVEL}层包装[{CurPkg.Item.PKG_NAME}]已经全部完成,保存包装数据");
            action.LocaleMsg = new("MES.WorkAction.PackingAction.PackageComplete", CurPkg.Item.PKG_LEVEL, CurPkg.Item.PKG_NAME);
@@ -685,8 +702,9 @@
            }
            IsFinished = true;
            action.LocaleMsg = new($"产品条码[{CurPosition.CurSN}]包装完成");
            action.LocaleMsg = new("MES.WorkAction.PackingAction.PackingSuccess", CurPosition.CurSN);
            action.Data.ShortMsg = new("包装完成", ShortMessage.Types.Success);
            action.LocaleMsg = new($"条码[{CurPkg.Item.Package.SN}]包装完成");
            action.LocaleMsg = new("MES.WorkAction.PackingAction.PackingSuccess", CurPkg.Item.Package.SN);
            return action;
        }
Tiger.Business.MES/WorkAction/PrintLabel.cs
@@ -69,6 +69,7 @@
            //如果返回成功则认为当前行为可以开始执行,否则返回失败
            action.IsSuccessed = true;
            action.Data.ShortMsg = new("打印开始", ShortMessage.Types.Success);
            return action;
        }
@@ -87,6 +88,7 @@
            //提交数据执行失败
            else
            {
                action.Data.ShortMsg = new("打印失败", ShortMessage.Types.Failed);
                action.IsSuccessed = false;
                //action.LocaleMsg = new($"标签{Label.LABEL_NAME}[{Label.LABEL_CODE}]打印失败", Label.LABEL_NAME);
                action.LocaleMsg = new("MES.WorkAction.PrintLabel.PrintFail", Label.LABEL_NAME, Label.LABEL_CODE);
@@ -161,6 +163,7 @@
            };
            IsFinished = true;
            action.Data.ShortMsg = new("打印完成", ShortMessage.Types.Success);
            //action.LocaleMsg = new($"标签{Label.LABEL_NAME}[{Label.LABEL_CODE}]打印成功", Label.LABEL_NAME);
            action.LocaleMsg = new("MES.WorkAction.PrintLabel.PrintSuccess", Label.LABEL_NAME, Label.LABEL_CODE);
            return action;
Tiger.Business.MES/WorkAction/Weighing.cs
@@ -84,6 +84,7 @@
            //如果返回成功则认为当前行为可以开始执行,否则返回失败
            action.IsSuccessed = true;
            action.Data.ShortMsg = new("称重开始", ShortMessage.Types.Success);
            return action;
        }
@@ -122,6 +123,7 @@
            }
            catch (System.Exception ex)
            {
                action.Data.ShortMsg = new("称重异常", ShortMessage.Types.Error);
                action.CatchExceptionWithLog(ex, $"称重行为:条码[{CurPosition.CurSN}]称重数据[{input?.Data.ToString()}]保存异常");
                action.LocaleMsg = new("MES.WorkAction.Weighing.SaveWeightInfoException", CurPosition.CurSN, input?.Data.ToString());
            }
@@ -191,6 +193,7 @@
            };
            IsFinished = true;
            action.Data.ShortMsg = new("称重完成", ShortMessage.Types.Success);
            //action.LocaleMsg = new($"条码[{CurPosition.CurSN}]称重数据[{CurPkg.WEIGHT} {CurPkg.WEIGHT_UNIT}]保存成功");
            action.LocaleMsg = new("MES.WorkAction.Weighing.SaveSuccess", CurPosition.CurSN, CurPkg.WEIGHT, CurPkg.WEIGHT_UNIT);
            return action;
Tiger.Business.MES/WorkAction/WipExtInfo.cs
@@ -83,6 +83,7 @@
            //如果返回成功则认为当前行为可以开始执行,否则返回失败
            action.IsSuccessed = true;
            action.Data.ShortMsg = new("绑定开始", ShortMessage.Types.Success);
            return action;
        }
@@ -115,12 +116,14 @@
                //验证扫描的条码是否SN的扩展信息的标签
                if (input.SN.IsNullOrEmpty())
                {
                    action.Data.ShortMsg = new("绑定失败", ShortMessage.Types.Failed);
                    action.IsSuccessed = isOK = false;
                    //action.LocaleMsg = new Locale($"错误:[{ExtInfo.FIELD_NAME}]标签条码不能为空,请重新扫描");
                    action.LocaleMsg = new Locale("MES.WorkAction.WipExtInfo.SnEmptyError", ExtInfo.FIELD_NAME);
                }
                if (CurPosition.CurWipSNs.Any(w => w.SN == input.SN))
                {
                    action.Data.ShortMsg = new("绑定失败", ShortMessage.Types.Failed);
                    action.IsSuccessed = isOK = false;
                    //action.LocaleMsg = new Locale($"错误:扫描到产品条码[{input.SN}],请重新扫描[{ExtInfo.FIELD_NAME}]标签条码");
                    action.LocaleMsg = new Locale("MES.WorkAction.WipExtInfo.ScanProdSnError", input.SN, ExtInfo.FIELD_NAME);
@@ -137,6 +140,7 @@
            }
            catch (System.Exception ex)
            {
                action.Data.ShortMsg = new("绑定异常", ShortMessage.Types.Exception);
                action.CatchExceptionWithLog(ex, $"扩展信息绑定行为:产品[{CurPosition.CurSN}]绑定[{ExtInfo.FIELD_NAME}]标签条码[{input.SN}]保存异常");
                action.IsSuccessed = false;
                //action.LocaleMsg = new($"产品[{CurPosition.CurWipSN.SN}]绑定[{ExtInfo.FIELD_NAME}]标签条码[{input.SN}]保存异常,工序已重置,请重新扫描进站产品条码");
@@ -210,6 +214,7 @@
            };
            IsFinished = true;
            action.Data.ShortMsg = new("绑定完成", ShortMessage.Types.Success);
            //action.LocaleMsg = new($"产品[{CurPosition.CurWipSN.SN}]绑定[{ExtInfo.FIELD_NAME}]标签条码[{CurWipExt.GetType().GetProperty($"FIELD_{ExtInfo.SEQ.ToString("00")}")?.GetValue(CurWipExt)?.ToString()}]保存成功");
            action.LocaleMsg = new("MES.WorkAction.WipExtInfo.SaveSuccess", CurPosition.CurSN, ExtInfo.FIELD_NAME, CurWipExt.GetType().GetProperty($"FIELD_{ExtInfo.SEQ.ToString("00")}")?.GetValue(CurWipExt)?.ToString());
            return action;
Tiger.Business/MES/WoContext.cs
@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.WebSockets;
using System.Text;
using System.Threading.Tasks;
using Tiger.IBusiness;
@@ -148,7 +149,71 @@
            catch (Exception ex)
            {
                //action.CatchExceptionWithLog(ex, $"获取条码[{sn}]的下一个工序节点列表异常");
                action.CatchExceptionWithLog(ex, Biz.L("MES.WoContext.GetSnNextNodesException"));
                action.CatchExceptionWithLog(ex, Biz.L("MES.WoContext.GetSnNextNodesException", sn));
            }
            return action;
        }
        /// <summary>
        /// 设置当前条码的工序信息
        /// </summary>
        public static ApiAction<OperInfo> GetSnOperInfo(string sn)
        {
            var action = new ApiAction<OperInfo>(new OperInfo());
            try
            {
                var wipSNs = Biz.Db.Queryable<MES_WIP_DATA>().IncludesAllFirstLayer().Where(q => (q.SN == sn || q.FLOW_SN == sn || q.TRAY_SN == sn || q.INNER_SN == sn || q.CARTON_SN == sn || q.PALLET_SN == sn)).ToList();
                if (wipSNs.IsNullOrEmpty())
                {
                    var woSNs = Biz.Db.Queryable<BIZ_MES_WO_SN>().Where(q => (q.SN == sn || q.TRAY_SN == sn || q.OUTER_SN == sn)).ToList();
                    //查找到条码已绑定的工单
                    if (!woSNs.IsNullOrEmpty())
                    {
                        foreach (var woSN in woSNs)
                        {
                            var wipSN = new MES_WIP_DATA()
                            {
                                SN = sn,
                                FLOW_SN = sn,
                                STATUS = MES_WIP_DATA.STATUSs.Init.GetValue(),
                                ITEM_CODE = woSN.ITEM_CODE,
                                WORK_ORDER = woSN.WORK_ORDER,
                                BATCH_NO = woSN.BATCH_NO,
                                HOLD_FLAG = "N",
                                FINISHED_FLAG = "N",
                                INV_FLAG = "N",
                                DFT_FLAG = "N",
                                DFT_COUNT = 0,
                            };
                            wipSNs.Add(wipSN);
                        }
                    }
                }
                if (wipSNs.IsNullOrEmpty())
                {
                    action.IsSuccessed = false;
                    //action.LocaleMsg = new($"找不到条码[{sn}]的生产信息", sn);
                    action.LocaleMsg = new("MES.WoContext.SnNotFound", sn);
                }
                else
                {
                    if (!WoBatchDic.Any(q => q.Value.WO.ORDER_NO == wipSNs.First().WORK_ORDER))
                    {
                        var wb = new WorkBatch(wipSNs.First().WORK_ORDER).Init("");
                        WoBatchDic.Add(wb.Batch.BATCH_NO, wb);
                    }
                    var wo = WoBatchDic.FirstOrDefault(q => q.Value.WO.ORDER_NO == wipSNs.First().WORK_ORDER).Value;
                    action.Data = new()
                    {
                        CurNode = wipSNs.First().NODE_NAME,
                        NextNode = string.Join(",", wo.GetNextNodes(wipSNs.First()).Select(q => q.NODE_NAME)),
                    };
                }
            }
            catch (Exception ex)
            {
                //action.CatchExceptionWithLog(ex, $"获取条码[{sn}]的工序信息异常");
                action.CatchExceptionWithLog(ex, Biz.L("MES.WoContext.GetSnOperInfoException", sn));
            }
            return action;
        }
Tiger.Model.Net/Entitys/Api/Base.cs
@@ -27,6 +27,12 @@
    public class ShortMessage
    {
        public ShortMessage(string msg, Types type)
        {
            Content = msg;
            Type = type;
        }
        public string Content { get; set; }
        public Types Type { get; set; }
Tiger.Model.Net/Entitys/MES/ParameterEntity/PositionParameter.cs
@@ -235,8 +235,8 @@
    /// </summary>
    public class OperInfo
    {
        public string NextNode { get; set; }
        public string CurNode { get; set; }
        public int InputQty { get; set; }
        public string NextNode { get; set; } = "   —   ";
        public string CurNode { get; set; } = "   —   ";
        public int InputQty { get; set; } = 0;
    }
}