服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-12-08 006c12987d7dc7c2081fbf6715ebea98b93fdca0
Tiger.Business.MES/WorkAction/PrintInStoreLabel.cs
@@ -17,6 +17,7 @@
    {
        #region Propertys & Variables
        #region 固定写法,工序中的必要信息
        public DbClient MainDB { get; set; }
        public bool IsFinished { get; set; } = false;
        public IWorkStep CurStep { get; set; }
        public IPosition CurPosition { get; set; }
@@ -37,15 +38,15 @@
        public void Init(IWorkStep curStep, IPosition position, MES_WO_NODE_ACT nodeAct, MES_WO_ACTION setting)
        {
            #region 固定写法,给默认变量赋值
            MainDB = position.MainDB;
            CurStep = curStep;
            CurPosition = position;
            NodeAct = nodeAct;
            Setting = setting;
            #endregion
            Label = Biz.Db.Queryable<BAS_LABEL_TEMP>().Where(q => q.LABEL_CODE == setting.LABEL_CODE).IncludesAllFirstLayer().First();
            LabelPV = Biz.Db.Queryable<BAS_LABEL_PV>().ToList();
            CurPkg = CurPosition.Context.ContainsKey("CurPackage") ? CurPosition.Context["CurPackage"] as WipPkg : null;
            Label = MainDB.Queryable<BAS_LABEL_TEMP>().Where(q => q.LABEL_CODE == setting.LABEL_CODE).IncludesAllFirstLayer().First();
            LabelPV = MainDB.Queryable<BAS_LABEL_PV>().ToList();
            CurStep.Message = Biz.L("等待标签打印");
            CurStep.Status = StepStatus.Normal;
@@ -69,6 +70,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())
            {
@@ -85,7 +87,7 @@
               }
   
               //判断是否需要打印入库标签
               NoNeedInStorePrint = (!CurPkg.IsNullOrEmpty() || !CurPkg.IsFinished)
               NoNeedInStorePrint = (CurPkg.IsNullOrEmpty() || !CurPkg.IsFinished)
                                       || (CurPosition is YadaPacking && (CurPosition as YadaPacking).IsPrintCustomerLabel);
               if (NoNeedInStorePrint)
               {
@@ -182,7 +184,7 @@
                    ACT_VALUE_1 = CurPkg?.IsFinished == true ? "Y" : "N",
                    ACT_VALUE_2 = CurPkg?.ToJson(),
                    ACT_VALUE_3 = Label?.ToJson(),
                    ACT_VALUE_4 = "InStroe",
                    ACT_VALUE_4 = "InStore",
                    ACT_RESULT = "Y",
                    ELAPSED_TIME = CurStep.GetElapsedTime().TotalMilliseconds.ToInt64(),
                    TRACE_INFO = NoNeedInStorePrint ? $"无需打印入库标签" : $"标签{Label?.LABEL_NAME}[{Label?.LABEL_CODE}]打印成功",