服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2025-01-09 454bd635d7e37aec7c48bb627129b519b4853ce6
Tiger.Business.MES/Transaction/PackingNode.cs
@@ -264,6 +264,8 @@
            {
                action.Data.ShortMsg = new("工序异常", ShortMessage.Types.Error);
                action.Data.OperInfo = CurOperInfo(input.Locale);
                RemoveCurSnFromCurPackage(Context.ContainsKey("CurPackage") ? (Context["CurPackage"] as WipPkg).Item : null);
                ResetNode();
                //action.CatchExceptionWithLog(ex, $"包装工序:提交操作数据异常");
                action.CatchExceptionWithLog(ex, Biz.L("MES.Transaction.PackingNode.SubmitException"));
            }
@@ -313,7 +315,6 @@
                            FLOW_SN = input.SN,
                            STATUS = MES_WIP_DATA.STATUSs.Init.GetValue(),
                            ITEM_CODE = CurBatch.WO.ITEM_CODE,
                            QTY = 1,
                            WORK_ORDER = CurBatch.Batch.ORDER_NO,
                            BATCH_NO = CurBatch.Batch.BATCH_NO,
                            FTY_CODE = CurFactory.FTY_CODE,
@@ -376,7 +377,6 @@
                                FLOW_SN = wipSN.SN,
                                TRAY_SN = wipSN.TRAY_SN,
                                STATUS = BIZ_MES_WO_SN.STATUSs.NotInput.GetValue(),
                                QTY = 1,
                            });
                        }
                    }
@@ -625,6 +625,7 @@
            catch (Exception ex)
            {
                action.Data.ShortMsg = new("工步异常", ShortMessage.Types.Error);
                RemoveCurSnFromCurPackage(Context.ContainsKey("CurPackage") ? (Context["CurPackage"] as WipPkg).Item : null);
                ResetNode();
                //action.CatchExceptionWithLog(ex, $"{curNode.NODE_NAME}:工序节点工步提交数据异常,请检查工序节点设置");
                action.CatchExceptionWithLog(ex, Biz.L("MES.Transaction.PackingNode.NodeSubmitException", curNode.NODE_NAME));
@@ -860,6 +861,26 @@
            NodeCmd = null;
        }
        public void RemoveCurSnFromCurPackage(WipPkgItem pkgItem)
        {
            if (!pkgItem.IsNullOrEmpty())
            {
                var delItem = pkgItem.Items.Where(q => CurWipSNs.Any(sn => q.WipSNs.ContainsKey(sn.ID))).ToList();
                if (delItem.Any())
                {
                    pkgItem.Items.RemoveAll(q => CurWipSNs.Any(sn => q.WipSNs.ContainsKey(sn.ID)));
                    pkgItem.IsFinished = false;
                }
                else
                {
                    foreach (var item in pkgItem.Items)
                    {
                        RemoveCurSnFromCurPackage(item);
                    }
                }
            }
        }
        public override bool Close(bool needSaveHistoryLog = false)
        {
            //needSaveHistoryLog = true;