添加项目文件。
This commit is contained in:
13
WaterCloud.Code/Flow/Flow.cs
Normal file
13
WaterCloud.Code/Flow/Flow.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WaterCloud.Code
|
||||
{
|
||||
public class Flow
|
||||
{
|
||||
public string title { get; set; }
|
||||
public int initNum { get; set; }
|
||||
public List<FlowLine> lines { get; set; }
|
||||
public List<FlowNode> nodes { get; set; }
|
||||
public List<FlowArea> areas { get; set; }
|
||||
}
|
||||
}
|
||||
18
WaterCloud.Code/Flow/FlowArea.cs
Normal file
18
WaterCloud.Code/Flow/FlowArea.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace WaterCloud.Code
|
||||
{
|
||||
public class FlowArea
|
||||
{
|
||||
public string id { get; set; }
|
||||
|
||||
public string name { get; set; }
|
||||
|
||||
public string color { get; set; }
|
||||
|
||||
public int left { get; set; }
|
||||
public int top { get; set; }
|
||||
|
||||
public int width { get; set; }
|
||||
public int height { get; set; }
|
||||
public bool alt { get; set; }
|
||||
}
|
||||
}
|
||||
272
WaterCloud.Code/Flow/FlowLine.cs
Normal file
272
WaterCloud.Code/Flow/FlowLine.cs
Normal file
@@ -0,0 +1,272 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace WaterCloud.Code
|
||||
{
|
||||
/// <summary>
|
||||
/// 流程连线
|
||||
/// </summary>
|
||||
public class FlowLine
|
||||
{
|
||||
public string id { get; set; }
|
||||
public string label { get; set; }
|
||||
public string type { get; set; }
|
||||
public string from { get; set; }
|
||||
public string to { get; set; }
|
||||
public string name { get; set; }
|
||||
public bool dash { get; set; }
|
||||
public double M { get; set; }
|
||||
public bool alt { get; set; }
|
||||
|
||||
/// <summary> 分支条件 </summary>
|
||||
public List<DataCompare> Compares { get; set; }
|
||||
|
||||
public bool Compare(JObject frmDataJson)
|
||||
{
|
||||
bool result = true;
|
||||
foreach (var compare in Compares)
|
||||
{
|
||||
compare.FieldName = compare.FieldName.ToLower();
|
||||
compare.Value = compare.Value.ToLower();
|
||||
decimal value = 0; //参考值
|
||||
decimal frmvalue = 0; //表单中填写的值
|
||||
if (compare.Operation != DataCompare.Equal && compare.Operation != DataCompare.NotEqual)
|
||||
{
|
||||
value = decimal.Parse(compare.Value);
|
||||
frmvalue = decimal.Parse(frmDataJson.GetValue(compare.FieldName.ToLower()).ToString()); //表单中填写的值
|
||||
}
|
||||
bool res = false;
|
||||
if (compare.Condition == "and")
|
||||
{
|
||||
switch (compare.Operation)
|
||||
{
|
||||
case DataCompare.Equal:
|
||||
result &= compare.Value == frmDataJson.GetValue(compare.FieldName).ToString();
|
||||
break;
|
||||
|
||||
case DataCompare.NotEqual:
|
||||
result &= compare.Value != frmDataJson.GetValue(compare.FieldName).ToString();
|
||||
break;
|
||||
|
||||
case DataCompare.Larger:
|
||||
result &= frmvalue > value;
|
||||
break;
|
||||
|
||||
case DataCompare.Less:
|
||||
result &= frmvalue < value;
|
||||
break;
|
||||
|
||||
case DataCompare.LargerEqual:
|
||||
result &= frmvalue <= value;
|
||||
break;
|
||||
|
||||
case DataCompare.LessEqual:
|
||||
result &= frmvalue <= value;
|
||||
break;
|
||||
|
||||
case DataCompare.In:
|
||||
if (compare.FieldName == "申请人" || compare.FieldName == "所属部门")
|
||||
{
|
||||
var arr = compare.Value.Split(',');
|
||||
foreach (var item in frmDataJson.GetValue(compare.FieldName).ToString().Split(','))
|
||||
{
|
||||
if (arr.Contains(item))
|
||||
{
|
||||
res = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
result &= res;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
var arr = compare.Value.Split(',');
|
||||
if (arr.Contains(frmvalue.ToString()))
|
||||
{
|
||||
res = true;
|
||||
break;
|
||||
}
|
||||
result &= res;
|
||||
break;
|
||||
}
|
||||
case DataCompare.NotIn:
|
||||
if (compare.FieldName == "申请人" || compare.FieldName == "所属部门")
|
||||
{
|
||||
var arr = compare.Value.Split(',');
|
||||
foreach (var item in frmDataJson.GetValue(compare.FieldName).ToString().Split(','))
|
||||
{
|
||||
if (arr.Contains(item))
|
||||
{
|
||||
res = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
result &= res;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
var arr = compare.Value.Split(',');
|
||||
if (arr.Contains(frmvalue.ToString()))
|
||||
{
|
||||
res = false;
|
||||
break;
|
||||
}
|
||||
result &= res;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (compare.Operation)
|
||||
{
|
||||
case DataCompare.Equal:
|
||||
if (compare.FieldName == "申请人" || compare.FieldName == "所属部门")
|
||||
{
|
||||
var arr = compare.Value.Split(',');
|
||||
foreach (var item in frmDataJson.GetValue(compare.FieldName).ToString().Split(','))
|
||||
{
|
||||
if (arr.Contains(item))
|
||||
{
|
||||
res = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
result |= res;
|
||||
break;
|
||||
}
|
||||
result |= compare.Value == frmDataJson.GetValue(compare.FieldName).ToString();
|
||||
break;
|
||||
|
||||
case DataCompare.NotEqual:
|
||||
if (compare.FieldName == "申请人" || compare.FieldName == "所属部门")
|
||||
{
|
||||
var arr = compare.Value.Split(',');
|
||||
foreach (var item in frmDataJson.GetValue(compare.FieldName).ToString().Split(','))
|
||||
{
|
||||
if (arr.Contains(item))
|
||||
{
|
||||
res = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
result |= res;
|
||||
break;
|
||||
}
|
||||
result |= compare.Value != frmDataJson.GetValue(compare.FieldName).ToString();
|
||||
break;
|
||||
|
||||
case DataCompare.Larger:
|
||||
result |= frmvalue > value;
|
||||
break;
|
||||
|
||||
case DataCompare.Less:
|
||||
result |= frmvalue < value;
|
||||
break;
|
||||
|
||||
case DataCompare.LargerEqual:
|
||||
result |= frmvalue <= value;
|
||||
break;
|
||||
|
||||
case DataCompare.LessEqual:
|
||||
result |= frmvalue <= value;
|
||||
break;
|
||||
|
||||
case DataCompare.In:
|
||||
if (compare.FieldName == "申请人" || compare.FieldName == "所属部门")
|
||||
{
|
||||
var arr = compare.Value.Split(',');
|
||||
foreach (var item in frmDataJson.GetValue(compare.FieldName).ToString().Split(','))
|
||||
{
|
||||
if (arr.Contains(item))
|
||||
{
|
||||
res = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
result |= res;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
var arr = compare.Value.Split(',');
|
||||
if (arr.Contains(frmvalue.ToString()))
|
||||
{
|
||||
res = true;
|
||||
}
|
||||
result |= res;
|
||||
break;
|
||||
}
|
||||
case DataCompare.NotIn:
|
||||
if (compare.FieldName == "申请人" || compare.FieldName == "所属部门")
|
||||
{
|
||||
var arr = compare.Value.Split(',');
|
||||
foreach (var item in frmDataJson.GetValue(compare.FieldName).ToString().Split(','))
|
||||
{
|
||||
if (arr.Contains(item))
|
||||
{
|
||||
res = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
result |= res;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
var arr = compare.Value.Split(',');
|
||||
if (arr.Contains(frmvalue.ToString()))
|
||||
{
|
||||
res = false;
|
||||
}
|
||||
result |= res;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分支条件
|
||||
/// </summary>
|
||||
public class DataCompare
|
||||
{
|
||||
public const string Larger = ">";
|
||||
public const string Less = "<";
|
||||
public const string LargerEqual = ">=";
|
||||
public const string LessEqual = "<=";
|
||||
public const string NotEqual = "!=";
|
||||
public const string Equal = "=";
|
||||
public const string In = "in";
|
||||
public const string NotIn = "not in";
|
||||
|
||||
/// <summary>操作类型比如大于/等于/小于</summary>
|
||||
public string Operation { get; set; }
|
||||
|
||||
/// <summary> form种的字段名称 </summary>
|
||||
public string FieldName { get; set; }
|
||||
|
||||
/// <summary> 字段类型:"form":为表单中的字段,后期扩展系统表等. </summary>
|
||||
public string FieldType { get; set; }
|
||||
|
||||
/// <summary>实际的值</summary>
|
||||
public string Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 显示值
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 条件关系
|
||||
/// </summary>
|
||||
public string Condition { get; set; }
|
||||
}
|
||||
}
|
||||
131
WaterCloud.Code/Flow/FlowNode.cs
Normal file
131
WaterCloud.Code/Flow/FlowNode.cs
Normal file
@@ -0,0 +1,131 @@
|
||||
namespace WaterCloud.Code
|
||||
{
|
||||
/// <summary>
|
||||
/// 流程节点
|
||||
/// </summary>
|
||||
public class FlowNode
|
||||
{
|
||||
public const string START = "start round mix";
|
||||
public const string END = "end round";
|
||||
public const string NODE = "node";
|
||||
public const string FORK = "fork"; //会签开始节点
|
||||
public const string JOIN = "join"; //会签结束节点
|
||||
|
||||
public string id { get; set; }
|
||||
|
||||
public string name { get; set; }
|
||||
|
||||
public string type { get; set; }
|
||||
|
||||
public int left { get; set; }
|
||||
public int top { get; set; }
|
||||
|
||||
public int width { get; set; }
|
||||
public int height { get; set; }
|
||||
public bool alt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 节点的附加数据项
|
||||
/// </summary>
|
||||
/// <value>The set information.</value>
|
||||
public Setinfo setInfo { get; set; }
|
||||
}
|
||||
|
||||
public class Setinfo
|
||||
{
|
||||
public const string SPECIAL_USER = "SPECIAL_USER"; //指定用户
|
||||
public const string ALL_USER = "ALL_USER"; //所有用户
|
||||
public const string SPECIAL_ROLE = "SPECIAL_ROLE"; //指定角色
|
||||
public const string DEPARTMENT_MANAGER = "DEPARTMENT_MANAGER"; //部门负责人
|
||||
public const string USER_MANAGER = "USER_MANAGER"; //直属上级
|
||||
public const string MORE_USER_MANAGER = "MORE_USER_MANAGER"; //连续多级直属上级
|
||||
public const string RUNTIME_SPECIAL_ROLE = "RUNTIME_SPECIAL_ROLE"; //运行时指定角色
|
||||
public const string RUNTIME_SPECIAL_USER = "RUNTIME_SPECIAL_USER"; //运行时指定用户
|
||||
|
||||
/// <summary>
|
||||
/// 节点执行权限类型
|
||||
/// </summary>
|
||||
public string NodeDesignate { get; set; }
|
||||
|
||||
public Nodedesignatedata NodeDesignateData { get; set; }
|
||||
public string NodeCode { get; set; }
|
||||
public string NodeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 流程执行时,三方回调的URL地址
|
||||
/// </summary>
|
||||
public string ThirdPartyUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 驳回节点0"前一步"1"第一步"2"某一步" 3"不处理"
|
||||
/// </summary>
|
||||
public string NodeRejectType { get; set; }
|
||||
|
||||
public int? Taged { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public string UserId { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string TagedTime { get; set; }
|
||||
|
||||
//节点会签方式,
|
||||
//all/空:默认为全部通过
|
||||
//one :至少有一个通过
|
||||
public string NodeConfluenceType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 会签通过的个数
|
||||
/// </summary>
|
||||
public int? ConfluenceOk { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 会签拒绝的个数
|
||||
/// </summary>
|
||||
public int? ConfluenceNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 可写的表单项ID
|
||||
/// </summary>
|
||||
public string[] CanWriteFormItemIds { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 节点执行人
|
||||
/// </summary>
|
||||
public class Nodedesignatedata
|
||||
{
|
||||
public string[] users { get; set; }
|
||||
public string[] roles { get; set; }
|
||||
public string[] orgs { get; set; }
|
||||
public bool currentDepart { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 节点执行结果标签
|
||||
/// </summary>
|
||||
public class Tag
|
||||
{
|
||||
/// <summary>
|
||||
/// 1: 通过
|
||||
/// 2:不通过
|
||||
/// 3:驳回
|
||||
/// </summary>
|
||||
public int Taged { get; set; }
|
||||
|
||||
public string UserId { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string TagedTime { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 1: 通过
|
||||
/// 2:不通过
|
||||
/// 3:驳回
|
||||
/// </summary>
|
||||
public enum TagState
|
||||
{
|
||||
Ok = 1,
|
||||
No,
|
||||
Reject
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user