服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-11-20 a96b665105c57a4ae67d286b2bb6897988ca590e
Tiger.Business.MES/WorkAction/PrintInStoreLabel.cs
@@ -25,6 +25,7 @@
        #endregion
        public BAS_LABEL_TEMP Label { get; set; }
        public List<BAS_LABEL_PV> LabelPV { get; set; }
        public WipPkg CurPkg { get; set; }
        public bool NoNeedInStorePrint { get; set; }
        #endregion Propertys & Variables
@@ -67,6 +68,7 @@
        public ApiAction<SubmitOutput> TryBegin(SubmitInput input)
        {
            var action = new ApiAction<SubmitOutput>(new SubmitOutput());
            CurPkg = CurPosition.Context.ContainsKey("CurPackage") ? CurPosition.Context["CurPackage"] as WipPkg : null;
            if (Label.IsNullOrEmpty())
            {
@@ -76,13 +78,14 @@
            {
               //设置打印变量值
               Label = CurPosition.SetLabelVariables(LabelPV, Label, this);
               if (CurPosition.Context.ContainsKey("CurPackage"))
               if (!CurPkg.IsNullOrEmpty())
               {
                   (CurPosition.Context["CurPackage"] as WipPkg).InStoreLabel = Label;
                    CurPkg.InStoreActID = NodeAct.ID;
                    CurPkg.InStoreLabel = Label;
               }
   
               //判断是否需要打印入库标签
               NoNeedInStorePrint = (!CurPosition.Context.ContainsKey("CurPackage") || !(CurPosition.Context["CurPackage"] as WipPkg).IsFinished)
               NoNeedInStorePrint = (CurPkg.IsNullOrEmpty() || !CurPkg.IsFinished)
                                       || (CurPosition is YadaPacking && (CurPosition as YadaPacking).IsPrintCustomerLabel);
               if (NoNeedInStorePrint)
               {
@@ -176,8 +179,10 @@
                    PRD_CODE = wipSn.PRD_CODE,
                    ACT_TYPE = NodeAct.ACT_TYPE,
                    ACT_SN = wipSn.SN,
                    ACT_VALUE_1 = Label?.LABEL_CODE,
                    ACT_VALUE_2 = Label?.ToJson(),
                    ACT_VALUE_1 = CurPkg?.IsFinished == true ? "Y" : "N",
                    ACT_VALUE_2 = CurPkg?.ToJson(),
                    ACT_VALUE_3 = Label?.ToJson(),
                    ACT_VALUE_4 = "InStore",
                    ACT_RESULT = "Y",
                    ELAPSED_TIME = CurStep.GetElapsedTime().TotalMilliseconds.ToInt64(),
                    TRACE_INFO = NoNeedInStorePrint ? $"无需打印入库标签" : $"标签{Label?.LABEL_NAME}[{Label?.LABEL_CODE}]打印成功",