| | |
| | | /// </summary> |
| | | public partial class WorkStep : IWorkStep |
| | | { |
| | | public WorkStep(IWorkStep.Types type, IPosition position) |
| | | public WorkStep(IWorkStep.NodeTypes type, IPosition position) |
| | | { |
| | | Type = type; |
| | | NodeType = type; |
| | | CurPosition = position; |
| | | } |
| | | |
| | | #region Propertys & Variables |
| | | public string ID { get; set; } = Guid.NewGuid().ToString("N"); |
| | | |
| | | public IWorkStep.Types Type { get; set; } |
| | | public IWorkStep.NodeTypes NodeType { get; set; } |
| | | public MES_WO_NODE Node { get; set; } |
| | | public MES_WO_OPER OperSetting { get; set; } |
| | | public MES_WO_NODE_ACT NodeAct { get; set; } |
| | | public MES_WO_ACTION Setting { get; set; } |
| | | public MES_WO_ACTION ActSetting { get; set; } |
| | | public IPosition CurPosition { get; set; } |
| | | public IWorkAction CurAction { get; set; } |
| | | public int Sequence { get; set; } |
| | | public List<string> PrepNodeIDs { get; set; } = new(); |
| | | public string NodeID => Type == IWorkStep.Types.Action ? NodeAct.ID : Node.ID; |
| | | public string NodeID => NodeType == IWorkStep.NodeTypes.Action ? NodeAct.ID : Node.ID; |
| | | private bool _IsFinished = false; |
| | | public bool IsFinished |
| | | { |
| | | get => Type == IWorkStep.Types.Action ? CurAction.IsFinished : _IsFinished; |
| | | get => NodeType == IWorkStep.NodeTypes.Action ? CurAction.IsFinished : _IsFinished; |
| | | set { _IsFinished = value; } |
| | | } |
| | | public Action DBSubmitAction { get; set; } = () => { }; |
| | |
| | | { |
| | | CurAction = DI.Resolve(NodeAct.Definition.SERVICE_TYPE) as IWorkAction; |
| | | //CurAction = DI.Resolve("Tiger.IBusiness.IPrintLabel,Tiger.IBusiness") as IWorkAction; |
| | | CurAction.Init(this, CurPosition, NodeAct, Setting); |
| | | CurAction.Init(this, CurPosition, NodeAct, ActSetting); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | return CurAction.Submit(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 结束工步执行 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ApiAction<SubmitOutput> End() |
| | | { |
| | | return CurAction.End(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取当前工步的信息 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public WorkStepInfo GetInfo() |
| | | { |
| | | return new WorkStepInfo() { |
| | | ID = ID, |
| | | Sequence = Sequence, |
| | | NodeID = NodeID, |
| | | NodeType = NodeType.ToString(), |
| | | Node = Node, |
| | | OperSetting = OperSetting, |
| | | NodeAct = NodeAct, |
| | | ActSetting = ActSetting, |
| | | IsFinished = IsFinished, |
| | | }; |
| | | } |
| | | #endregion |
| | | |
| | | } |