using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace wispro.sp.entity.workflowDefine { public class ConditionExpress { public ConditionTreeNode Root { get; set; } public void AddCondition(ConditionExpress express ,LogicSymbols logic) { if(express.Root != null) { if (Root != null) { ConditionTreeNode node = new LogicNode() { operate = logic }; node.Left = Root; node.Right = express.Root; Root = node; } else { Root = express.Root; } } } } public class ConditionTreeNode { public ConditionTreeNode Right { get; set; } public ConditionTreeNode Left { get; set; } } #region 枚举类型 public enum LogicSymbols { AND, OR, NOT } public enum ComparisonSymbol { [Description("包含")] Contains, [Description("等于")] Equal, [Description("大于")] Greater, [Description("大于等于")] GreaterEqual, [Description("小于")] Less, [Description("小于等于")] LessEqual, [Description("不等于")] NotEqual, //[Description("不等于")] //In, //[Description("不等于")] //Between, [Description("开头为")] StartsWith, [Description("结尾为")] EndWith, [Description("不包含")] NotContains } public enum FieldType { [Description("用户输入值")] ActionInputValue, [Description("用户操作")] DoAction, [Description("绑定对象属性值")] BindObjectProperty, [Description("流程操作用户")] DoActionUser } public enum UserConditionType { [Description("指定个人")] Staff, [Description("指定部门")] Department, [Description("指定部门职位")] DepartmentPosition, [Description("指定用户部门")] UserDepartment, [Description("指定用户部门职位")] UserDepartmentPosition } public enum UserType { [Description("指定用户")] Staff, [Description("登录用户")] LoginUser, [Description("流程对象人员属性")] BindObjectProperty, [Description("操作处理人")] DoActionUser } #endregion public class LogicNode : ConditionTreeNode { public LogicSymbols operate { get; set; } } public class FieldNode : ConditionTreeNode { /// /// 字段名称 /// public string FieldName { get; set; } /// /// 值 /// public string Value { get; set; } /// /// 值类型 /// public string ValueType { get; set; } /// /// 比较符号 /// public ComparisonSymbol Operator { get; set; } /// /// 类型 /// public FieldType FieldType { get; set; } } public class UserFieldNode : ConditionTreeNode { public UserField Field { get; set; } /// /// 比较符号 /// public ComparisonSymbol Operator { get; set; } /// /// 值 /// public string Value { get; set; } } public class UserField { /// /// 用户条件类型 /// public UserConditionType UserConditionType { get; set; } /// /// 指定用户类型 /// public UserType UserType { get; set; } /// /// 指定用户值 /// public string UserValue { get; set; } /// /// 指定部门值 /// public string Department { get; set; } /// /// 指定职位值 /// public string Positon { get; set; } } }