123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- 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 UserType
- {
- [Description("指定用户")]
- Staff,
- [Description("指定部门")]
- Department,
- [Description("指定部门职位")]
- DepartmentPosition,
- [Description("指定操作处理人")]
- DoActionUser,
- [Description("绑定对象包含人员")]
- BindObjectProperty
- }
- #endregion
- public class LogicNode : ConditionTreeNode
- {
- public LogicSymbols operate { get; set; }
- }
-
- public class FieldNode : ConditionTreeNode
- {
- /// <summary>
- /// 字段名称
- /// </summary>
- public string FieldName { get; set; }
- /// <summary>
- /// 值
- /// </summary>
- public string Value { get; set; }
- /// <summary>
- /// 值类型
- /// </summary>
- public string ValueType { get; set; }
- /// <summary>
- /// 比较符号
- /// </summary>
- public ComparisonSymbol Operator { get; set; }
- /// <summary>
- /// 类型
- /// </summary>
- public FieldType FieldType { get; set; }
- }
-
- public class UserCondition
- {
- public UserType UserType { get; set; }
- public string Value { get; set; }
- }
- }
|