服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-10-16 879014e6dcd2e3897eea4a7585fb7c87183d9ffd
增加行为禁用功能
已修改3个文件
26 ■■■■■ 文件已修改
Tiger.Api/Language.db 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Business.MES/Common/WorkStep.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.IBusiness/Common/IStep.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Tiger.Api/Language.db
Binary files differ
Tiger.Business.MES/Common/WorkStep.cs
@@ -41,6 +41,12 @@
        public int Sequence { get; set; }
        public List<string> PrepNodeIDs { get; set; } = new();
        public string NodeID => NodeType == IWorkStep.NodeTypes.Action ? NodeAct.ID : Node.ID;
        private bool _IsActive = true;
        public bool IsActive
        {
            get => NodeType == IWorkStep.NodeTypes.Action ? ActSetting.IS_ACTIVE == "Y" : _IsActive;
            set { _IsActive = value; }
        }
        private bool _IsFinished = false;
        public bool IsFinished
        {
@@ -79,7 +85,23 @@
        public ApiAction<SubmitOutput> TryBegin(SubmitInput input)
        {
            BeginAt = DateTime.Now;
            return CurAction.TryBegin(input);
            //工步行为启用则正常执行
            if (IsActive)
            {
                return CurAction.TryBegin(input);
            }
            //工步行为不启用,否则工步默认完成
            else
            {
                CurAction.IsFinished = true;
                var action = new ApiAction<SubmitOutput>(new SubmitOutput());
                this.Message = Biz.L($"行为未启用");
                this.Status = StepStatus.InActive;
                action.Data.ShortMsg = new($"行为未启用", ShortMessage.Types.Success);
                //action.LocaleMsg = new($"{0}行为未启用");
                action.LocaleMsg = new("MES.WorkAction.NotActive", NodeAct.ACT_NAME);
                return action;
            }
        }
        /// <summary>
Tiger.IBusiness/Common/IStep.cs
@@ -62,6 +62,8 @@
    public enum StepStatus
    {
        [Description("禁用")]
        InActive,
        [Description("正常")]
        Normal,
        [Description("成功")]