服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-08-27 1818a97f14836d85b4f3fa651f77de0394cd4371
Tiger.Business.MES/Transaction/Position.cs
@@ -63,7 +63,7 @@
        public List<WorkStep> Steps { get; set; } = new();
        public WorkStep CurStep { get; set; }
        public List<WorkStep> NextSteps { get; set; } = new();
        public bool IsFinishNodeSteps => !Steps.Any(q => q.Type == IWorkStep.Types.Node && !q.IsFinished);
        public bool IsFinishNodeSteps => !Steps.Any(q => q.NodeType == IWorkStep.NodeTypes.Node && !q.IsFinished);
        public bool IsFinishAllSteps => !Steps.Any() || !Steps.Any(q => !q.IsFinished);
        //public int CurStep => Steps.Where(q => !q.IsFinished).OrderBy(q => q.Sequence).FirstOrDefault()?.Sequence ?? 0;
        private DbClient CommitDB;
@@ -74,7 +74,7 @@
        protected Dictionary<string, 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; }
        //protected OperInfo CurOperInfo { get; set; }
        #endregion Propertys & Variables
        #region Functions
@@ -198,11 +198,13 @@
            {
                info.CurNode = CurWipSNs.First().NODE_NAME;
                info.NextNode = string.Join(",", CurBatch.GetNextNodes(CurWipSNs.First()).Select(q => q.NODE_NAME));
                info.StepsInfo = Steps.Select(q => q.GetInfo()).ToList();
            }
            else
            {
                info.CurNode = "   —   ";
                info.NextNode = "   —   ";
                info.StepsInfo = new();
            }
            return info;
        }
@@ -249,12 +251,13 @@
                }
                else
                {
                    var next = new WorkStep(IWorkStep.Types.Action, this)
                    var next = new WorkStep(IWorkStep.NodeTypes.Action, this)
                    {
                        Sequence = parent.Sequence + 1,
                        Node = parent.Node,
                        OperSetting = CurBatch.NodeSets.FirstOrDefault(q => q.NODE_ID == parent.Node.ID),
                        NodeAct = act,
                        Setting = CurBatch.ActionSets.FirstOrDefault(q => q.ACT_ID == act.ID),
                        ActSetting = CurBatch.ActionSets.FirstOrDefault(q => q.ACT_ID == act.ID),
                    };
                    next.Init();
                    next.PrepNodeIDs.Add(parent.NodeID);
@@ -505,6 +508,8 @@
                            {
                                case "GetCartonGenerate":
                                    return Biz.CodeRule[lv.BARCODE_RULE ?? ""]?.Generate($"{WorkBatch.Batch.BATCH_NO}-{WorkBatch.Batch.PLAN_QTY}-").Data.ToString() ?? "";
                                case "GetHW21SNGenerate":
                                    return Biz.CodeRule[lv.BARCODE_RULE ?? ""]?.Generate("SN:","05").Data.ToString() ?? "";
                                default:
                                    return "";
                            }