init commit
This commit is contained in:
77
back_end_code/Ewide.RoadFlow/Data/AppLibary/AppLibrary.cs
Normal file
77
back_end_code/Ewide.RoadFlow/Data/AppLibary/AppLibrary.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using Furion.DependencyInjection;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class Applibrary:RoadFlowRepository<RoadFlow.Model.rf_applibrary>,IApplibrary, ITransient
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 根据Code得到实体
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
public Model.rf_applibrary GetByCode(string code)
|
||||
{
|
||||
List<Model.rf_applibrary> appLibraries = GetAll();
|
||||
return appLibraries.Find(p => p.Code.EqualsIgnoreCase(code));
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除应用
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public int Delete(string id)
|
||||
{
|
||||
var app = GetOneById(id);
|
||||
return null == app ? 0 : Delete(app);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到对应语言的标题
|
||||
/// </summary>
|
||||
/// <param name="appLibrary"></param>
|
||||
/// <param name="language">语言</param>
|
||||
/// <returns></returns>
|
||||
public string GetLanguageTitle(Model.rf_applibrary appLibrary, string language = "")
|
||||
{
|
||||
if (null == appLibrary)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
string lang = language.IsNullOrWhiteSpace() ? Tools.GetCurrentLanguage() : language;
|
||||
switch (lang)
|
||||
{
|
||||
case "en-US":
|
||||
return appLibrary.Title_en;
|
||||
case "zh":
|
||||
return appLibrary.Title_zh;
|
||||
default:
|
||||
return appLibrary.Title;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个类别的应用
|
||||
/// </summary>
|
||||
/// <param name="typeId">类别ID</param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_applibrary> GetListByType(string typeId)
|
||||
{
|
||||
List<Model.rf_applibrary> appLibraries = new List<Model.rf_applibrary>();
|
||||
var all = GetAll();
|
||||
var typeIds = new Dictionary().GetAllChildsId(typeId);
|
||||
foreach (var id in typeIds)
|
||||
{
|
||||
appLibraries.AddRange(all.FindAll(p => p.Type == id));
|
||||
}
|
||||
return appLibraries.OrderBy(p => p.Title).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
41
back_end_code/Ewide.RoadFlow/Data/AppLibary/IApplibrary.cs
Normal file
41
back_end_code/Ewide.RoadFlow/Data/AppLibary/IApplibrary.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IApplibrary : IRoadFlowRepository<RoadFlow.Model.rf_applibrary>
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 根据Code得到实体
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
public Model.rf_applibrary GetByCode(string code);
|
||||
/// <summary>
|
||||
/// 删除应用
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public int Delete(string id);
|
||||
|
||||
/// <summary>
|
||||
/// 得到对应语言的标题
|
||||
/// </summary>
|
||||
/// <param name="appLibrary"></param>
|
||||
/// <param name="language">语言</param>
|
||||
/// <returns></returns>
|
||||
public string GetLanguageTitle(Model.rf_applibrary appLibrary, string language = "");
|
||||
/// <summary>
|
||||
/// 得到一个类别的应用
|
||||
/// </summary>
|
||||
/// <param name="typeId">类别ID</param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_applibrary> GetListByType(string typeId);
|
||||
}
|
||||
|
||||
}
|
||||
702
back_end_code/Ewide.RoadFlow/Data/DbConnection/DbConnection.cs
Normal file
702
back_end_code/Ewide.RoadFlow/Data/DbConnection/DbConnection.cs
Normal file
@@ -0,0 +1,702 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Furion.FriendlyException;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using MySql.Data.MySqlClient;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class DbConnection:RoadFlowRepository<RoadFlow.Model.rf_dbconnection>,IDbConnection, ITransient
|
||||
{
|
||||
/// <summary>
|
||||
/// 添加一个连接
|
||||
/// </summary>
|
||||
/// <param name="dbConnection">连接实体</param>
|
||||
/// <returns></returns>
|
||||
public override int Add(Model.rf_dbconnection dbConnection)
|
||||
{
|
||||
ClearCache();
|
||||
dbConnection.ConnString = dbConnection.ConnString.DESEncrypt();
|
||||
return db.Insertable(dbConnection).ExecuteCommand();
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新连接
|
||||
/// </summary>
|
||||
/// <param name="dictionary">连接实体</param>
|
||||
public override int Update(Model.rf_dbconnection dbConnection, bool clearCache = true)
|
||||
{
|
||||
if(clearCache)
|
||||
ClearCache();
|
||||
dbConnection.ConnString = dbConnection.ConnString.DESEncrypt();
|
||||
return db.Updateable(dbConnection).ExecuteCommand();
|
||||
}
|
||||
/// <summary>
|
||||
/// 得到所有连接
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override List<Model.rf_dbconnection> GetAll()
|
||||
{
|
||||
return _memoryCache.GetOrCreate(CACHEKEY, v =>
|
||||
{
|
||||
var dbConnections = db.Queryable<Model.rf_dbconnection>().OrderBy(p => p.Sort).ToList();
|
||||
foreach (var dbConn in dbConnections)
|
||||
{
|
||||
dbConn.ConnString = dbConn.ConnString.DESDecrypt();
|
||||
}
|
||||
return dbConnections;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个表所有字段
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="tableName"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.TableField> GetTableFields(string id, string tableName)
|
||||
{
|
||||
var conn = GetOneById(id);
|
||||
if (null == conn)
|
||||
{
|
||||
return new List<Model.TableField>();
|
||||
}
|
||||
return GetTableFields(conn, tableName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个表所有字段
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="tableName"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.TableField> GetTableFields(Model.rf_dbconnection conn, string tableName)
|
||||
{
|
||||
List<Model.TableField> tableFields = new List<Model.TableField>();
|
||||
string dbName = string.Empty;
|
||||
if (conn.ConnType.EqualsIgnoreCase("mysql"))
|
||||
{
|
||||
string[] connStringArray = conn.ConnString.Split(';');
|
||||
foreach (string connString in connStringArray)
|
||||
{
|
||||
string[] connArray = connString.Split('=');
|
||||
if (connArray.Length > 1 && (connArray[0].Trim().Equals("database") || connArray[0].Trim().Equals("db") || connArray[0].Trim().Equals("Initial Catalog")))
|
||||
{
|
||||
dbName = connArray[1].Trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
var dt = this.GetTableFields(conn, tableName, dbName);
|
||||
foreach (DataRow dr in dt.Rows)
|
||||
{
|
||||
Model.TableField tableField = new Model.TableField()
|
||||
{
|
||||
FieldName = dr["f_name"].ToString().Trim(),
|
||||
Type = dr["t_name"].ToString(),
|
||||
Size = dr["length"].ToString().ToInt(),
|
||||
IsNull = "1".Equals(dr["is_null"].ToString()),
|
||||
IsDefault = dr["cdefault"].ToString().ToInt(0) != 0,
|
||||
IsIdentity = dr["isidentity"].ToString().ToInt() == 1,
|
||||
DefaultValue = dr["defaultvalue"].ToString(),
|
||||
Comment = dr["comments"].ToString()
|
||||
};
|
||||
tableFields.Add(tableField);
|
||||
}
|
||||
return tableFields;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个表所有字段
|
||||
/// </summary>
|
||||
/// <param name="dbConnection"></param>
|
||||
/// <param name="table">表名</param>
|
||||
/// <param name="dbName">数据库名(MYSQL时需要,防止同一个连接中不同的数据库中有相同的表名的情况。其它数据库为空)</param>
|
||||
/// <returns>返回datatable 列:f_name,t_name,length,is_null,cdefault,isidentity,defaultvalue,comments</returns>
|
||||
public DataTable GetTableFields(Model.rf_dbconnection dbConnection, string table, string dbName)
|
||||
{
|
||||
using var conn = dbConnection.GetConn(db);
|
||||
string sql = GetTableFieldsSql(dbConnection, table, dbName);
|
||||
return conn.Ado.GetDataTable(sql);
|
||||
}
|
||||
|
||||
|
||||
private string GetTableFieldsSql(Model.rf_dbconnection dbConnection, string tableName, string dbName)
|
||||
{
|
||||
using (var conn = db.GetConnection(dbConnection.Id))
|
||||
{
|
||||
switch (dbConnection.DbType)
|
||||
{
|
||||
case SqlSugar.DbType.MySql:
|
||||
return "SELECT COLUMN_NAME f_name,DATA_TYPE t_name, CHARACTER_MAXIMUM_LENGTH length " +
|
||||
",CASE IS_NULLABLE WHEN 'NO' THEN 0 WHEN 'YES' THEN 1 END is_null,COLUMN_DEFAULT cdefault,0 isidentity,COLUMN_DEFAULT defaultvalue,COLUMN_COMMENT comments FROM " +
|
||||
"information_schema.TABLES a " +
|
||||
"LEFT JOIN information_schema.COLUMNS b ON a.table_name = b.TABLE_NAME " +
|
||||
"WHERE a.TABLE_NAME='" + tableName + "'"
|
||||
+ (dbName.IsNullOrWhiteSpace() ? "" : " AND a.TABLE_SCHEMA='" + dbName + "' AND b.TABLE_SCHEMA='" + dbName + "'")
|
||||
+ " ORDER BY b.ordinal_position";
|
||||
case SqlSugar.DbType.SqlServer:
|
||||
return string.Format("select a.name as f_name,b.name as t_name,a.prec as [length],a.isnullable as is_null,a.cdefault as cdefault," +
|
||||
"COLUMNPROPERTY(OBJECT_ID('{0}'),a.name,'IsIdentity') as isidentity," +
|
||||
"(select top 1 text from sysobjects d inner join syscolumns e on e.id=d.id inner join syscomments f on f.id=e.cdefault " +
|
||||
"where d.name='{0}' and e.name=a.name) as defaultvalue,cast([value] as varchar(500)) as comments " +
|
||||
"from sys.syscolumns a left join sys.types b on b.user_type_id=a.xtype left join sys.extended_properties x " +
|
||||
"on x.major_id=OBJECT_ID('{0}') and x.minor_id=a.colid " +
|
||||
"where OBJECT_ID('{0}')=id order by a.colid", tableName);
|
||||
case SqlSugar.DbType.Oracle:
|
||||
return string.Format("SELECT user_tab_columns.COLUMN_NAME as f_name," +
|
||||
"user_tab_columns.DATA_TYPE as t_name," +
|
||||
"user_tab_columns.CHAR_LENGTH AS length," +
|
||||
"CASE user_tab_columns.NULLABLE WHEN 'Y' THEN 1 WHEN 'N' THEN 0 END AS is_null," +
|
||||
"user_tab_columns.DATA_DEFAULT AS cdefault," +
|
||||
"0 as isidentity,user_tab_columns.DATA_DEFAULT AS defaultvalue,user_col_comments.comments FROM user_tab_columns,user_col_comments " +
|
||||
"WHERE user_tab_columns.COLUMN_NAME=user_col_comments.COLUMN_NAME " +
|
||||
"and user_tab_columns.TABLE_NAME=user_col_comments.TABLE_NAME " +
|
||||
"and UPPER(user_tab_columns.TABLE_NAME)=UPPER('{0}') " +
|
||||
"and UPPER(user_col_comments.TABLE_NAME)=UPPER('{0}') " +
|
||||
"ORDER BY user_tab_columns.COLUMN_ID", tableName);
|
||||
case SqlSugar.DbType.PostgreSQL:
|
||||
return "select column_name as f_name,udt_name as t_name,character_maximum_length as length,case is_nullable when 'NO' then 0 when 'YES' then 1 end as is_null,column_default as cdefault,case is_identity when 'NO' then 0 when 'YES' then 1 end as isidentity,column_default as defaultvalue,'' as comments from information_schema.columns where table_name='" + tableName.ToLower() + "' order by ordinal_position";
|
||||
case SqlSugar.DbType.Dm:
|
||||
case SqlSugar.DbType.Kdbndp:
|
||||
case SqlSugar.DbType.Sqlite:
|
||||
return "不支持的连接类型";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到数据库所有表SQL
|
||||
/// </summary>
|
||||
private string GetDbTablesSql(SqlSugar.DbType type,string database)
|
||||
{
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case SqlSugar.DbType.MySql:
|
||||
return "select TABLE_NAME, TABLE_COMMENT COMMENTS from information_schema.TABLES where TABLE_SCHEMA='" + database + "' and (table_type='BASE TABLE' or table_type='VIEW')";
|
||||
case SqlSugar.DbType.SqlServer:
|
||||
return "SELECT name TABLE_NAME,(select top 1 cast([value] as varchar) [value] from sys.extended_properties where major_id=sysobjects.id and minor_id=0) COMMENTS from sysobjects WHERE name<>'sysdiagrams' AND (xtype='U' or xtype='V') ORDER BY xtype,name";
|
||||
case SqlSugar.DbType.Oracle:
|
||||
return "select a.TABLE_NAME,b.COMMENTS from user_tables a,user_tab_comments b WHERE a.TABLE_NAME=b.TABLE_NAME and a.TABLE_NAME not like '%$%' and a.TABLE_NAME not like 'LOGMNR%' and a.TABLE_NAME not like 'HELP%' and a.TABLE_NAME not like 'SPRING%' and a.TABLE_NAME not like 'SQLPLUS%' order by TABLE_NAME";
|
||||
case SqlSugar.DbType.PostgreSQL:
|
||||
return "select table_name, '' as comments from information_schema.tables where table_catalog='" + database + "' and table_schema='public' and (table_type='BASE TABLE' or table_type='VIEW')";
|
||||
case SqlSugar.DbType.Dm:
|
||||
case SqlSugar.DbType.Kdbndp:
|
||||
case SqlSugar.DbType.Sqlite:
|
||||
return "不支持的连接类型";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个连接所有表
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns>Dictionary(表名, 表说明)</returns>
|
||||
public Dictionary<string, string> GetTables(string id)
|
||||
{
|
||||
Dictionary<string, string> dict = new Dictionary<string, string>();
|
||||
var conn = GetOneById(id);
|
||||
if (null == conn)
|
||||
{
|
||||
return dict;
|
||||
}
|
||||
DataTable dt = this.GetTables(conn);
|
||||
foreach (DataRow dr in dt.Rows)
|
||||
{
|
||||
dict.Add(dr[0].ToString().Trim(), dr[1].ToString());
|
||||
}
|
||||
return dict;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询一个连接所有表
|
||||
/// </summary>
|
||||
/// <param name="dbConnection"></param>
|
||||
/// <returns>表名,表说明</returns>
|
||||
public DataTable GetTables(Model.rf_dbconnection dbConnection)
|
||||
{
|
||||
using (SqlSugar.SqlSugarClient c = new SqlSugar.SqlSugarClient(new SqlSugar.ConnectionConfig()
|
||||
{
|
||||
ConfigId = dbConnection.Id,
|
||||
ConnectionString = dbConnection.ConnString,
|
||||
DbType = dbConnection.DbType,
|
||||
IsAutoCloseConnection = true,
|
||||
InitKeyType = SqlSugar.InitKeyType.SystemTable
|
||||
}))
|
||||
{
|
||||
var prd = c.GetConnection(dbConnection.Id);
|
||||
return prd.Ado.GetDataTable(
|
||||
GetDbTablesSql(dbConnection.DbType, prd.Ado.Connection.Database));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个字段的值(默认系统连接)
|
||||
/// </summary>
|
||||
/// <param name="sql">SQL</param>
|
||||
/// <param name="objs">参数</param>
|
||||
/// <returns></returns>
|
||||
public string GetFieldValue(string sql, params object[] objs)
|
||||
{
|
||||
return JObject.FromObject(db.Ado.SqlQuery<dynamic>(sql, objs)).ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得到DATATABLE
|
||||
/// </summary>
|
||||
/// <param name="dbConnectionModel"></param>
|
||||
/// <param name="tableName"></param>
|
||||
/// <param name="primaryKey"></param>
|
||||
/// <param name="primaryKeyValue"></param>
|
||||
/// <param name="order">排序 f1 desc</param>
|
||||
/// <returns></returns>
|
||||
public DataTable GetDataTable(Model.rf_dbconnection dbConnectionModel, string tableName, string primaryKey, string primaryKeyValue, string order = "")
|
||||
{
|
||||
if (null == dbConnectionModel || primaryKeyValue.IsNullOrWhiteSpace()
|
||||
|| tableName.IsNullOrWhiteSpace() || primaryKey.IsNullOrWhiteSpace())
|
||||
{
|
||||
return new DataTable();
|
||||
}
|
||||
var (sql, param) = GetFieldValueSql(tableName, "*", primaryKey, primaryKeyValue);
|
||||
|
||||
DataTable dt = GetDataTable(dbConnectionModel, sql, param);
|
||||
if (!order.IsNullOrWhiteSpace())
|
||||
{
|
||||
dt.DefaultView.Sort = order;
|
||||
return dt.DefaultView.ToTable();
|
||||
}
|
||||
else
|
||||
{
|
||||
return dt;
|
||||
}
|
||||
}
|
||||
|
||||
public DataTable GetDataTable(Model.rf_dbconnection conn, string sql, params object[] objs)
|
||||
{
|
||||
using (SqlSugar.SqlSugarClient c = new SqlSugar.SqlSugarClient(new SqlSugar.ConnectionConfig()
|
||||
{
|
||||
ConfigId = conn.Id,
|
||||
ConnectionString = conn.ConnString,
|
||||
DbType = conn.DbType,
|
||||
IsAutoCloseConnection = true,
|
||||
InitKeyType = SqlSugar.InitKeyType.SystemTable
|
||||
}))
|
||||
{
|
||||
var prd = c.GetConnection(conn.Id);
|
||||
List<SqlSugar.SugarParameter> list = new List<SqlSugar.SugarParameter>();
|
||||
foreach (object o in objs)
|
||||
list.Add((SqlSugar.SugarParameter)o);
|
||||
return prd.Ado.GetDataTable(sql, list);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到查询一个字段值SQL
|
||||
/// </summary>
|
||||
/// <param name="tableName"></param>
|
||||
/// <param name="fieldName"></param>
|
||||
/// <param name="primaryKey"></param>
|
||||
/// <param name="primaryKeyValue"></param>
|
||||
/// <returns></returns>
|
||||
public (string sql, object[] parameter) GetFieldValueSql(string tableName, string fieldName, string primaryKey, string primaryKeyValue)
|
||||
{
|
||||
string sql = "SELECT " + fieldName + " FROM " + tableName + " WHERE " + primaryKey + " = @primarykeyvalue";
|
||||
return (sql, new object[] { new SqlSugar.SugarParameter("primarykeyvalue",primaryKeyValue) } );
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个字段的值
|
||||
/// </summary>
|
||||
/// <param name="id">连接ID</param>
|
||||
/// <param name="tableName">表名</param>
|
||||
/// <param name="fieldName">要查询的字段</param>
|
||||
/// <param name="primaryKey">主键</param>
|
||||
/// <param name="primaryKeyValue">主键值</param>
|
||||
/// <returns></returns>
|
||||
public string GetFieldValue(string id, string tableName, string fieldName, string primaryKey, string primaryKeyValue)
|
||||
{
|
||||
var conn = GetOneById(id);
|
||||
if (null == conn)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
return GetFieldValue(conn, tableName, fieldName, primaryKey, primaryKeyValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个字段的值
|
||||
/// </summary>
|
||||
/// <param name="dbConnection">连接实体</param>
|
||||
/// <param name="tableName">表名</param>
|
||||
/// <param name="fieldName">要查询的字段</param>
|
||||
/// <param name="primaryKey">主键</param>
|
||||
/// <param name="primaryKeyValue">主键值</param>
|
||||
/// <returns></returns>
|
||||
public string GetFieldValue(Model.rf_dbconnection dbConnection, string tableName, string fieldName, string primaryKey, string primaryKeyValue)
|
||||
{
|
||||
var sql = GetFieldValueSql(tableName, fieldName, primaryKey, primaryKeyValue);
|
||||
DataTable dataTable = GetDataTable(dbConnection, sql.sql, sql.parameter );
|
||||
return dataTable.Rows.Count > 0 ? dataTable.Rows[0][0].ToString() : string.Empty;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
/// <param name="dbConnection"></param>
|
||||
/// <param name="tuples"></param>
|
||||
/// <param name="isIdentity"></param>
|
||||
/// <param name="seqName"></param>
|
||||
/// <param name="sqlList">要额外执行的SQL列表</param>
|
||||
/// <returns>返回数字表示成功(数字是受影响的行数或者自增主键值),其它为错误信息</returns>
|
||||
public string SaveData(Model.rf_dbconnection dbConnection, List<(Dictionary<string, object> dicts, string tableName, string primaryKey, int flag)> tuples,
|
||||
bool isIdentity = false, string seqName = "", List<(string, SqlSugar.SugarParameter[])> sqlList = null)
|
||||
{
|
||||
return tuples.Count == 0 && (sqlList == null || sqlList.Count == 0) ? "0" : SaveData2(dbConnection, tuples, isIdentity, seqName, sqlList);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
/// <param name="tuples"></param>
|
||||
/// <param name="sqlList1">要额外执行的SQL列表</param>
|
||||
/// <returns>返回数字表示成功(数字是受影响的行数或者自增主键值),其它为错误信息</returns>
|
||||
public string SaveData2(Model.rf_dbconnection dbConnection, List<(Dictionary<string, object> dicts, string tableName, string primaryKey, int flag)> tuples,
|
||||
bool isIdentity = false, string seqName = "", List<(string, SqlSugar.SugarParameter[])> sqlList1 = null)
|
||||
{
|
||||
|
||||
List<(string sql, SqlSugar.SugarParameter[] parameters)> sqlList = new List<(string sql, SqlSugar.SugarParameter[] parameters)>();
|
||||
foreach (var (dicts, tableName, primaryKey, flag) in tuples)
|
||||
{
|
||||
var (sql, paramArray) = GetSaveDataSql(dicts, tableName, primaryKey, flag);
|
||||
sqlList.Add((sql, paramArray));
|
||||
}
|
||||
if (sqlList1 != null && sqlList1.Count > 0)
|
||||
{
|
||||
sqlList.AddRange(sqlList1);
|
||||
}
|
||||
|
||||
using (SqlSugar.SqlSugarClient c = new SqlSugar.SqlSugarClient(new SqlSugar.ConnectionConfig()
|
||||
{
|
||||
ConfigId = dbConnection.Id,
|
||||
ConnectionString = dbConnection.ConnString,
|
||||
DbType = dbConnection.DbType,
|
||||
IsAutoCloseConnection = true,
|
||||
InitKeyType = SqlSugar.InitKeyType.SystemTable
|
||||
}))
|
||||
{
|
||||
var prd = c.GetConnection(dbConnection.Id);
|
||||
prd.Ado.BeginTran();
|
||||
try
|
||||
{
|
||||
int i = 0;
|
||||
foreach (var (sql, parameter) in sqlList)
|
||||
{
|
||||
i += prd.Ado.ExecuteCommand(sql, parameter);
|
||||
}
|
||||
if (isIdentity && !seqName.IsNullOrWhiteSpace())
|
||||
{
|
||||
i = prd.Ado.SqlQuery<int>("SELECT @@IDENTITY")[0];
|
||||
}
|
||||
prd.Ado.CommitTran();
|
||||
return i.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
prd.Ado.RollbackTran();
|
||||
}
|
||||
|
||||
}
|
||||
return "-1";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到保存数据SQL
|
||||
/// </summary>
|
||||
/// <param name="dicts"></param>
|
||||
/// <param name="flag">0删除 1新增 2修改</param>
|
||||
/// <returns></returns>
|
||||
public (string sql, SqlSugar.SugarParameter[] parameter) GetSaveDataSql(Dictionary<string, object> dicts, string tableName, string primaryKey, int flag)
|
||||
{
|
||||
StringBuilder sqlBuilder = new StringBuilder();
|
||||
List<SqlSugar.SugarParameter> parameters = new List<SqlSugar.SugarParameter>();
|
||||
if (0 == flag)
|
||||
{
|
||||
sqlBuilder.Append("DELETE FROM " + tableName);
|
||||
}
|
||||
else if (1 == flag)
|
||||
{
|
||||
sqlBuilder.Append("INSERT INTO " + tableName + "(");
|
||||
foreach (var dict in dicts)
|
||||
{
|
||||
sqlBuilder.Append(dict.Key);
|
||||
if (!dict.Key.Equals(dicts.Last().Key))
|
||||
{
|
||||
sqlBuilder.Append(",");
|
||||
}
|
||||
}
|
||||
sqlBuilder.Append(") VALUES(");
|
||||
}
|
||||
else if (2 == flag)
|
||||
{
|
||||
sqlBuilder.Append("UPDATE " + tableName + " SET ");
|
||||
}
|
||||
foreach (var dict in dicts)
|
||||
{
|
||||
if (0 == flag)
|
||||
{
|
||||
sqlBuilder.Append(" WHERE " + primaryKey + "=@" + primaryKey);
|
||||
parameters.Add(new SqlSugar.SugarParameter("@" + primaryKey, dicts[primaryKey]));
|
||||
}
|
||||
else if (1 == flag)
|
||||
{
|
||||
parameters.Add(new SqlSugar.SugarParameter("@" + dict.Key, dict.Value));
|
||||
sqlBuilder.Append("@" + dict.Key);
|
||||
if (!dict.Key.Equals(dicts.Last().Key))
|
||||
{
|
||||
sqlBuilder.Append(",");
|
||||
}
|
||||
}
|
||||
else if (2 == flag)
|
||||
{
|
||||
parameters.Add(new SqlSugar.SugarParameter("@" + dict.Key, dict.Value));
|
||||
if (dict.Key.EqualsIgnoreCase(primaryKey))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
sqlBuilder.Append(dict.Key + "=@" + dict.Key);
|
||||
if (!dict.Key.Equals(dicts.Last().Key))
|
||||
{
|
||||
sqlBuilder.Append(",");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (1 == flag)
|
||||
{
|
||||
sqlBuilder.Append(")");
|
||||
}
|
||||
else if (2 == flag)
|
||||
{
|
||||
sqlBuilder.Append(" WHERE " + primaryKey + "=@" + primaryKey);
|
||||
}
|
||||
return (sqlBuilder.ToString(), parameters.ToArray());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断一个连接是否和系统是一个连接
|
||||
/// </summary>
|
||||
/// <param name="connId"></param>
|
||||
/// <returns></returns>
|
||||
public bool IsSystemConn(Model.rf_dbconnection connModel)
|
||||
{
|
||||
var con =db.CurrentConnectionConfig;
|
||||
return true;
|
||||
}
|
||||
|
||||
public int executeSqlByConnection(Model.rf_dbconnection conn, IEnumerable<(string, object[], int)> list, bool trans = true)
|
||||
{
|
||||
using (SqlSugar.SqlSugarClient c = new SqlSugar.SqlSugarClient(new SqlSugar.ConnectionConfig()
|
||||
{
|
||||
ConfigId = conn.Id,
|
||||
ConnectionString = conn.ConnString,
|
||||
DbType = conn.DbType,
|
||||
IsAutoCloseConnection = true,
|
||||
InitKeyType = SqlSugar.InitKeyType.SystemTable
|
||||
}))
|
||||
{
|
||||
if(trans)
|
||||
c.BeginTran();
|
||||
try
|
||||
{
|
||||
int count = 0;
|
||||
foreach (var (sql, pars, _) in list)
|
||||
count = c.Ado.ExecuteCommand(sql, pars);
|
||||
if (trans)
|
||||
c.CommitTran();
|
||||
return count;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (trans)
|
||||
c.RollbackTran();
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int executeSqlByConnection(Model.rf_dbconnection conn, string sql,params object[] pars)
|
||||
{
|
||||
using (SqlSugar.SqlSugarClient c = new SqlSugar.SqlSugarClient(new SqlSugar.ConnectionConfig()
|
||||
{
|
||||
ConfigId = conn.Id,
|
||||
ConnectionString = conn.ConnString,
|
||||
DbType = conn.DbType,
|
||||
IsAutoCloseConnection = true,
|
||||
InitKeyType = SqlSugar.InitKeyType.SystemTable
|
||||
}))
|
||||
{
|
||||
return c.Ado.ExecuteCommand(sql, pars);
|
||||
}
|
||||
|
||||
}
|
||||
public int executeSqlByConnection(string connId, List<(string, IEnumerable<object>)> sqls)
|
||||
{
|
||||
var conn = GetOneById(connId);
|
||||
using (SqlSugar.SqlSugarClient c = new SqlSugar.SqlSugarClient(new SqlSugar.ConnectionConfig()
|
||||
{
|
||||
ConfigId = conn.Id,
|
||||
ConnectionString = conn.ConnString,
|
||||
DbType = conn.DbType,
|
||||
IsAutoCloseConnection = true,
|
||||
InitKeyType = SqlSugar.InitKeyType.SystemTable
|
||||
}))
|
||||
{
|
||||
c.Ado.BeginTran();
|
||||
try
|
||||
{
|
||||
int count = 0;
|
||||
foreach ((string sql, IEnumerable<object> pars) in sqls)
|
||||
{
|
||||
count +=c.Ado.ExecuteCommand(sql, pars);
|
||||
}
|
||||
c.Ado.CommitTran();
|
||||
return count;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
c.Ado.RollbackTran();
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int executeSqlByCurrent(IEnumerable<(string, object[], int)> list,bool trans=true)
|
||||
{
|
||||
if (trans)
|
||||
db.BeginTran();
|
||||
try
|
||||
{
|
||||
int count = 0;
|
||||
foreach (var (sql, pars, _) in list)
|
||||
count = db.Ado.ExecuteCommand(sql, pars);
|
||||
if (trans)
|
||||
db.CommitTran();
|
||||
return count;
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (trans)
|
||||
db.RollbackTran();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 测试一个SQL语句是否正确
|
||||
/// </summary>
|
||||
/// <param name="id">连接ID</param>
|
||||
/// <param name="sql">sql语句</param>
|
||||
/// <param name="parameters">sql参数</param>
|
||||
/// <returns></returns>
|
||||
public string TestSQL(string id, string sql, object[] parameters = null)
|
||||
{
|
||||
var conn = GetOneById(id);
|
||||
if (conn == null)
|
||||
return "未找到连接实体";
|
||||
using (SqlSugar.SqlSugarClient c = new SqlSugar.SqlSugarClient(new SqlSugar.ConnectionConfig()
|
||||
{
|
||||
ConfigId = conn.Id,
|
||||
ConnectionString = conn.ConnString,
|
||||
DbType = conn.DbType,
|
||||
IsAutoCloseConnection = true,
|
||||
InitKeyType = SqlSugar.InitKeyType.SystemTable
|
||||
}))
|
||||
{
|
||||
c.Ado.BeginTran();
|
||||
try {
|
||||
int rtn = c.Ado.ExecuteCommand(sql, parameters);
|
||||
return rtn.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "SQL:" + sql + " " + ex.Message;
|
||||
}
|
||||
finally {
|
||||
c.Ado.RollbackTran();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得到连接类别下拉项(VUE)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public JArray GetConnTypeOptionsVue()
|
||||
{
|
||||
JArray jArray = new JArray();
|
||||
var array = Enum.GetValues(typeof(ConnType));
|
||||
foreach (var arr in array)
|
||||
{
|
||||
jArray.Add(new JObject() { { "value", arr.ToString() }, { "title", arr.ToString() } });
|
||||
}
|
||||
return jArray;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 测试一个连接
|
||||
/// </summary>
|
||||
/// <param name="id">连接ID</param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns>返回"1"表示正常,其它为错误信息</returns>
|
||||
public string TestConnection(string id, IStringLocalizer localizer = null)
|
||||
{
|
||||
var conn = this.GetOneById(id);
|
||||
if (conn == null)
|
||||
return localizer == null ? "未找到连接" : localizer["NotFoundConnection"].Value;
|
||||
using (SqlSugar.SqlSugarClient c = new SqlSugar.SqlSugarClient(new SqlSugar.ConnectionConfig()
|
||||
{
|
||||
ConfigId = conn.Id,
|
||||
ConnectionString = conn.ConnString,
|
||||
DbType = conn.DbType,
|
||||
IsAutoCloseConnection = true,
|
||||
InitKeyType = SqlSugar.InitKeyType.SystemTable
|
||||
}))
|
||||
{
|
||||
return "1";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数据连接类型枚举
|
||||
/// </summary>
|
||||
public enum ConnType
|
||||
{
|
||||
SqlServer,
|
||||
MySql,
|
||||
Oracle,
|
||||
PostgreSql
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IDbConnection : IRoadFlowRepository<RoadFlow.Model.rf_dbconnection>
|
||||
{
|
||||
List<Model.TableField> GetTableFields(string id, string tableName);
|
||||
List<Model.TableField> GetTableFields(Model.rf_dbconnection conn, string tableName);
|
||||
DataTable GetTableFields(Model.rf_dbconnection dbConnection, string table, string dbName);
|
||||
Dictionary<string, string> GetTables(string id);
|
||||
DataTable GetTables(Model.rf_dbconnection dbConnection);
|
||||
|
||||
/// <summary>
|
||||
/// 测试一个SQL语句是否正确
|
||||
/// </summary>
|
||||
/// <param name="id">连接ID</param>
|
||||
/// <param name="sql">sql语句</param>
|
||||
/// <param name="parameters">sql参数</param>
|
||||
/// <returns></returns>
|
||||
public string TestSQL(string id, string sql, object[] parameters = null);
|
||||
/// <summary>
|
||||
/// 得到连接类别下拉项(VUE)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public JArray GetConnTypeOptionsVue();
|
||||
/// <summary>
|
||||
/// 测试一个连接
|
||||
/// </summary>
|
||||
/// <param name="id">连接ID</param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns>返回"1"表示正常,其它为错误信息</returns>
|
||||
public string TestConnection(string id, IStringLocalizer localizer = null);
|
||||
}
|
||||
|
||||
}
|
||||
574
back_end_code/Ewide.RoadFlow/Data/Dictionary/Dictionary.cs
Normal file
574
back_end_code/Ewide.RoadFlow/Data/Dictionary/Dictionary.cs
Normal file
@@ -0,0 +1,574 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RoadFlow.Data;
|
||||
using RoadFlow.Utility;
|
||||
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class Dictionary : RoadFlowRepository<RoadFlow.Model.rf_dictionary>, IDictionary, ITransient
|
||||
{
|
||||
/// <summary>
|
||||
/// 值字段
|
||||
/// </summary>
|
||||
public enum ValueField
|
||||
{
|
||||
Id,
|
||||
Title,
|
||||
Code,
|
||||
Value,
|
||||
Other,
|
||||
Note
|
||||
}
|
||||
/// <summary>
|
||||
/// 得到所有下级ID
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="isMe">是包含自己</param>
|
||||
/// <returns></returns>
|
||||
public List<string> GetAllChildsId(string id, bool isMe = true)
|
||||
{
|
||||
List<string> guids = new();
|
||||
if (isMe)
|
||||
{
|
||||
guids.Add(id);
|
||||
}
|
||||
var allChilds = GetAllChilds(id);
|
||||
foreach (var child in allChilds)
|
||||
{
|
||||
guids.Add(child.Id);
|
||||
}
|
||||
return guids;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据ID得到所有下级
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="isMe">是否包含自己</param>
|
||||
/// <returns></returns>
|
||||
public List<RoadFlow.Model.rf_dictionary> GetAllChilds(string id, bool isMe = false)
|
||||
{
|
||||
List<RoadFlow.Model.rf_dictionary> dictionaries = new();
|
||||
var dict =id.IsGuid()? this.GetOneById(id):this.GetOneBy(x=>x.Code==id);
|
||||
if (null == dict)
|
||||
{
|
||||
return dictionaries;
|
||||
}
|
||||
if (isMe)
|
||||
{
|
||||
dictionaries.Add(dict);
|
||||
}
|
||||
AddChilds(dict, dictionaries);
|
||||
return dictionaries;
|
||||
}
|
||||
/// <summary>
|
||||
/// 递归添加下级
|
||||
/// </summary>
|
||||
/// <param name="dictionary"></param>
|
||||
/// <param name="dictionaries"></param>
|
||||
private void AddChilds(RoadFlow.Model.rf_dictionary dictionary, List<RoadFlow.Model.rf_dictionary> dictionaries)
|
||||
{
|
||||
var childs = GetChilds(dictionary.Id);
|
||||
if (childs.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (RoadFlow.Model.rf_dictionary child in childs)
|
||||
{
|
||||
dictionaries.Add(child);
|
||||
AddChilds(child, dictionaries);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID得到下级
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public List<RoadFlow.Model.rf_dictionary> GetChilds(string id)
|
||||
{
|
||||
return this.GetAll().FindAll(p => p.ParentId == id.ToString()).OrderBy(p => p.Sort).ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据唯一代码得到ID
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
public string GetIdByCode(string code)
|
||||
{
|
||||
var dict = this.GetOneBy(a => a.Code.EqualsIgnoreCase(code));
|
||||
return null == dict ? string.Empty : dict.Id;
|
||||
}
|
||||
/// <summary>
|
||||
/// 得到字典根
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public RoadFlow.Model.rf_dictionary GetRoot()
|
||||
{
|
||||
return this.GetAll().Find(p => p.ParentId == string.Empty);
|
||||
}
|
||||
/// <summary>
|
||||
/// 判断一个字典是否有下级字典
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public bool HasChilds(string id)
|
||||
{
|
||||
return this.GetAll().Exists(p => p.ParentId == id.ToString());
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得到多语言标题
|
||||
/// </summary>
|
||||
/// <param name="dictionary">字典实体</param>
|
||||
/// <param name="language">语言</param>
|
||||
/// <returns></returns>
|
||||
public string GetLanguageTitle(RoadFlow.Model.rf_dictionary dictionary, string language = "")
|
||||
{
|
||||
string title = string.Empty;
|
||||
if (null == dictionary)
|
||||
{
|
||||
return title;
|
||||
}
|
||||
if (language.IsNullOrWhiteSpace())
|
||||
{
|
||||
language = Tools.GetCurrentLanguage();
|
||||
}
|
||||
switch (language)
|
||||
{
|
||||
case "en-US":
|
||||
title = dictionary.Title_en;
|
||||
break;
|
||||
case "zh":
|
||||
title = dictionary.Title_zh;
|
||||
break;
|
||||
default:
|
||||
title = dictionary.Title;
|
||||
break;
|
||||
}
|
||||
if (title.IsNullOrWhiteSpace())
|
||||
{
|
||||
title = dictionary.Title;
|
||||
}
|
||||
return title;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID查询字典标题
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="language">语言</param>
|
||||
/// <returns></returns>
|
||||
public string GetTitle(string id, string language = "")
|
||||
{
|
||||
var dict = this.GetOneById(id);
|
||||
return null == dict ? "" : GetLanguageTitle(dict, language);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按code获取字典项
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
public RoadFlow.Model.rf_dictionary GetOneByCode(string code)
|
||||
{
|
||||
return code.IsNullOrWhiteSpace() ? null : this.GetAll().Find(x => x.Code.EqualsIgnoreCase(code));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID得到选项
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="valueField">值字段,默认id</param>
|
||||
/// <param name="value">默认值</param>
|
||||
/// <param name="isAllChild">是否显示所有下级</param>
|
||||
/// <param name="existsFlowType">是否包含流程分类(流程设计时选表单不能选择流程分类)</param>
|
||||
/// <returns></returns>
|
||||
public string GetOptionsByID(string id, ValueField valueField = ValueField.Id, string value = "", bool isAllChild = true, bool existsFlowType = true)
|
||||
{
|
||||
if (id.IsNullOrWhiteSpace())
|
||||
{
|
||||
return "";
|
||||
}
|
||||
var childs = isAllChild ? GetAllChilds(id) : GetChilds(id);
|
||||
StringBuilder options = new StringBuilder(childs.Count * 60);
|
||||
StringBuilder space = new StringBuilder();
|
||||
var flowChilds = existsFlowType ? new List<Model.rf_dictionary>() : GetAllChilds("system_applibrarytype_flow", true);//取出流程分类的下级,为了如果不包含流程分类时要排除
|
||||
foreach (var child in childs)
|
||||
{
|
||||
if (child.Status == 1)//标记为已删除的不作为选项
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!existsFlowType && flowChilds.Exists(p => p.Id == child.Id))//如果不包含流程分类要排除
|
||||
{
|
||||
continue;
|
||||
}
|
||||
space.Clear();
|
||||
int parentCount = GetParentCount(childs, child);
|
||||
for (int i = 0; i < parentCount; i++)
|
||||
{
|
||||
space.Append(" ");
|
||||
}
|
||||
if (parentCount > 0)
|
||||
{
|
||||
space.Append("├");
|
||||
}
|
||||
string value1 = GetOptionValue(valueField, child);
|
||||
options.AppendFormat("<option value=\"{0}\"{1}>{2}{3}</option>", value1, value1.Equals(value) ? " selected=\"selected\"" : "", space.ToString(), GetLanguageTitle(child));
|
||||
}
|
||||
return options.ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// 得到一个字典项的上级节点数
|
||||
/// </summary>
|
||||
/// <param name="dictList"></param>
|
||||
/// <param name="dict"></param>
|
||||
/// <returns></returns>
|
||||
private int GetParentCount(List<Model.rf_dictionary> dictList, Model.rf_dictionary dict)
|
||||
{
|
||||
int parent = 0;
|
||||
Model.rf_dictionary parentDict = dictList.Find(p => p.Id == dict.ParentId);
|
||||
while (parentDict != null)
|
||||
{
|
||||
parentDict = dictList.Find(p => p.Id == parentDict.ParentId);
|
||||
parent++;
|
||||
}
|
||||
return parent;
|
||||
}
|
||||
/// <summary>
|
||||
/// 得到选项值
|
||||
/// </summary>
|
||||
/// <param name="valueField"></param>
|
||||
/// <param name="dictionary"></param>
|
||||
/// <returns></returns>
|
||||
private string GetOptionValue(ValueField valueField, Model.rf_dictionary dictionary)
|
||||
{
|
||||
string value = string.Empty;
|
||||
switch (valueField)
|
||||
{
|
||||
case ValueField.Id:
|
||||
value = dictionary.Id.ToString();
|
||||
break;
|
||||
case ValueField.Code:
|
||||
value = dictionary.Code;
|
||||
break;
|
||||
case ValueField.Note:
|
||||
value = dictionary.Note;
|
||||
break;
|
||||
case ValueField.Other:
|
||||
value = dictionary.Other;
|
||||
break;
|
||||
case ValueField.Title:
|
||||
value = GetLanguageTitle(dictionary, Tools.GetCurrentLanguage());
|
||||
break;
|
||||
case ValueField.Value:
|
||||
value = dictionary.Value;
|
||||
break;
|
||||
}
|
||||
return value ?? string.Empty;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据字符串得到ValueField
|
||||
/// </summary>
|
||||
/// <param name="valueField"></param>
|
||||
/// <returns></returns>
|
||||
public ValueField GetValueField(string valueField)
|
||||
{
|
||||
return valueField.IsNullOrEmpty() ? ValueField.Id : valueField switch
|
||||
{
|
||||
"code" => ValueField.Code,
|
||||
"value" => ValueField.Value,
|
||||
"title" => ValueField.Title,
|
||||
"note" => ValueField.Note,
|
||||
"other" => ValueField.Other,
|
||||
_ => ValueField.Id,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID得到选项(返回jarray,vue项目用)
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="valueField">值字段,默认id</param>
|
||||
/// <param name="value">默认值</param>
|
||||
/// <param name="isAllChild">是否显示所有下级</param>
|
||||
/// <param name="isSelectParent">是否可以选择上级</param>
|
||||
/// <returns></returns>
|
||||
public JArray GetArrayOptionsByID(string id, ValueField valueField = ValueField.Id, string value = "", bool isAllChild = true, bool isSelectParent = true)
|
||||
{
|
||||
JArray jArray = new JArray();
|
||||
if (id.IsNullOrWhiteSpace())
|
||||
{
|
||||
return jArray;
|
||||
}
|
||||
string lang = Tools.GetCurrentLanguage();
|
||||
var childs = isAllChild ? GetAllChilds(id) : GetChilds(id);
|
||||
StringBuilder space = new StringBuilder();
|
||||
foreach (var child in childs)
|
||||
{
|
||||
if (child.Status == 1)//标记为已删除的不作为选项
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
space.Clear();
|
||||
int parentCount = GetParentCount(childs, child);
|
||||
for (int i = 0; i < parentCount; i++)
|
||||
{
|
||||
space.Append(" ");
|
||||
}
|
||||
if (parentCount > 0)
|
||||
{
|
||||
space.Append("├");
|
||||
}
|
||||
string value1 = GetOptionValue(valueField, child);
|
||||
jArray.Add(new JObject() {
|
||||
{ "value", value1 },
|
||||
{ "title", space.ToString() + GetLanguageTitle(child, lang) },
|
||||
{ "selected", value1.EqualsIgnoreCase(value) },
|
||||
|
||||
});
|
||||
}
|
||||
return jArray;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID得到所有下级(控件选项)
|
||||
/// </summary>
|
||||
/// <param name="id">根节点字典id</param>
|
||||
/// <param name="valueField">值字段</param>
|
||||
/// <param name="isRoot">是否显示根节点</param>
|
||||
/// <param name="lang">标题语言</param>
|
||||
/// <returns></returns>
|
||||
public JArray GetAllChildsArray(string id, ValueField valueField, bool isRoot = false, string lang = "")
|
||||
{
|
||||
var childs = GetChilds(id);
|
||||
JArray jArray = new JArray();
|
||||
foreach (Model.rf_dictionary child in childs)
|
||||
{
|
||||
JObject jObject = child.ToJObject();
|
||||
jObject.Add("Value1", child.Value);
|
||||
jObject.Remove("Value");
|
||||
jObject.Add("value", GetOptionValue(valueField, child));
|
||||
jObject.Add("label", GetLanguageTitle(child, lang));
|
||||
jArray.Add(jObject);
|
||||
AddChildsArray(child, jObject, valueField, lang);
|
||||
}
|
||||
JArray jArray1;
|
||||
if (isRoot)
|
||||
{
|
||||
var rootDict = GetOneById(id);
|
||||
if (null == rootDict)
|
||||
{
|
||||
return new JArray();
|
||||
}
|
||||
JObject rootObj = rootDict.ToJObject();
|
||||
rootObj.Add("Value1", rootDict.Value);
|
||||
rootObj.Add("value", GetOptionValue(valueField, rootDict));
|
||||
rootObj.Add("label", GetLanguageTitle(rootDict, lang));
|
||||
rootObj.Add("children", jArray);
|
||||
rootObj.Add("isLeaf", jArray.Count == 0);
|
||||
rootObj.Add("slots", new JObject() { { "icon", "custom" } });
|
||||
jArray1 = new JArray() { rootObj };
|
||||
}
|
||||
else
|
||||
{
|
||||
jArray1 = jArray;
|
||||
}
|
||||
return jArray1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 递归添加下级(控件选项)
|
||||
/// </summary>
|
||||
/// <param name="dictionary"></param>
|
||||
/// <param name="dictionaries"></param>
|
||||
private void AddChildsArray(Model.rf_dictionary dictionary, JObject jObject, ValueField valueField, string lang = "")
|
||||
{
|
||||
var childs = GetChilds(dictionary.Id);
|
||||
if (childs.Count == 0)
|
||||
{
|
||||
jObject.Add("isLeaf", true);
|
||||
jObject.Add("slots", new JObject() { { "icon", "custom" } });
|
||||
return;
|
||||
}
|
||||
JArray jArray = new JArray();
|
||||
jObject.Add("children", jArray);
|
||||
jObject.Add("isLeaf", false);
|
||||
jObject.Add("slots", new JObject() { { "icon", "custom" } });
|
||||
foreach (Model.rf_dictionary child in childs)
|
||||
{
|
||||
JObject jObject1 = child.ToJObject();
|
||||
jObject1.Add("Value1", child.Value);
|
||||
jObject1.Remove("Value");
|
||||
jObject1.Add("value", GetOptionValue(valueField, child));
|
||||
jObject1.Add("label", GetLanguageTitle(child, lang));
|
||||
jArray.Add(jObject1);
|
||||
AddChildsArray(child, jObject1, valueField, lang);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID得到选项(返回jarray,vue项目用)
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="valueField">值字段,默认id</param>
|
||||
/// <param name="value">默认值</param>
|
||||
/// <param name="isAllChild">是否显示所有下级</param>
|
||||
/// <param name="isSelectParent">是否可以选择上级</param>
|
||||
/// <returns></returns>
|
||||
public JArray GetArrayComboxsByID(string id, ValueField valueField = ValueField.Id, string value = "", bool isAllChild = true, bool isSelectParent = true)
|
||||
{
|
||||
JArray jArray = new JArray();
|
||||
if (id.IsNullOrWhiteSpace())
|
||||
{
|
||||
return jArray;
|
||||
}
|
||||
var childs = isAllChild ? GetAllChilds(id) : GetChilds(id);
|
||||
string lang = Tools.GetCurrentLanguage();
|
||||
foreach (var child in childs)
|
||||
{
|
||||
if (child.Status == 1)//标记为已删除的不作为选项
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int parentCount = GetParentCount(childs, child);
|
||||
string value1 = GetOptionValue(valueField, child);
|
||||
jArray.Add(new JObject() {
|
||||
{ "value", value1 },
|
||||
{ "title", GetLanguageTitle(child, lang)},
|
||||
{ "selected", value1.EqualsIgnoreCase(value) },
|
||||
{ "parentCount", parentCount },
|
||||
{ "group", !isSelectParent && childs.Exists(p=>p.ParentId == child.Id) },
|
||||
});
|
||||
}
|
||||
return jArray;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到单选或复选按钮组选项
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="valueField">值字段</param>
|
||||
/// <returns></returns>
|
||||
public JArray GetRadioOrCheckboxItems(string id, ValueField valueField = ValueField.Id)
|
||||
{
|
||||
JArray jArray = new JArray();
|
||||
if (id.IsNullOrWhiteSpace())
|
||||
{
|
||||
return jArray;
|
||||
}
|
||||
var childs = GetChilds(id);
|
||||
string lang = Tools.GetCurrentLanguage();
|
||||
foreach (var child in childs)
|
||||
{
|
||||
if (child.Status == 1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
string value1 = GetOptionValue(valueField, child);
|
||||
jArray.Add(new JObject() {
|
||||
{ "value", value1 },
|
||||
{ "title", GetLanguageTitle(child, lang) },
|
||||
});
|
||||
}
|
||||
return jArray;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个字典下级的最大排序号
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public int GetMaxSort(string id)
|
||||
{
|
||||
var childs = GetChilds(id);
|
||||
return childs.Count == 0 ? 5 : childs.Max(p => p.Sort) + 5;
|
||||
}
|
||||
/// <summary>
|
||||
/// 检查唯一代码是否重复
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="code"></param>
|
||||
/// <returns>true 没有重复 false 重复</returns>
|
||||
public bool CheckCode(string id, string code)
|
||||
{
|
||||
var dict = GetOneById(code);
|
||||
return null == dict ? true : dict.Id == id;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到字典根ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetRootId()
|
||||
{
|
||||
var root = GetRoot();
|
||||
return null == root ? string.Empty : root.Id;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导入数据字典
|
||||
/// </summary>
|
||||
/// <param name="json"></param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
public string Import(string json, IStringLocalizer localizer = null)
|
||||
{
|
||||
if (json.IsNullOrWhiteSpace())
|
||||
{
|
||||
return localizer == null ? "要导入的json为空!" : localizer["ImportJsonEmpty"].Value;
|
||||
}
|
||||
Newtonsoft.Json.Linq.JArray jArray = null;
|
||||
try
|
||||
{
|
||||
jArray = Newtonsoft.Json.Linq.JArray.Parse(json);
|
||||
}
|
||||
catch
|
||||
{
|
||||
jArray = null;
|
||||
}
|
||||
if (null == jArray)
|
||||
{
|
||||
return localizer == null ? "json解析错误!" : localizer["JsonParseError"].Value;
|
||||
}
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
foreach (Newtonsoft.Json.Linq.JObject jObject in jArray)
|
||||
{
|
||||
try
|
||||
{
|
||||
Model.rf_dictionary dictionaryModel = jObject.ToObject<Model.rf_dictionary>();
|
||||
if (null == dictionaryModel)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (GetOneById(dictionaryModel.Id) != null)
|
||||
{
|
||||
Update(dictionaryModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
Add(dictionaryModel);
|
||||
}
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
stringBuilder.Append(err.Message + ";");
|
||||
new Log().Add(err);
|
||||
}
|
||||
}
|
||||
return stringBuilder.Length == 0 ? "1" : stringBuilder.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
158
back_end_code/Ewide.RoadFlow/Data/Dictionary/IDictionary.cs
Normal file
158
back_end_code/Ewide.RoadFlow/Data/Dictionary/IDictionary.cs
Normal file
@@ -0,0 +1,158 @@
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static RoadFlow.Data.Dictionary;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IDictionary:IRoadFlowRepository<RoadFlow.Model.rf_dictionary>
|
||||
{
|
||||
/// <summary>
|
||||
/// 得到所有下级ID
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="isMe">是包含自己</param>
|
||||
/// <returns></returns>
|
||||
List<string> GetAllChildsId(string id, bool isMe = true);
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID得到所有下级
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="isMe">是否包含自己</param>
|
||||
/// <returns></returns>
|
||||
List<RoadFlow.Model.rf_dictionary> GetAllChilds(string id, bool isMe = false);
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID得到下级
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
List<RoadFlow.Model.rf_dictionary> GetChilds(string id);
|
||||
|
||||
/// <summary>
|
||||
/// 根据唯一代码得到ID
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
string GetIdByCode(string code);
|
||||
|
||||
/// <summary>
|
||||
/// 得到字典根
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
RoadFlow.Model.rf_dictionary GetRoot();
|
||||
|
||||
/// <summary>
|
||||
/// 判断一个字典是否有下级字典
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
bool HasChilds(string id);
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得到多语言标题
|
||||
/// </summary>
|
||||
/// <param name="dictionary">字典实体</param>
|
||||
/// <param name="language">语言</param>
|
||||
/// <returns></returns>
|
||||
string GetLanguageTitle(RoadFlow.Model.rf_dictionary dictionary, string language = "");
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID查询字典标题
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="language">语言</param>
|
||||
/// <returns></returns>
|
||||
string GetTitle(string id, string language = "");
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 按code获取字典项
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
RoadFlow.Model.rf_dictionary GetOneByCode(string code);
|
||||
/// <summary>
|
||||
/// 根据字符串得到ValueField
|
||||
/// </summary>
|
||||
/// <param name="valueField"></param>
|
||||
/// <returns></returns>
|
||||
public ValueField GetValueField(string valueField);
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID得到选项(返回jarray,vue项目用)
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="valueField">值字段,默认id</param>
|
||||
/// <param name="value">默认值</param>
|
||||
/// <param name="isAllChild">是否显示所有下级</param>
|
||||
/// <param name="isSelectParent">是否可以选择上级</param>
|
||||
/// <returns></returns>
|
||||
public JArray GetArrayOptionsByID(string id, ValueField valueField = ValueField.Id, string value = "", bool isAllChild = true, bool isSelectParent = true);
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID得到所有下级(控件选项)
|
||||
/// </summary>
|
||||
/// <param name="id">根节点字典id</param>
|
||||
/// <param name="valueField">值字段</param>
|
||||
/// <param name="isRoot">是否显示根节点</param>
|
||||
/// <param name="lang">标题语言</param>
|
||||
/// <returns></returns>
|
||||
public JArray GetAllChildsArray(string id, ValueField valueField, bool isRoot = false, string lang = "");
|
||||
/// <summary>
|
||||
/// 根据ID得到选项(返回jarray,vue项目用)
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="valueField">值字段,默认id</param>
|
||||
/// <param name="value">默认值</param>
|
||||
/// <param name="isAllChild">是否显示所有下级</param>
|
||||
/// <param name="isSelectParent">是否可以选择上级</param>
|
||||
/// <returns></returns>
|
||||
public JArray GetArrayComboxsByID(string id, ValueField valueField = ValueField.Id, string value = "", bool isAllChild = true, bool isSelectParent = true);
|
||||
|
||||
/// <summary>
|
||||
/// 得到单选或复选按钮组选项
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="valueField">值字段</param>
|
||||
/// <returns></returns>
|
||||
public JArray GetRadioOrCheckboxItems(string id, ValueField valueField = ValueField.Id);
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个字典下级的最大排序号
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public int GetMaxSort(string id);
|
||||
|
||||
/// <summary>
|
||||
/// 检查唯一代码是否重复
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="code"></param>
|
||||
/// <returns>true 没有重复 false 重复</returns>
|
||||
public bool CheckCode(string id, string code);
|
||||
/// <summary>
|
||||
/// 得到字典根ID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetRootId();
|
||||
|
||||
/// <summary>
|
||||
/// 导入数据字典
|
||||
/// </summary>
|
||||
/// <param name="json"></param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
public string Import(string json, IStringLocalizer localizer = null);
|
||||
}
|
||||
}
|
||||
1218
back_end_code/Ewide.RoadFlow/Data/Flow/Flow.cs
Normal file
1218
back_end_code/Ewide.RoadFlow/Data/Flow/Flow.cs
Normal file
File diff suppressed because it is too large
Load Diff
154
back_end_code/Ewide.RoadFlow/Data/Flow/IFlow.cs
Normal file
154
back_end_code/Ewide.RoadFlow/Data/Flow/IFlow.cs
Normal file
@@ -0,0 +1,154 @@
|
||||
using Microsoft.Extensions.Localization;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IFlow:IRoadFlowRepository<Model.rf_flow>
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询一页数据
|
||||
/// </summary>
|
||||
/// <param name="count"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="number"></param>
|
||||
/// <param name="flowId">可管理的流程ID</param>
|
||||
/// <param name="whereLambda"></param>
|
||||
/// <param name="orderbyLambda"></param>
|
||||
/// <param name="isAsc"></param>
|
||||
/// <returns></returns>
|
||||
List<Model.rf_flow> GetPagerList(out int count, int size, int number, List<string> flowIdList, string name, List<string> types, string order, int status = -1);
|
||||
/// <summary>
|
||||
/// 得到一个用户可管理的流程
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public List<string> GetManageFlowIds(string userId);
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个用户可管理的流程
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_flow> GetManageFlow(string userId);
|
||||
|
||||
/// <summary>
|
||||
/// 得到状态显示
|
||||
/// </summary>
|
||||
/// <param name="status"></param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
public string GetStatusTitle(int status, IStringLocalizer localizer = null);
|
||||
|
||||
/// <summary>
|
||||
/// 保存流程
|
||||
/// </summary>
|
||||
/// <param name="json"></param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
public string Save(string json, IStringLocalizer localizer = null);
|
||||
/// <summary>
|
||||
/// 流程另存为
|
||||
/// </summary>
|
||||
/// <param name="flowId">流程ID</param>
|
||||
/// <param name="newFlowName">新的流程名称</param>
|
||||
/// <returns>返回guid字符串表示成功(新流程的ID),其它为错误信息</returns>
|
||||
/// <param name="localizer">语言包</param>
|
||||
public string SaveAs(string flowId, string newFlowName, IStringLocalizer localizer = null);
|
||||
|
||||
/// <summary>
|
||||
/// 安装流程
|
||||
/// </summary>
|
||||
/// <param name="json"></param>
|
||||
/// <param name="logTitle">日志标题</param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
public string Install(string json, IStringLocalizer localizer = null);
|
||||
/// <summary>
|
||||
/// 安装流程
|
||||
/// </summary>
|
||||
/// <param name="flow">流程实体</param>
|
||||
/// <param name="appLibrary">应用程序库实体</param>
|
||||
public int Install(Model.rf_flow flow);
|
||||
/// <summary>
|
||||
/// 卸载或作删除标记流程
|
||||
/// </summary>
|
||||
/// <param name="json"></param>
|
||||
/// <param name="logTitle">日志标题</param>
|
||||
/// <param name="status">状态,2卸载 3删除</param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
public string UnInstall(string json, int status, IStringLocalizer localizer = null);
|
||||
|
||||
/// <summary>
|
||||
/// 得到流程运行时实体
|
||||
/// </summary>
|
||||
/// <param name="json">流程设置JSON</param>
|
||||
/// <param name="errMsg">加载错误时的错误信息</param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
|
||||
public Model.FlowRun GetFlowRunModel(string json, out string errMsg, IStringLocalizer localizer = null);
|
||||
|
||||
/// <summary>
|
||||
/// 查询一个流程
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Model.rf_flow Get(string id);
|
||||
|
||||
/// <summary>
|
||||
/// 导入流程
|
||||
/// </summary>
|
||||
/// <param name="json"></param>
|
||||
/// <param name="createFormFile">是否要创建表单文件,VUE导入时不需要创建</param>
|
||||
/// <returns>返回1表示成功,其它为错误信息</returns>
|
||||
public string ImportFlow(string json, bool createFormFile = true);
|
||||
/// <summary>
|
||||
/// 查询一页数据
|
||||
/// </summary>
|
||||
/// <param name="count"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="number"></param>
|
||||
/// <param name="flowIdList"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="order"></param>
|
||||
/// <param name="status">状态-1表示查询未删除的流程</param>
|
||||
/// <returns></returns>
|
||||
List<Model.rf_flow> GetPagerList(out int count, int size, int number, List<string> flowIdList, string name, string type, string order, int status = -1);
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个用户可以发起的流程运行时实体列表
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.FlowRun> GetStartFlows(string userId);
|
||||
|
||||
/// <summary>
|
||||
/// 得到流程运行时实体
|
||||
/// </summary>
|
||||
/// <param name="id">流程ID</param>
|
||||
/// <param name="isCache">是否从缓存中取</param>
|
||||
/// <param name="currentTask">当前任务实体(动态步骤时要取动态的步骤流程运行时实体)</param>
|
||||
/// <returns></returns>
|
||||
public Model.FlowRun GetFlowRunModel(string id, bool isCache = true, RoadFlow.Model.rf_flowtask currentTask = null);
|
||||
/// <summary>
|
||||
/// 得到一个步骤的所有后续步骤集合
|
||||
/// </summary>
|
||||
/// <param name="flowRunModel"></param>
|
||||
/// <param name="stepId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.FlowRunModel.Step> GetAllNextSteps(Model.FlowRun flowRunModel, Guid stepId);
|
||||
/// <summary>
|
||||
/// 得到一个用户可管理实例的流程
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public List<string> GetManageInstanceFlowIds(string userId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using Furion.DependencyInjection;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class FlowApiSystem:RoadFlowRepository<RoadFlow.Model.rf_flowapisystem>,IFlowApiSystem, ITransient
|
||||
{
|
||||
/// <summary>
|
||||
/// 删除一批系统
|
||||
/// </summary>
|
||||
/// <param name="flowApiSystems">系统实体</param>
|
||||
/// <returns></returns>
|
||||
public int Delete(Model.rf_flowapisystem[] flowApiSystems)
|
||||
{
|
||||
ClearCache();
|
||||
List<string> ids = new List<string>();
|
||||
foreach (var obj in flowApiSystems)
|
||||
ids.Add(obj.Id);
|
||||
return this.DeleteBy(x => ids.Contains(x.Id));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IFlowApiSystem: IRoadFlowRepository<RoadFlow.Model.rf_flowapisystem>
|
||||
{
|
||||
/// <summary>
|
||||
/// 删除一批系统
|
||||
/// </summary>
|
||||
/// <param name="flowApiSystems">系统实体</param>
|
||||
/// <returns></returns>
|
||||
int Delete(Model.rf_flowapisystem[] flowApiSystems);
|
||||
}
|
||||
}
|
||||
31
back_end_code/Ewide.RoadFlow/Data/FlowArchive/FlowArchive.cs
Normal file
31
back_end_code/Ewide.RoadFlow/Data/FlowArchive/FlowArchive.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class FlowArchive: RoadFlowRepository<RoadFlow.Model.rf_flowarchive>, IFlowArchive, ITransient
|
||||
{
|
||||
public List<Model.rf_flowarchive> GetPagerData(out int count, int size, int number, string flowId, string stepName, string title, string date1, string date2, string order)
|
||||
{
|
||||
|
||||
int total=0;
|
||||
var rtn = db.Queryable<Model.rf_flowarchive>()
|
||||
.WhereIF(flowId.IsGuid(), x => x.FlowId == flowId)
|
||||
.WhereIF(!stepName.IsNullOrWhiteSpace(), x => x.StepName.Contains(stepName))
|
||||
.WhereIF(!title.IsNullOrWhiteSpace(), x => x.Title.Contains(title))
|
||||
.WhereIF(date1.IsDateTime(out DateTime dt1), x => x.WriteTime >= dt1)
|
||||
.WhereIF(date2.IsDateTime(out DateTime dt2), x => x.WriteTime >= dt2)
|
||||
.OrderByIF(!order.IsNullOrWhiteSpace(), order.FilterSelectSql())
|
||||
.ToPageList(number, size, ref total).ToList();
|
||||
count = total;
|
||||
return rtn;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IFlowArchive: IRoadFlowRepository<RoadFlow.Model.rf_flowarchive>
|
||||
{
|
||||
public List<Model.rf_flowarchive> GetPagerData(out int count, int size, int number, string flowId, string stepName, string title, string date1, string date2, string order);
|
||||
|
||||
}
|
||||
}
|
||||
55
back_end_code/Ewide.RoadFlow/Data/FlowButton/FlowButton.cs
Normal file
55
back_end_code/Ewide.RoadFlow/Data/FlowButton/FlowButton.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using Furion.DependencyInjection;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class FlowButton:RoadFlowRepository<RoadFlow.Model.rf_flowbutton>,IFlowButton, ITransient
|
||||
{
|
||||
/// <summary>
|
||||
/// 得到一个按钮
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Model.rf_flowbutton Get(string id)
|
||||
{
|
||||
return GetOneById(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到按钮显示标题(多语言时)
|
||||
/// </summary>
|
||||
/// <param name="language">语言</param>
|
||||
/// <param name="flowButton">按钮实体</param>
|
||||
/// <param name="note">输出备注</param>
|
||||
/// <returns></returns>
|
||||
public string GetLanguageTitle(Model.rf_flowbutton flowButton, out string note, string language = "zh-CN")
|
||||
{
|
||||
note = string.Empty;
|
||||
if (null == flowButton)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
string title;
|
||||
switch (language)
|
||||
{
|
||||
case "en-US":
|
||||
title = flowButton.Title_en;
|
||||
note = flowButton.Note_en;
|
||||
break;
|
||||
case "zh":
|
||||
title = flowButton.Title_zh;
|
||||
note = flowButton.Note_zh;
|
||||
break;
|
||||
default:
|
||||
title = flowButton.Title;
|
||||
note = flowButton.Note;
|
||||
break;
|
||||
}
|
||||
return title;
|
||||
}
|
||||
}
|
||||
}
|
||||
26
back_end_code/Ewide.RoadFlow/Data/FlowButton/IFlowButton.cs
Normal file
26
back_end_code/Ewide.RoadFlow/Data/FlowButton/IFlowButton.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IFlowButton:IRoadFlowRepository<RoadFlow.Model.rf_flowbutton>
|
||||
{
|
||||
/// <summary>
|
||||
/// 得到一个按钮
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Model.rf_flowbutton Get(string id);
|
||||
/// <summary>
|
||||
/// 得到按钮显示标题(多语言时)
|
||||
/// </summary>
|
||||
/// <param name="language">语言</param>
|
||||
/// <param name="flowButton">按钮实体</param>
|
||||
/// <param name="note">输出备注</param>
|
||||
/// <returns></returns>
|
||||
public string GetLanguageTitle(Model.rf_flowbutton flowButton, out string note, string language = "zh-CN");
|
||||
}
|
||||
}
|
||||
47
back_end_code/Ewide.RoadFlow/Data/FlowComment/FlowComment.cs
Normal file
47
back_end_code/Ewide.RoadFlow/Data/FlowComment/FlowComment.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using Furion.DependencyInjection;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class FlowComment:RoadFlowRepository<RoadFlow.Model.rf_flowcomment>,IFlowComment, ITransient
|
||||
{
|
||||
/// <summary>
|
||||
/// 得到一个用户可以使用的意见
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_flowcomment> GetListByUserId(string userId)
|
||||
{
|
||||
var all = GetAll();
|
||||
return all.FindAll(p => p.UserId == string.Empty || p.UserId == userId).Distinct(new Model.rf_flowcomment()).OrderBy(p => p.AddType).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询一页数据
|
||||
/// </summary>
|
||||
/// <param name="count"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="number"></param>
|
||||
/// <param name="comment"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="order"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_flowcomment> GetPagerList(out int count, int size, int number, string comment, string userId, string order)
|
||||
{
|
||||
int total = 0;
|
||||
var rtn =db.Queryable<Model.rf_flowcomment>()
|
||||
.WhereIF(!comment.IsNullOrWhiteSpace(), x => x.Comments.Contains(comment))
|
||||
.WhereIF(userId.IsGuid(), x => x.UserId == userId)
|
||||
.OrderByIF(!order.IsNullOrWhiteSpace(), order)
|
||||
.ToPageList(number, size, ref total);
|
||||
count = total;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IFlowComment : IRoadFlowRepository<RoadFlow.Model.rf_flowcomment>
|
||||
{
|
||||
/// <summary>
|
||||
/// 得到一个用户可以使用的意见
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_flowcomment> GetListByUserId(string userId);
|
||||
|
||||
/// <summary>
|
||||
/// 查询一页数据
|
||||
/// </summary>
|
||||
/// <param name="count"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="number"></param>
|
||||
/// <param name="comment"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="order"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_flowcomment> GetPagerList(out int count, int size, int number, string comment, string userId, string order);
|
||||
}
|
||||
}
|
||||
211
back_end_code/Ewide.RoadFlow/Data/FlowDynamic/FlowDynamic.cs
Normal file
211
back_end_code/Ewide.RoadFlow/Data/FlowDynamic/FlowDynamic.cs
Normal file
@@ -0,0 +1,211 @@
|
||||
using Ewide.Core;
|
||||
using Furion.DependencyInjection;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class FlowDynamic:RoadFlowRepository<RoadFlow.Model.rf_flowdynamic>,IFlowDynamic, ITransient
|
||||
{
|
||||
private readonly IUserManager _userManager = Furion.App.GetService<IUserManager>();
|
||||
/// <summary>
|
||||
/// 查询一个动态流程
|
||||
/// </summary>
|
||||
/// <param name="StepId">动态步骤ID</param>
|
||||
/// <param name="groupId">组ID</param>
|
||||
/// <returns></returns>
|
||||
public Model.rf_flowdynamic Get(string StepId, string groupId)
|
||||
{
|
||||
return GetOneBy(p => p.StepId == StepId && p.GroupId == groupId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加动态流程
|
||||
/// </summary>
|
||||
/// <param name="executeModel">流程执行参数实体</param>
|
||||
/// <param name="groupTasks">当前组任务List</param>
|
||||
/// <returns></returns>
|
||||
public Model.FlowRun Add(Model.FlowRunModel.Execute executeModel, List<Model.rf_flowtask> groupTasks)
|
||||
{
|
||||
if (null == executeModel || executeModel.GroupId.IsEmptyGuid())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
string oldFlowJSON = string.Empty;
|
||||
if (groupTasks != null && groupTasks.Count > 0 && groupTasks.Exists(p => p.BeforeStepId.IsNotEmptyGuid()))
|
||||
{
|
||||
var flowDynamicModel = new FlowDynamic().Get(groupTasks.OrderByDescending(p => p.Sort).Where(p => p.BeforeStepId.IsNotEmptyGuid()).First().BeforeStepId, executeModel.GroupId.ToString());
|
||||
if (null != flowDynamicModel)
|
||||
{
|
||||
oldFlowJSON = flowDynamicModel.FlowJSON;
|
||||
}
|
||||
}
|
||||
if (oldFlowJSON.IsNullOrWhiteSpace())
|
||||
{
|
||||
var flowModel = new Flow().Get(executeModel.FlowId.ToString());
|
||||
if (null != flowModel)
|
||||
{
|
||||
oldFlowJSON = flowModel.RunJSON.IsNullOrWhiteSpace() ? flowModel.DesignerJSON : flowModel.RunJSON;
|
||||
}
|
||||
}
|
||||
if (oldFlowJSON.IsNullOrWhiteSpace())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
JObject jObject = null;
|
||||
try
|
||||
{
|
||||
jObject = JObject.Parse(oldFlowJSON);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (!jObject.ContainsKey("steps"))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var stepArray = jObject.Value<JArray>("steps");
|
||||
var lineArray = jObject.Value<JArray>("lines");
|
||||
var steps = executeModel.Steps.FindAll(p => p.beforeStepId.IsNotEmptyGuid()).GroupBy(p => p.beforeStepId).ToList();
|
||||
string flowJSON = string.Empty;
|
||||
UserDummy buser = new UserDummy();
|
||||
foreach (var step in steps)
|
||||
{
|
||||
int stepIndex = 0;
|
||||
foreach (var (stepId, stepName, beforeStepId, parallelorserial, receiveUsers, completedTime) in step)
|
||||
{
|
||||
var oldStepJsons = stepArray.Where(p => p["id"].ToString().EqualsIgnoreCase(beforeStepId.Value.ToString()));
|
||||
if (oldStepJsons.Count() == 0)
|
||||
{
|
||||
stepIndex++;
|
||||
continue;
|
||||
}
|
||||
var oldStepJson = oldStepJsons.First();
|
||||
if (stepId != beforeStepId)
|
||||
{
|
||||
var stepJson = oldStepJson.DeepClone();
|
||||
stepJson["id"] = stepId;
|
||||
stepJson["name"] = stepName;
|
||||
stepJson["dynamic"] = 0;
|
||||
stepJson["behavior"]["runSelect"] = 0;
|
||||
stepJson["behavior"]["defaultHandler"] = buser.GetUserIds(receiveUsers);
|
||||
stepJson["position"]["y"] = stepJson["position"]["y"].ToString().ToInt() + (70 * stepIndex);
|
||||
stepArray.Add(stepJson);
|
||||
}
|
||||
else
|
||||
{
|
||||
oldStepJson["dynamic"] = 0;
|
||||
oldStepJson["behavior"]["runSelect"] = 0;
|
||||
oldStepJson["behavior"]["defaultHandler"] = buser.GetUserIds(receiveUsers);
|
||||
}
|
||||
//如果是串行
|
||||
if (parallelorserial.HasValue && parallelorserial.Value == 1)
|
||||
{
|
||||
if (stepIndex == step.Count() - 1)
|
||||
{
|
||||
var oldLines = lineArray.Where(p => p["from"].ToString().EqualsIgnoreCase(beforeStepId.Value.ToString()));
|
||||
if (oldLines.Any())
|
||||
{
|
||||
var lineJson = oldLines.First().DeepClone();
|
||||
lineJson["id"] = GuidExtensions.NewGuid().ToString();
|
||||
lineJson["to"] = step.ElementAt(stepIndex).stepId.ToString();
|
||||
lineJson["from"] = stepIndex == 0 ? beforeStepId.Value.ToString() : step.ElementAt(stepIndex - 1).stepId.ToString();
|
||||
if (stepId != beforeStepId)
|
||||
{
|
||||
lineArray.Add(lineJson);
|
||||
}
|
||||
if (!step.Where(p => p.stepId == oldLines.First()["to"].ToString().ToGuid()).Any())
|
||||
{
|
||||
oldLines.First()["from"] = step.Last().stepId.ToString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var oldLines1 = lineArray.Where(p => p["to"].ToString().EqualsIgnoreCase(beforeStepId.Value.ToString()));
|
||||
if (oldLines1.Any())
|
||||
{
|
||||
var lineJson = oldLines1.First().DeepClone();
|
||||
lineJson["id"] = GuidExtensions.NewGuid().ToString();
|
||||
lineJson["to"] = step.ElementAt(stepIndex).stepId.ToString();
|
||||
lineJson["from"] = stepIndex == 0 ? beforeStepId.Value.ToString() : step.ElementAt(stepIndex - 1).stepId.ToString();
|
||||
if (stepId != beforeStepId)
|
||||
{
|
||||
lineArray.Add(lineJson);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var oldLines = lineArray.Where(p => p["to"].ToString().EqualsIgnoreCase(beforeStepId.Value.ToString()));
|
||||
if (oldLines.Any())
|
||||
{
|
||||
var lineJson = oldLines.First().DeepClone();
|
||||
lineJson["id"] = GuidExtensions.NewGuid().ToString();
|
||||
lineJson["from"] = stepIndex == 0 ? beforeStepId.Value.ToString() : step.ElementAt(stepIndex - 1).stepId.ToString();
|
||||
lineJson["to"] = step.ElementAt(stepIndex).stepId.ToString();
|
||||
if (stepId != beforeStepId)
|
||||
{
|
||||
lineArray.Add(lineJson);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//并行
|
||||
else
|
||||
{
|
||||
var oldLines = lineArray.Where(p => p["to"].ToString().EqualsIgnoreCase(beforeStepId.Value.ToString()) && p["from"].ToString().EqualsIgnoreCase(executeModel.StepId.ToString()));
|
||||
if (oldLines.Any())
|
||||
{
|
||||
var lineJson = oldLines.First().DeepClone();
|
||||
lineJson["id"] = GuidExtensions.NewGuid().ToString();
|
||||
lineJson["to"] = stepId;
|
||||
if (stepId != beforeStepId)
|
||||
{
|
||||
lineArray.Add(lineJson);
|
||||
}
|
||||
}
|
||||
var oldLines1 = lineArray.Where(p => p["from"].ToString().EqualsIgnoreCase(beforeStepId.Value.ToString()));
|
||||
int j = oldLines1.Count();
|
||||
for (int i = 0; i < j; i++)
|
||||
{
|
||||
var lineJson = oldLines1.ElementAt(i).DeepClone();
|
||||
lineJson["id"] = GuidExtensions.NewGuid().ToString();
|
||||
lineJson["from"] = stepId;
|
||||
if (stepId != beforeStepId)
|
||||
{
|
||||
lineArray.Add(lineJson);
|
||||
}
|
||||
}
|
||||
}
|
||||
stepIndex++;
|
||||
}
|
||||
var dynamicModel = Get(step.Key.Value.ToString(), executeModel.GroupId.ToString());
|
||||
string json = jObject.ToString(Newtonsoft.Json.Formatting.None);
|
||||
if (null == dynamicModel)
|
||||
{
|
||||
dynamicModel = new Model.rf_flowdynamic() { StepId = step.Key.Value.ToString(), GroupId = executeModel.GroupId.ToString(), FlowJSON = json };
|
||||
Add(dynamicModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
dynamicModel.FlowJSON = json;
|
||||
Update(dynamicModel);
|
||||
}
|
||||
_memoryCache.Remove("roadflow_cache_" + typeof(RoadFlow.Model.rf_flow).FullName + "_" + dynamicModel.StepId + "_" + dynamicModel.GroupId);
|
||||
if (step.Key == steps.Last().Key)
|
||||
{
|
||||
flowJSON = json;
|
||||
}
|
||||
}
|
||||
return new Flow().GetFlowRunModel(flowJSON, out string msg);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IFlowDynamic:IRoadFlowRepository<RoadFlow.Model.rf_flowdynamic>
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询一个动态流程
|
||||
/// </summary>
|
||||
/// <param name="StepId">动态步骤ID</param>
|
||||
/// <param name="groupId">组ID</param>
|
||||
/// <returns></returns>
|
||||
public Model.rf_flowdynamic Get(string StepId, string groupId);
|
||||
|
||||
/// <summary>
|
||||
/// 添加动态流程
|
||||
/// </summary>
|
||||
/// <param name="executeModel">流程执行参数实体</param>
|
||||
/// <param name="groupTasks">当前组任务List</param>
|
||||
/// <returns></returns>
|
||||
public Model.FlowRun Add(Model.FlowRunModel.Execute executeModel, List<Model.rf_flowtask> groupTasks);
|
||||
}
|
||||
}
|
||||
52
back_end_code/Ewide.RoadFlow/Data/FlowEntrust/FlowEntrust.cs
Normal file
52
back_end_code/Ewide.RoadFlow/Data/FlowEntrust/FlowEntrust.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using Ewide.Core;
|
||||
using Furion.DependencyInjection;
|
||||
using RoadFlow.Model.FlowRunModel;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class FlowEntrust : RoadFlowRepository<RoadFlow.Model.rf_flowentrust>, IFlowEntrust, ITransient
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询一页数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<RoadFlow.Model.rf_flowentrust> GetPagerList(out int count, int size, int number, string userId, string date1, string date2, string order)
|
||||
{
|
||||
int total = 0;
|
||||
var list = this.db.Queryable<RoadFlow.Model.rf_flowentrust>()
|
||||
.WhereIF(userId.IsGuid(), x => x.UserId == userId)
|
||||
.WhereIF(date1.IsDateTime(), x => x.StartTime >= DateTime.Parse(date1))
|
||||
.WhereIF(date2.IsDateTime(), x => x.EndTime <= DateTime.Parse(date2))
|
||||
.OrderByIF(!order.IsNullOrEmpty(), order)
|
||||
.ToPageList(number, size,ref total);
|
||||
count = total;
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个人员一个流程的委托人员(如果没有则返回string.Empty)
|
||||
/// </summary>
|
||||
/// <param name="flowId">流程ID</param>
|
||||
/// <param name="user">人员实体</param>
|
||||
/// <returns>如果没有委托则返回string.Empty</returns>
|
||||
public string GetEntrustUserId(string flowId, SysUser user)
|
||||
{
|
||||
var all = GetAll();
|
||||
DateTime now = Utility.DateExtensions.Now;
|
||||
var entrust = all.Find(p => p.UserId == user.Id && (!p.FlowId.IsNullOrWhiteSpace() || p.FlowId == flowId) &&
|
||||
p.StartTime <= now && p.EndTime >= now);
|
||||
return null == entrust ? string.Empty : entrust.ToUserId;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IFlowEntrust : IRoadFlowRepository<RoadFlow.Model.rf_flowentrust>
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询一页数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<RoadFlow.Model.rf_flowentrust> GetPagerList(out int count, int size, int number, string userId, string date1, string date2, string order);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
43
back_end_code/Ewide.RoadFlow/Data/FlowReceive/FlowReceive.cs
Normal file
43
back_end_code/Ewide.RoadFlow/Data/FlowReceive/FlowReceive.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class FlowReceive: RoadFlowRepository<RoadFlow.Model.rf_flowreceive>, IFlowReceive, ITransient
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 查询一个流程一个步骤的上一次处理人
|
||||
/// </summary>
|
||||
/// <param name="flowId">流程id</param>
|
||||
/// <param name="stepId">步骤id</param>
|
||||
/// <param name="SenderId">发送人</param>
|
||||
/// <returns></returns>
|
||||
public string GetPrevMembers(string flowId, string stepId, string SenderId)
|
||||
{
|
||||
//SELECT Members FROM RF_FlowReceive WHERE FlowId = @FlowId AND StepId = @StepId AND SenderId = @SenderId ORDER BY SendTime DESC LIMIT 1
|
||||
return GetListBy(x => x.FlowId == flowId && x.StepId == stepId && x.SenderId == SenderId)
|
||||
.OrderByDescending(x => x.SendTime).Take(1).ToList()[0].Members;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 批量添加
|
||||
/// </summary>
|
||||
/// <param name="flowReceive">实体类</param>
|
||||
/// <returns></returns>
|
||||
public int AddRange(List<Model.rf_flowreceive> flowReceives)
|
||||
{
|
||||
return AddRangeList(flowReceives);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IFlowReceive : IRoadFlowRepository<RoadFlow.Model.rf_flowreceive>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
5449
back_end_code/Ewide.RoadFlow/Data/FlowTask/FlowTask.cs
Normal file
5449
back_end_code/Ewide.RoadFlow/Data/FlowTask/FlowTask.cs
Normal file
File diff suppressed because it is too large
Load Diff
254
back_end_code/Ewide.RoadFlow/Data/FlowTask/IFlowTask.cs
Normal file
254
back_end_code/Ewide.RoadFlow/Data/FlowTask/IFlowTask.cs
Normal file
@@ -0,0 +1,254 @@
|
||||
using Ewide.Core;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IFlowTask : IRoadFlowRepository<RoadFlow.Model.rf_flowtask>
|
||||
{
|
||||
// <summary>
|
||||
/// 根据组ID查询列表
|
||||
/// </summary>
|
||||
/// <param name="groupId"></param>
|
||||
/// <returns></returns>
|
||||
List<Model.rf_flowtask> GetListByGroupId(string groupId);
|
||||
/// <summary>
|
||||
/// 得到获取动态步骤的任务实体
|
||||
/// </summary>
|
||||
/// <param name="groupId">组ID</param>
|
||||
/// <param name="taskId">当前任务ID,如果为空,则返回的Model.FlowTask当前任务实体也为空</param>
|
||||
/// <returns>(动态任务, 当前任务, 任务组List)</returns>
|
||||
public (Model.rf_flowtask, Model.rf_flowtask, List<Model.rf_flowtask>) GetDynamicTask(string groupId, string? taskId = null);
|
||||
/// <summary>
|
||||
/// 判断人员是否可以打开任务
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns>返回 -1表示不能打开 0任务为空 1任务处理人 2实例管理人</returns>
|
||||
public int IsOpenTask(string userId, Model.rf_flowtask flowTaskModel, Model.FlowRun flowRunModel = null);
|
||||
/// <summary>
|
||||
/// 更新状态
|
||||
/// </summary>
|
||||
/// <param name="taskId">任务id</param>
|
||||
/// <param name="status">状态</param>
|
||||
/// <param name="executeType">处理类型 int.MinValue表示不更新</param>
|
||||
/// <param name="openTime">打开时间 null表示不更新</param>
|
||||
/// <returns></returns>
|
||||
public int UpdateStatus(string taskId, int status, int executeType = int.MinValue, DateTime? openTime = null);
|
||||
|
||||
/// <summary>
|
||||
/// 判断一个任务是否可以催办
|
||||
/// </summary>
|
||||
/// <param name="flowTask"></param>
|
||||
/// <param name="isWithdraw">是否可以收回</param>
|
||||
/// <returns>isWithdraw 是否可以收回</returns>
|
||||
public bool IsHasten(string taskId, out bool isWithdraw);
|
||||
|
||||
/// <summary>
|
||||
/// 得到当前任务的后续接收步骤选择HTML
|
||||
/// </summary>
|
||||
/// <param name="flowRunModel">流程运行时实体</param>
|
||||
/// <param name="stepId">步骤ID</param>
|
||||
/// <param name="groupId">组ID</param>
|
||||
/// <param name="taskId">任务ID</param>
|
||||
/// <param name="instanceId">实例ID</param>
|
||||
/// <param name="userId">当前人员ID</param>
|
||||
/// <param name="sendSteps">可以发送的步骤</param>
|
||||
/// <param name="isFreeSend">是否是自由发送</param>
|
||||
/// <param name="isMobile">是否是移动端</param>
|
||||
/// <param name="groupTasks">组任务集合,为空则在方法中查询</param>
|
||||
/// <param name="localizer">多语言包</param>
|
||||
/// <returns>步骤选择html, 提醒信息, 可以发送的步骤集合</returns>
|
||||
public (string html, string message, List<Model.FlowRunModel.Step> sendSteps) GetNextSteps(Model.FlowRun flowRunModel, Guid stepId, string groupId, string taskId, string instanceId, string userId, bool isFreeSend, bool isMobile = false, List<Model.rf_flowtask> groupTasks = null, IStringLocalizer localizer = null);
|
||||
|
||||
/// <summary>
|
||||
/// 从字段值得到动态步骤
|
||||
/// <para>字段值格式:{flowtype:0 流转类型0并且 1串行,runedit:0 是否运行时编辑,steps:[{name:'test1',members:'u_EB03262C-AB60-4BC6-A4C0-96E66A4229FE'},{name:'test2',members:'u_954DC69A-30FF-4484-9234-3C9272B6893F'}]}</para>
|
||||
/// </summary>
|
||||
/// <param name="flowRunModel"></param>
|
||||
/// <param name="step"></param>
|
||||
/// <param name="instanceId"></param>
|
||||
/// <returns></returns>
|
||||
public JObject GetDynamicStepFromFieldValue(Model.FlowRun flowRunModel, Model.FlowRunModel.Step step, string instanceId);
|
||||
|
||||
/// <summary>
|
||||
/// 抄送任务
|
||||
/// </summary>
|
||||
/// <param name="currentTask">当前任务</param>
|
||||
/// <param name="users">接收人</param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns>返回1表示成功,其它为错误信息</returns>
|
||||
public string CopyFor(Model.rf_flowtask currentTask, List<SysUser> users, IStringLocalizer localizer = null);
|
||||
/// <summary>
|
||||
/// 征求意见
|
||||
/// </summary>
|
||||
/// <param name="currentTask"></param>
|
||||
/// <param name="users"></param>
|
||||
/// <param name="visibility">意见可见性 20自己可见 21流程参与人可见</param>
|
||||
/// <param name="note">备注</param>
|
||||
/// <returns></returns>
|
||||
public string SolicitOpinion(Model.rf_flowtask currentTask, List<SysUser> users, int visibility, string note = "", IStringLocalizer localizer = null);
|
||||
|
||||
/// <summary>
|
||||
/// 查询待办事项
|
||||
/// </summary>
|
||||
/// <param name="flowId"></param>
|
||||
/// <param name="title"></param>
|
||||
/// <param name="startDate"></param>
|
||||
/// <param name="endDate"></param>
|
||||
/// <param name="isBatch">是否批量 0不是,1是</param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_flowtask> GetWaitTask(int size, int number, string userId, string flowId, string title, string startDate, string endDate, string order, out int count, int isBatch = 0);
|
||||
|
||||
/// <summary>
|
||||
/// 判断一个任务是否可以作废
|
||||
/// </summary>
|
||||
/// <param name="taskId"></param>
|
||||
/// <returns></returns>
|
||||
public bool IsDelete(string taskId, Model.FlowRun flowRunModel = null);
|
||||
|
||||
/// <summary>
|
||||
/// 得到任务类型标题
|
||||
/// </summary>
|
||||
/// <param name="taskType">任务类型</param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
public string GetTaskTypeTitle(int taskType, IStringLocalizer localizer = null);
|
||||
/// <summary>
|
||||
/// 查询已办事项
|
||||
/// </summary>
|
||||
/// <param name="flowId"></param>
|
||||
/// <param name="title"></param>
|
||||
/// <param name="startDate"></param>
|
||||
/// <param name="endDate"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_flowtask> GetCompletedTask(int size, int number, string userId, string flowId, string title, string startDate, string endDate, string order, out int count);
|
||||
|
||||
/// <summary>
|
||||
/// 查询我发起的流程
|
||||
/// </summary>
|
||||
/// <param name="flowId"></param>
|
||||
/// <param name="title"></param>
|
||||
/// <param name="startDate"></param>
|
||||
/// <param name="endDate"></param>
|
||||
/// <param name="status">""全部 "0"未完成 "1" 已完成</param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_flowtask> GetMyStartList(int size, int number, string userId, string flowId, string title, string startDate, string endDate, string status, string order, out int count);
|
||||
|
||||
/// <summary>
|
||||
/// 查询已委托事项
|
||||
/// </summary>
|
||||
/// <param name="flowId"></param>
|
||||
/// <param name="title"></param>
|
||||
/// <param name="startDate"></param>
|
||||
/// <param name="endDate"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_flowtask> GetEntrustTask(int size, int number, string userId, string flowId, string title, string startDate, string endDate, string order, out int count);
|
||||
|
||||
/// <summary>
|
||||
/// 得到处理类别显示标题
|
||||
/// </summary>
|
||||
/// <param name="executeType"></param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
public string GetExecuteTypeTitle(int executeType, IStringLocalizer localizer = null);
|
||||
|
||||
/// <summary>
|
||||
/// 自动执行一个任务
|
||||
/// </summary>
|
||||
/// <param name="taskId"></param>
|
||||
/// <param name="type">执行类型</param>
|
||||
/// <param name="comment">处理意见</param>
|
||||
/// <returns></returns>
|
||||
public Model.FlowRunModel.ExecuteResult AutoSubmit(Guid taskId, string type = "submit", string comment = "");
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="flowTaskModels">任务实体</param>
|
||||
/// <returns></returns>
|
||||
public int DeleteByGroupId(string groupid);
|
||||
/// <summary>
|
||||
/// 更新任务
|
||||
/// </summary>
|
||||
/// <param name="removeTasks">要删除的列表</param>
|
||||
/// <param name="updateTasks">要更新的列表</param>
|
||||
/// <param name="addTasks">要添加的列表</param>
|
||||
/// <param name="executeSqls">要执行的sql列表(sql,参数,0提交退回前 1提交退回后)</param>
|
||||
/// <returns></returns>
|
||||
public int Update(List<Model.rf_flowtask> removeTasks, List<Model.rf_flowtask> updateTasks, List<Model.rf_flowtask> addTasks, List<(string, object[], int)> executeSqls);
|
||||
|
||||
/// <summary>
|
||||
/// 发送待办消息
|
||||
/// </summary>
|
||||
/// <param name="nextTasks"></param>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="sendModel">发送方式 0站内短信 1手机短信 2微信 3公众号 4邮件</param>
|
||||
/// <param name="contents">消息内容</param>
|
||||
public void SendMessage(List<Model.rf_flowtask> nextTasks, SysUser sender, string sendModel = "", string contents = "", IStringLocalizer localizer = null);
|
||||
|
||||
/// <summary>
|
||||
/// 判断人员是否可以查看处理过程
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="groupTasks">组任务列表</param>
|
||||
/// <returns>返回 -1表示不能打开 1任务参与人 2实例管理人</returns>
|
||||
public int IsOpenProcess(string userId, List<Model.rf_flowtask> groupTasks, Model.FlowRun flowRunModel = null);
|
||||
/// <summary>
|
||||
/// 得到步骤由流程处理人设置的后续步骤处理人员
|
||||
/// </summary>
|
||||
/// <param name="groupTasks">实例组列表</param>
|
||||
/// <returns></returns>
|
||||
public Dictionary<Guid, string> GetNextStepsHandle(List<Model.rf_flowtask> groupTasks);
|
||||
/// <summary>
|
||||
/// 根据子流程组ID查询主流程任务
|
||||
/// </summary>
|
||||
/// <param name="groupId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_flowtask> GetListBySubFlowGroupId(string groupId);
|
||||
/// <summary>
|
||||
/// 查询实例列表
|
||||
/// </summary>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="number"></param>
|
||||
/// <param name="flowId"></param>
|
||||
/// <param name="title"></param>
|
||||
/// <param name="receiveId"></param>
|
||||
/// <param name="receiveDate1"></param>
|
||||
/// <param name="receiveDate2"></param>
|
||||
/// <param name="order"></param>
|
||||
/// <param name="count"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_flowtask> GetInstanceList(int size, int number, string flowId, string title, string receiveId, string receiveDate1, string receiveDate2, string order, out int count);
|
||||
|
||||
/// <summary>
|
||||
/// 指派任务
|
||||
/// </summary>
|
||||
/// <param name="currentTask">当前任务</param>
|
||||
/// <param name="users">要指派的人员</param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns>返回1表示成功,其它为错误信息</returns>
|
||||
public string Designate(Model.rf_flowtask currentTask, List<SysUser> users, IStringLocalizer localizer = null);
|
||||
/// <summary>
|
||||
/// 跳转任务
|
||||
/// </summary>
|
||||
/// <param name="currentTask">当前任务</param>
|
||||
/// <param name="steps">要跳转到的步骤</param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns>返回1表示成功,其它为错误信息</returns>
|
||||
public string GoTo(Model.rf_flowtask currentTask, Dictionary<Guid, List<SysUser>> steps, IStringLocalizer localizer = null);
|
||||
/// <summary>
|
||||
/// 根据JSON字符串参数执行流程
|
||||
/// </summary>
|
||||
/// <param name="json">
|
||||
/// <para>{id:'任务id',flowId:'流程ID',instanceId:'实例id',title:'任务标题',comment:'处理意见',type:'处理类型',note:'备注',</para>
|
||||
/// <para> senderId:'发送人id',sign:'是否签章 0|1',steps:[{id:'接收步骤id',name:'接收步骤名称',member:'接收人',completedtime:'要求完成时间'}]}</para>
|
||||
/// </param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
public Model.FlowRunModel.ExecuteResult ExecuteFromJSON(string json, IStringLocalizer localizer = null);
|
||||
}
|
||||
}
|
||||
1324
back_end_code/Ewide.RoadFlow/Data/Form/Form.cs
Normal file
1324
back_end_code/Ewide.RoadFlow/Data/Form/Form.cs
Normal file
File diff suppressed because it is too large
Load Diff
146
back_end_code/Ewide.RoadFlow/Data/Form/IForm.cs
Normal file
146
back_end_code/Ewide.RoadFlow/Data/Form/IForm.cs
Normal file
@@ -0,0 +1,146 @@
|
||||
using Ewide.Core;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IForm : IRoadFlowRepository<RoadFlow.Model.rf_form>
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取表单运行时HTML
|
||||
/// </summary>
|
||||
/// <param name="formId">表单ID</param>
|
||||
/// <param name="attrJson">预览表单时传</param>
|
||||
/// <param name="eventJson">预览表单时传</param>
|
||||
/// <returns>表单相关属性json</returns>
|
||||
public JObject GetRunJObject(string formId, string attrJson = "", string eventJson = "");
|
||||
/// <summary>
|
||||
/// 根据字符串表达式得到选项
|
||||
/// </summary>
|
||||
/// <param name="expression">选项文本1,选项值1;选项文本2,选项值2</param>
|
||||
/// <returns></returns>
|
||||
public string GetOptionsByStringExpression(string expression, string defaultValue = "");
|
||||
/// <summary>
|
||||
/// 查询表单数据
|
||||
/// </summary>
|
||||
/// <param name="connId"></param>
|
||||
/// <param name="tableName"></param>
|
||||
/// <param name="primaryKey"></param>
|
||||
/// <param name="taskId"></param>
|
||||
/// <param name="flowId"></param>
|
||||
/// <param name="formatJSON"></param>
|
||||
/// <param name="fieldStatusJSON"></param>
|
||||
/// <param name="groupId">动态步骤模式时用于获取步骤字段状态</param>
|
||||
/// <returns></returns>
|
||||
public string GetFormData(string connId, string tableName, string primaryKey, string instanceId, string stepId, string flowId, string formatJSON, out string fieldStatusJSON, string groupId = "");
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个连接SQL的数据表JArray
|
||||
/// </summary>
|
||||
/// <param name="connId"></param>
|
||||
/// <param name="sql"></param>
|
||||
/// <returns>(rows, cols)</returns>
|
||||
public (JArray, JArray) GetDataTablJArray(string connId, string sql);
|
||||
|
||||
/// <summary>
|
||||
/// 得到子表行数据
|
||||
/// </summary>
|
||||
/// <param name="jObject"></param>
|
||||
/// <param name="connId">连接id</param>
|
||||
/// <param name="instanceId">实例id</param>
|
||||
/// <returns></returns>
|
||||
public JArray GetSubTableJarray(JObject jObject, string connId, string instanceId);
|
||||
|
||||
/// <summary>
|
||||
/// 得到子表默认值json
|
||||
/// </summary>
|
||||
/// <param name="jObject"></param>
|
||||
/// <returns></returns>
|
||||
public JArray GetSubTableDefaultValueJArray(JArray jArray, SysUser userModel = null);
|
||||
|
||||
/// <summary>
|
||||
/// 替换标题表达式
|
||||
/// </summary>
|
||||
/// <param name="titleExpression"></param>
|
||||
/// <param name="tableName"></param>
|
||||
/// <param name="instanceId"></param>
|
||||
/// <returns></returns>
|
||||
public string ReplaceTitleExpression(string titleExpression, string tableName, string instanceId, JObject formBody);
|
||||
|
||||
/// <summary>
|
||||
/// 删除一个表单对应的数据
|
||||
/// </summary>
|
||||
/// <param name="formId">表单Id(RF_Form表Id)</param>
|
||||
/// <param name="instanceId">实例Id</param>
|
||||
/// <param name="programRunModel">设计的应用程序实体(用于判断数据删除后事件)</param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <param name="isVue">是否是VUE版本</param>
|
||||
/// <returns>返回1表单成功,其它为错误信息</returns>
|
||||
public string DeleteFormData(string formId, string instanceId, Model.ProgramRun programRunModel = null, IStringLocalizer localizer = null, bool isVue = false);
|
||||
|
||||
/// <summary>
|
||||
/// 保存表单数据(vue前后分离方式)
|
||||
/// </summary>
|
||||
/// <returns>业务表主键值, 错误信息</returns>
|
||||
/// <param name="request">当前请求</param>
|
||||
public (string, string) SaveDataVue(JObject args, IStringLocalizer localizer = null);
|
||||
|
||||
/// <summary>
|
||||
/// 查询一页数据
|
||||
/// </summary>
|
||||
/// <param name="count"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="number"></param>
|
||||
/// <param name="userId">当前人员ID</param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="order"></param>
|
||||
/// <param name="status">状态,默认为查询没有删除的表单</param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_form> GetPagerList(out int count, int size, int number, string userId, string name, string type, string order, int status = -1);
|
||||
|
||||
/// <summary>
|
||||
/// 删除表单同时删除应用程序库中记录
|
||||
/// </summary>
|
||||
/// <param name="form">表单实体</param>
|
||||
/// <param name="delete">是否彻底删除 0不 1彻底删除</param>
|
||||
/// <returns></returns>
|
||||
public int DeleteAndApplibrary(Model.rf_form form, int delete = 0);
|
||||
/// <summary>
|
||||
/// 清除表单运行时HTML缓存
|
||||
/// </summary>
|
||||
/// <param name="formId">表单ID</param>
|
||||
public void ClearRunJObjectCache(string formId);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据SQL得到下拉选项(vue项目用)
|
||||
/// </summary>
|
||||
/// <param name="connId"></param>
|
||||
/// <param name="sql"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
public JArray GetJArrayOptionsBySQL(string connId, string sql, string value);
|
||||
/// <summary>
|
||||
/// 根据URL得到下拉选项
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <returns></returns>
|
||||
public string GetOptionsByUrl(string url);
|
||||
/// <summary>
|
||||
/// 导入表单
|
||||
/// </summary>
|
||||
/// <param name="json"></param>
|
||||
/// <param name="createFile">是否需要创建文件,VUE不需要创建文件</param>
|
||||
/// <returns>返回1表示成功,其它为错误信息</returns>
|
||||
public string ImportForm(string json, bool createFile = true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
105
back_end_code/Ewide.RoadFlow/Data/IRoadFlowRepository.cs
Normal file
105
back_end_code/Ewide.RoadFlow/Data/IRoadFlowRepository.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IRoadFlowRepository<T>
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有的数据对象并缓存
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<T> GetAll();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 按Id获取一个对象
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
T GetOneById(string id);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 按条件获取一个对象
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <returns></returns>
|
||||
T GetOneBy(Predicate<T> predicate);
|
||||
|
||||
/// <summary>
|
||||
/// 按条件获取列表
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <returns></returns>
|
||||
List<T> GetListBy(Predicate<T> predicate);
|
||||
|
||||
/// <summary>
|
||||
/// 增加对象
|
||||
/// </summary>
|
||||
/// <param name="t"></param>
|
||||
/// <returns></returns>
|
||||
int Add(T t);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 增加多个对象
|
||||
/// </summary>
|
||||
/// <param name="ts"></param>
|
||||
/// <returns></returns>
|
||||
int AddRangeList(List<T> ts);
|
||||
|
||||
/// <summary>
|
||||
/// 更新对象
|
||||
/// </summary>
|
||||
/// <param name="t"></param>
|
||||
/// <returns></returns>
|
||||
int Update(T t,bool clearCache=true);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更新多个对象
|
||||
/// </summary>
|
||||
/// <param name="ts"></param>
|
||||
/// <returns></returns>
|
||||
int Update(List<T> ts, bool trans = true);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除对象(物理)
|
||||
/// </summary>
|
||||
/// <param name="t"></param>
|
||||
/// <returns></returns>
|
||||
int Delete(T t);
|
||||
|
||||
/// <summary>
|
||||
/// 删除一批对象(物理)
|
||||
/// </summary>
|
||||
/// <param name="ts"></param>
|
||||
/// <returns></returns>
|
||||
int Delete(List<T> ts);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 按条件删除对象
|
||||
/// </summary>
|
||||
/// <param name="expression"></param>
|
||||
/// <returns></returns>
|
||||
int DeleteBy(System.Linq.Expressions.Expression<Func<T, bool>> expression);
|
||||
|
||||
/// <summary>
|
||||
/// 清空缓存
|
||||
/// </summary>
|
||||
void ClearCache();
|
||||
/// <summary>
|
||||
/// 清空缓存
|
||||
/// </summary>
|
||||
void ClearCache(string id);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
46
back_end_code/Ewide.RoadFlow/Data/Log/ILog.cs
Normal file
46
back_end_code/Ewide.RoadFlow/Data/Log/ILog.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface ILog:IRoadFlowRepository<RoadFlow.Model.rf_log>
|
||||
{
|
||||
/// <summary>
|
||||
/// 添加日志
|
||||
/// </summary>
|
||||
/// <param name="title"></param>
|
||||
/// <param name="contents"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="oldContents"></param>
|
||||
/// <param name="newContents"></param>
|
||||
/// <param name="others"></param>
|
||||
/// <param name="browseAgent"></param>
|
||||
/// <param name="ipAddress"></param>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="userName"></param>
|
||||
public void Add(string title, string CurrentUserId = "", string contents = "",
|
||||
LogType type = LogType.其他, string oldContents = "", string newContents = "", string others = "",
|
||||
string browseAgent = "", string ipAddress = "", string url = "", string userId = "", string userName = "");
|
||||
|
||||
/// <summary>
|
||||
/// 得到日志类型
|
||||
/// </summary>
|
||||
/// <param name="type">日志类型</param>
|
||||
/// <param name="language">语言</param>
|
||||
/// <returns></returns>
|
||||
public string GetLogType(string type, string language);
|
||||
|
||||
/// <summary>
|
||||
/// 添加异常日志
|
||||
/// </summary>
|
||||
/// <param name="err">异常类</param>
|
||||
/// <param name="title">标题 如果为空用err.Message</param>
|
||||
public void Add(Exception err, string title = "");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
208
back_end_code/Ewide.RoadFlow/Data/Log/Log.cs
Normal file
208
back_end_code/Ewide.RoadFlow/Data/Log/Log.cs
Normal file
@@ -0,0 +1,208 @@
|
||||
using Ewide.Core;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Furion.DependencyInjection;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class Log :RoadFlowRepository<RoadFlow.Model.rf_log>,ILog, ITransient
|
||||
{
|
||||
private readonly IRepository<SysUser> _sysUserRep =Furion.App.GetService<IRepository<SysUser>>();
|
||||
private readonly IUserManager _userManager=Furion.App.GetService<IUserManager>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加日志
|
||||
/// </summary>
|
||||
/// <param name="title"></param>
|
||||
/// <param name="contents"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="oldContents"></param>
|
||||
/// <param name="newContents"></param>
|
||||
/// <param name="others"></param>
|
||||
/// <param name="browseAgent"></param>
|
||||
/// <param name="ipAddress"></param>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="userName"></param>
|
||||
public void Add(string title, string CurrentUserId = "", string contents = "", LogType type = LogType.其他, string oldContents = "", string newContents = "", string others = "", string browseAgent = "", string ipAddress = "", string url = "", string userId = "", string userName = "")
|
||||
{
|
||||
var logModel = new Model.rf_log
|
||||
{
|
||||
Id = GuidExtensions.NewGuid().ToString(),
|
||||
Title = title,
|
||||
Type = type.ToString(),
|
||||
IPAddress = ipAddress.IsNullOrWhiteSpace() ? Tools.GetIP() : ipAddress,
|
||||
URL = url.IsNullOrWhiteSpace() ? Tools.GetAbsoluteURL() : url,
|
||||
WriteTime = DateExtensions.Now,
|
||||
Referer = Tools.GetReferer()
|
||||
};
|
||||
if (userId.IsGuid(out Guid userGuid))
|
||||
{
|
||||
logModel.UserId = userGuid.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
logModel.UserId = CurrentUserId;
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
if (!userName.IsNullOrWhiteSpace())
|
||||
{
|
||||
logModel.UserName = userName;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
var userModel = logModel.UserId.IsNullOrWhiteSpace() ?_sysUserRep.DetachedEntities.FirstOrDefault(x=>x.Id==logModel.UserId) : null;
|
||||
|
||||
if (null != userModel)
|
||||
{
|
||||
logModel.UserName = userModel.Name;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
if (!contents.IsNullOrWhiteSpace())
|
||||
{
|
||||
logModel.Contents = contents;
|
||||
}
|
||||
if (!others.IsNullOrWhiteSpace())
|
||||
{
|
||||
logModel.Others = others;
|
||||
}
|
||||
if (!oldContents.IsNullOrWhiteSpace())
|
||||
{
|
||||
logModel.OldContents = oldContents;
|
||||
}
|
||||
if (!newContents.IsNullOrWhiteSpace())
|
||||
{
|
||||
logModel.NewContents = newContents;
|
||||
}
|
||||
logModel.BrowseAgent = browseAgent.IsNullOrWhiteSpace() ? Tools.GetBrowseAgent() : browseAgent;
|
||||
AddLog(logModel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加日志
|
||||
/// </summary>
|
||||
/// <param name="title"></param>
|
||||
/// <param name="contents"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="oldContents"></param>
|
||||
/// <param name="newContents"></param>
|
||||
/// <param name="others"></param>
|
||||
/// <param name="browseAgent"></param>
|
||||
/// <param name="ipAddress"></param>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="userName"></param>
|
||||
public void Add(string title, string contents = "", LogType type = LogType.其他, string oldContents = "", string newContents = "", string others = "", string browseAgent = "", string ipAddress = "", string url = "", string userId = "", string userName = "")
|
||||
{
|
||||
this.Add(title, _userManager.UserId, contents, type, oldContents, newContents, others, browseAgent, ipAddress, url, userId, userName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加日志
|
||||
/// </summary>
|
||||
/// <param name="log"></param>
|
||||
private void AddLog(Model.rf_log log)
|
||||
{
|
||||
log.Type = GetLogType(log.Type, Config.Language_Default);
|
||||
this.Add(log);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到日志类型
|
||||
/// </summary>
|
||||
/// <param name="type">日志类型</param>
|
||||
/// <param name="language">语言</param>
|
||||
/// <returns></returns>
|
||||
public string GetLogType(string type, string language)
|
||||
{
|
||||
switch (language)
|
||||
{
|
||||
case "zh-CN":
|
||||
return type;
|
||||
case "zh":
|
||||
return ZH_Type.TryGetValue(type, out string t) ? t : type;
|
||||
case "en-US":
|
||||
return EN_US_Type.TryGetValue(type, out string t2) ? t2 : type;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
private static readonly Dictionary<string, string> ZH_Type = new Dictionary<string, string>
|
||||
{
|
||||
{"用户登录" ,"用戶登錄"},
|
||||
{"系统管理" ,"系統管理"},
|
||||
{"流程管理" ,"流程管理"},
|
||||
{"表单管理" ,"表單管理"},
|
||||
{"流程运行" ,"流程運行"},
|
||||
{"系统异常" ,"系統異常"},
|
||||
{"其他" ,"其他"},
|
||||
};
|
||||
|
||||
private static readonly Dictionary<string, string> EN_US_Type = new Dictionary<string, string>
|
||||
{
|
||||
{"用户登录" ,"User login"},
|
||||
{"系统管理" ,"System management"},
|
||||
{"流程管理" ,"Workflow management"},
|
||||
{"表单管理" ,"Form management"},
|
||||
{"流程运行" ,"Workflow run"},
|
||||
{"系统异常" ,"Exception"},
|
||||
{"其他" ,"Other"},
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 添加异常日志
|
||||
/// </summary>
|
||||
/// <param name="err">异常类</param>
|
||||
/// <param name="title">标题 如果为空用err.Message</param>
|
||||
public void Add(Exception err, string title = "")
|
||||
{
|
||||
Model.rf_log logModel = new Model.rf_log
|
||||
{
|
||||
Id = GuidExtensions.NewGuid().ToString(),
|
||||
Title = title.IsNullOrWhiteSpace() ? err.Message : title,
|
||||
Type = GetLogType("系统异常", Tools.GetCurrentLanguage()),
|
||||
IPAddress = Tools.GetIP(),
|
||||
URL = Tools.GetAbsoluteURL(),
|
||||
WriteTime = DateExtensions.Now,
|
||||
Referer = Tools.GetReferer()
|
||||
};
|
||||
string uid = _userManager.UserId;
|
||||
/*if (uid.IsNullOrWhiteSpace())
|
||||
{
|
||||
uid = EnterpriseWeiXin.Common.GetUserId();
|
||||
}*/
|
||||
if (uid.IsNotEmptyGuid())
|
||||
{
|
||||
logModel.UserId = uid;
|
||||
}
|
||||
var userModel = _userManager.User;//logModel.UserId.HasValue ? new RoadFlow.Business.User().Get(logModel.UserId.Value) : null;
|
||||
/*if (null == userModel)
|
||||
{
|
||||
userModel = EnterpriseWeiXin.Common.GetUser();
|
||||
}*/
|
||||
if (null != userModel)
|
||||
{
|
||||
logModel.UserName = userModel.Name;
|
||||
}
|
||||
logModel.Contents = err.StackTrace;
|
||||
logModel.Others = err.Source + "(" + err.Message + ")";
|
||||
logModel.BrowseAgent = Tools.GetBrowseAgent();
|
||||
AddLog(logModel);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
19
back_end_code/Ewide.RoadFlow/Data/Log/LogType.cs
Normal file
19
back_end_code/Ewide.RoadFlow/Data/Log/LogType.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public enum LogType
|
||||
{
|
||||
用户登录,
|
||||
系统管理,
|
||||
流程管理,
|
||||
表单管理,
|
||||
流程运行,
|
||||
系统异常,
|
||||
其他
|
||||
}
|
||||
}
|
||||
13
back_end_code/Ewide.RoadFlow/Data/Menu/IMenu.cs
Normal file
13
back_end_code/Ewide.RoadFlow/Data/Menu/IMenu.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IMenu: IRoadFlowRepository<RoadFlow.Model.rf_menu>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
31
back_end_code/Ewide.RoadFlow/Data/Menu/Menu.cs
Normal file
31
back_end_code/Ewide.RoadFlow/Data/Menu/Menu.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class Menu: RoadFlowRepository<RoadFlow.Model.rf_menu>, IMenu, ITransient
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 判断一个人员是否可以使用一个菜单下的某个按钮
|
||||
/// </summary>
|
||||
/// <param name="menuId"></param>
|
||||
/// <param name="buttonId"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="menuusers"></param>
|
||||
/// <returns></returns>
|
||||
public bool HasUseButton(string menuId, string buttonId, string userId, List<Model.rf_menuuser> menuusers)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
13
back_end_code/Ewide.RoadFlow/Data/MenuUser/IMenuUser.cs
Normal file
13
back_end_code/Ewide.RoadFlow/Data/MenuUser/IMenuUser.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IMenuUser: IRoadFlowRepository<RoadFlow.Model.rf_menuuser>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
20
back_end_code/Ewide.RoadFlow/Data/MenuUser/MenuUser.cs
Normal file
20
back_end_code/Ewide.RoadFlow/Data/MenuUser/MenuUser.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class MenuUser: RoadFlowRepository<RoadFlow.Model.rf_menuuser>, IMenuUser, ITransient
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
49
back_end_code/Ewide.RoadFlow/Data/Message/IMessage.cs
Normal file
49
back_end_code/Ewide.RoadFlow/Data/Message/IMessage.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Ewide.Core;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IMessage: IRoadFlowRepository<RoadFlow.Model.rf_message>
|
||||
{
|
||||
/// <summary>
|
||||
/// 发送一条消息(VUE版本)
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
/// <param name="receiveUsers">接收人员,如果为空则从message.ReceiverIdString中取</param>
|
||||
/// <param name="url">要连接的地址</param>
|
||||
/// <param name="language">语言包</param>
|
||||
/// <returns>返回1表示成功,其它为错误信息</returns>
|
||||
public string VueSend(Model.rf_message message, IEnumerable<SysUser> receiveUsers = null, string url = "", IConfigurationSection language = null);
|
||||
|
||||
/// <summary>
|
||||
/// 查询一页已发送消息
|
||||
/// </summary>
|
||||
/// <param name="count"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="number"></param>
|
||||
/// <param name="contents"></param>
|
||||
/// <param name="date1"></param>
|
||||
/// <param name="date2"></param>
|
||||
/// <param name="status">0自己发送的消息 1未读消息 2已读消息</param>
|
||||
/// <param name="order"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_message> GetSendList(out int count, int size, int number, string userId, string contents, string date1, string date2, string status, string order);
|
||||
|
||||
/// <summary>
|
||||
/// 得到发送方式字符串
|
||||
/// </summary>
|
||||
/// <param name="receiveType">发送方式 0站内消息 1手机短信 2微信 </param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
public string GetSendTypeString(string sendType, IStringLocalizer localizer = null);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
243
back_end_code/Ewide.RoadFlow/Data/Message/Message.cs
Normal file
243
back_end_code/Ewide.RoadFlow/Data/Message/Message.cs
Normal file
@@ -0,0 +1,243 @@
|
||||
using Ewide.Core;
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RoadFlow.Utility;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class Message: RoadFlowRepository<RoadFlow.Model.rf_message>, IMessage, ITransient
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 发送一条消息(VUE版本)
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
/// <param name="receiveUsers">接收人员,如果为空则从message.ReceiverIdString中取</param>
|
||||
/// <param name="url">要连接的地址</param>
|
||||
/// <param name="language">语言包</param>
|
||||
/// <returns>返回1表示成功,其它为错误信息</returns>
|
||||
public string VueSend(Model.rf_message message, IEnumerable<SysUser> receiveUsers = null, string url = "", IConfigurationSection language = null)
|
||||
{
|
||||
if (null == message)
|
||||
{
|
||||
return language != null && language.GetSection("sendmsg_empty") != null ? language.GetSection("sendmsg_empty").Value : "消息为空!";
|
||||
}
|
||||
if (receiveUsers == null)
|
||||
{
|
||||
receiveUsers = new Organize().GetAllUsers(message.ReceiverIdString);
|
||||
}
|
||||
if (!receiveUsers.Any())
|
||||
{
|
||||
return language != null && language.GetSection("sendmsg_notreceiver") != null ? language.GetSection("sendmsg_notreceiver").Value : "消息没有接收人!";
|
||||
}
|
||||
if (message.ReceiverIdString.IsNullOrEmpty())
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
foreach (var u in receiveUsers)
|
||||
{
|
||||
stringBuilder.Append(IOrganize.PREFIX_USER);
|
||||
stringBuilder.Append(u.Id);
|
||||
stringBuilder.Append(",");
|
||||
}
|
||||
message.ReceiverIdString = stringBuilder.ToString().TrimEnd(',');
|
||||
}
|
||||
List<Model.rf_messageuser> messageUsers = new List<Model.rf_messageuser>();
|
||||
List<string> userIDList = new List<string>();//记录用户ID,用于发送singalr消息
|
||||
string[] sendTypes = message.SendType.Split(',');
|
||||
foreach (string sendType in sendTypes)
|
||||
{
|
||||
if (!sendType.IsInt(out int t))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
switch (t)
|
||||
{
|
||||
case 0://站内短信
|
||||
foreach (var user in receiveUsers)
|
||||
{
|
||||
messageUsers.Add(new Model.rf_messageuser()
|
||||
{
|
||||
MessageId = message.Id,
|
||||
UserId = user.Id,
|
||||
IsRead = 0
|
||||
});
|
||||
userIDList.Add(user.Id.ToString().ToLower());
|
||||
}
|
||||
break;
|
||||
case 1://手机短信
|
||||
StringBuilder mobiles = new StringBuilder();
|
||||
foreach (var user in receiveUsers)
|
||||
{
|
||||
if (!user.Phone.IsNullOrWhiteSpace())
|
||||
{
|
||||
mobiles.Append(user.Phone);
|
||||
mobiles.Append(",");
|
||||
}
|
||||
}
|
||||
SMS.SendSMS(message.Contents.RemoveHTML(), mobiles.ToString().TrimEnd(','));
|
||||
|
||||
break;
|
||||
case 2://企业微信
|
||||
/* if (Config.EnterpriseWeChatIsUse)
|
||||
{
|
||||
if (message.Type == 20)
|
||||
{
|
||||
if (!url.ContainsIgnoreCase("&ismobile="))
|
||||
{
|
||||
url += "&ismobile=1";
|
||||
}
|
||||
if (!url.ContainsIgnoreCase("&ismessage="))
|
||||
{
|
||||
url += "&ismessage=1";
|
||||
}
|
||||
}
|
||||
string linkUrl = url.IsNullOrWhiteSpace() && message.Type == 1
|
||||
? Config.EnterpriseWeChatWebUrl + "/?loadurl=" + ("/mobile/message-show?messageid=" + message.Id.ToString()).UrlEncode()
|
||||
: Config.EnterpriseWeChatWebUrl + "/?loadurl=" + url.UrlEncode();
|
||||
string msgTitle = message.Type == 20 ? (language != null && language.GetSection("sendmsg_todo") != null ? language.GetSection("sendmsg_todo").Value : "待办事项")
|
||||
: (language != null && language.GetSection("sendmsg_msg") != null ? language.GetSection("sendmsg_msg").Value : "消息");
|
||||
string msgDescription = "<div class=\"normal\">" + message.Contents + "</div><div class=\"gray\">"
|
||||
+ (message.SenderName.IsNullOrWhiteSpace() ? "" : (language != null && language.GetSection("sendmsg_sender") != null ? language.GetSection("sendmsg_sender").Value : "发送人") + ":" + message.SenderName)
|
||||
+ " " + (language != null && language.GetSection("sendmsg_time") != null ? language.GetSection("sendmsg_time").Value : "时间") + ":" + message.SendTime.ToShortDateTimeString() + "</div>";
|
||||
string msgBtnText = message.Type == 20 ? (language != null && language.GetSection("sendmsg_handle") != null ? language.GetSection("sendmsg_handle").Value : "点击处理")
|
||||
: (language != null && language.GetSection("sendmsg_info") != null ? language.GetSection("sendmsg_info").Value : "详情");
|
||||
|
||||
//每次最大只能发1000人,所以这里要分段
|
||||
List<List<Model.User>> toUsers = new List<List<Model.User>>();
|
||||
int skip = 1000;
|
||||
int number = 1;
|
||||
while (skip == 1000)
|
||||
{
|
||||
var userList = receiveUsers.Skip(number++ * 1000 - 1000).Take(1000).ToList();
|
||||
toUsers.Add(userList);
|
||||
skip = userList.Count;
|
||||
}
|
||||
|
||||
EnterpriseWeChat.Message weChatMessage = new EnterpriseWeChat.Message();
|
||||
foreach (var toUserList in toUsers)
|
||||
{
|
||||
StringBuilder msgReceiveUsers = new StringBuilder();
|
||||
foreach (var receiveUser in toUserList)
|
||||
{
|
||||
msgReceiveUsers.Append(receiveUser.Account + "|");
|
||||
}
|
||||
weChatMessage.SendTextCard(msgTitle, msgDescription, msgBtnText, linkUrl, msgReceiveUsers.ToString().TrimEnd('|'));
|
||||
}
|
||||
}*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
//发送singalr消息
|
||||
if (userIDList.Count > 0)
|
||||
{
|
||||
JObject jObject = new JObject
|
||||
{
|
||||
{ "id", message.Id.ToString() },
|
||||
{ "title", message.Type == 20 ? language != null && language.GetSection("sendmsg_todomsg") != null ? language.GetSection("sendmsg_todomsg").Value : "待办任务消息"
|
||||
: language != null && language.GetSection("sendmsg_msg") != null ? language.GetSection("sendmsg_msg").Value : "消息" },
|
||||
{ "contents", message.Contents },
|
||||
{ "linkUrl", message.Files.IsNullOrWhiteSpace() ? "" : message.Files },
|
||||
{ "count", 1 }
|
||||
};
|
||||
new Business.SignalR.SignalRHub().SendMessage(jObject.ToString(Newtonsoft.Json.Formatting.None), userIDList);
|
||||
}
|
||||
return Add(message, messageUsers.ToArray()) > 0 ? "1" : language != null && language.GetSection("sendmsg_fail") != null ? language.GetSection("sendmsg_fail").Value : "发送失败!";
|
||||
}
|
||||
/// <summary>
|
||||
/// 添加一批消息
|
||||
/// </summary>
|
||||
/// <param name="message">消息实体</param>
|
||||
/// <param name="messageUsers">阅读人员</param>
|
||||
/// <returns></returns>
|
||||
public int Add(Model.rf_message message, Model.rf_messageuser[] messageUsers)
|
||||
{
|
||||
return 1;
|
||||
//this.Add(message);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询一页已发送消息
|
||||
/// </summary>
|
||||
/// <param name="count"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="number"></param>
|
||||
/// <param name="contents"></param>
|
||||
/// <param name="date1"></param>
|
||||
/// <param name="date2"></param>
|
||||
/// <param name="status">0自己发送的消息 1未读消息 2已读消息</param>
|
||||
/// <param name="order"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_message> GetSendList(out int count, int size, int number, string userId, string contents, string date1, string date2, string status, string order)
|
||||
{
|
||||
int total = 0;
|
||||
var rtn = db.Queryable<Model.rf_message>()
|
||||
.WhereIF(status == "1",
|
||||
x => SqlFunc.Subqueryable<Model.rf_messageuser>().Where(y => y.MessageId == x.Id && y.IsRead == 0 && y.UserId == userId).Count() > 0)
|
||||
.WhereIF(status == "2",
|
||||
x => SqlFunc.Subqueryable<Model.rf_messageuser>().Where(y => y.MessageId == x.Id && y.IsRead == 1 && y.UserId == userId).Count() > 0)
|
||||
.WhereIF(status == "0",
|
||||
x => x.SenderId == userId)
|
||||
.WhereIF(!contents.IsNullOrWhiteSpace(),
|
||||
x => x.Contents.Contains(contents.Trim()))
|
||||
.WhereIF(date1.IsDateTime(out DateTime dt),
|
||||
x => x.SendTime >= dt.GetDate())
|
||||
.WhereIF(date2.IsDateTime(out DateTime dt1),
|
||||
x => x.SendTime < dt1.GetDate()
|
||||
)
|
||||
.OrderByIF(!order.IsNullOrWhiteSpace(), order.FilterSelectSql())
|
||||
.ToPageList(number, size, ref total).ToList();
|
||||
count = total;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得到发送方式字符串
|
||||
/// </summary>
|
||||
/// <param name="receiveType">发送方式 0站内消息 1手机短信 2微信 </param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
public string GetSendTypeString(string sendType, IStringLocalizer localizer = null)
|
||||
{
|
||||
if (sendType.IsNullOrWhiteSpace())
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
string[] types = sendType.Split(',');
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
foreach (string type in types)
|
||||
{
|
||||
if (!type.IsInt(out int t))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
switch (t)
|
||||
{
|
||||
case 0:
|
||||
stringBuilder.Append(localizer == null ? "站内消息、" : localizer["MessageType0"] + "、");
|
||||
break;
|
||||
case 1:
|
||||
stringBuilder.Append(localizer == null ? "手机短信、" : localizer["MessageType1"] + "、");
|
||||
break;
|
||||
case 2:
|
||||
stringBuilder.Append(localizer == null ? "微信、" : localizer["MessageType2"] + "、");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return stringBuilder.ToString().TrimEnd('、');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using Ewide.Core;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IMessageUser : IRoadFlowRepository<RoadFlow.Model.rf_messageuser>
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询一页已发送消息阅读人员
|
||||
/// </summary>
|
||||
/// <param name="count"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="number"></param>
|
||||
/// <param name="messageId"></param>
|
||||
/// <param name="order"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_messageuser> GetReadUserList(out int count, int size, int number, string messageId, string order);
|
||||
/// <summary>
|
||||
/// 更新一个消息为已读
|
||||
/// </summary>
|
||||
/// <param name="messageId"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateIsRead(string messageId, string userId);
|
||||
|
||||
/// <summary>
|
||||
/// 更新一个人员的所有未读消息为已读
|
||||
/// </summary>
|
||||
/// <param name="messageUsers"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateAllIsRead();
|
||||
/// <summary>
|
||||
/// 删除一批消息
|
||||
/// </summary>
|
||||
/// <param name="guids">要删除的id</param>
|
||||
/// <param name="userId">用户ID</param>
|
||||
/// <returns></returns>
|
||||
public int Delete(IEnumerable<string> guids, string userId);
|
||||
}
|
||||
}
|
||||
79
back_end_code/Ewide.RoadFlow/Data/MessageUser/MessageUser.cs
Normal file
79
back_end_code/Ewide.RoadFlow/Data/MessageUser/MessageUser.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using Ewide.Core;
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RoadFlow.Utility;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class MessageUser: RoadFlowRepository<RoadFlow.Model.rf_messageuser>, IMessageUser, ITransient
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 查询一页已发送消息阅读人员
|
||||
/// </summary>
|
||||
/// <param name="count"></param>
|
||||
/// <param name="size"></param>
|
||||
/// <param name="number"></param>
|
||||
/// <param name="messageId"></param>
|
||||
/// <param name="order"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_messageuser> GetReadUserList(out int count, int size, int number, string messageId, string order)
|
||||
{
|
||||
int total = 0;
|
||||
var rtn = db.Queryable<Model.rf_messageuser>().Where(x => x.MessageId == messageId)
|
||||
.OrderByIF(!order.IsNullOrEmpty(), order).ToPageList(number, size, ref total).ToList();
|
||||
count = total;
|
||||
return rtn;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新一个消息为已读
|
||||
/// </summary>
|
||||
/// <param name="messageId"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateIsRead(string messageId, string userId)
|
||||
{
|
||||
Model.rf_messageuser tmp = GetOneBy(x => x.MessageId == messageId && x.UserId == userId);
|
||||
if (tmp == null)
|
||||
return 0;
|
||||
tmp.IsRead = 1;
|
||||
tmp.ReadTime = DateExtensions.Now;
|
||||
return Update(tmp);
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新一个人员的所有未读消息为已读
|
||||
/// </summary>
|
||||
/// <param name="messageUsers"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateAllIsRead()
|
||||
{
|
||||
IUserManager m = Furion.App.GetService<IUserManager>();
|
||||
return db.Ado.ExecuteCommand("UPDATE RF_MessageUser SET IsRead=1,ReadTime="
|
||||
+ DateExtensions.Now.ToString() + " WHERE IsRead=0 AND UserId="+m.UserId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除一批消息
|
||||
/// </summary>
|
||||
/// <param name="guids">要删除的id</param>
|
||||
/// <param name="userId">用户ID</param>
|
||||
/// <returns></returns>
|
||||
public int Delete(IEnumerable<string> guids, string userId)
|
||||
{
|
||||
|
||||
var msgs = GetListBy(x => x.UserId == userId && guids.Contains(x.Id));
|
||||
return Delete(msgs);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
71
back_end_code/Ewide.RoadFlow/Data/Organize/IOrganize.cs
Normal file
71
back_end_code/Ewide.RoadFlow/Data/Organize/IOrganize.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using Ewide.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IOrganize
|
||||
{
|
||||
/// <summary>
|
||||
/// 人员前缀
|
||||
/// </summary>
|
||||
const string PREFIX_USER = "u_";
|
||||
/// <summary>
|
||||
/// 工作组前缀
|
||||
/// </summary>
|
||||
const string PREFIX_WORKGROUP = "w_";
|
||||
/// <summary>
|
||||
/// 人员兼职前缀
|
||||
/// </summary>
|
||||
const string PREFIX_RELATION = "r_";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID字符串得到所有人员ID
|
||||
/// </summary>
|
||||
/// <param name="idString">u_人员,id,w_工作且,r_兼职</param>
|
||||
/// <returns>逗号分开的ID</returns>
|
||||
public string GetAllUsersId(string idString);
|
||||
/// <summary>
|
||||
/// 得到一个机构下所有人员
|
||||
/// </summary>
|
||||
/// <param name="id">机构ID</param>
|
||||
/// <param name="hasPartTime">是否包含兼任人员</param>
|
||||
/// <returns></returns>
|
||||
public List<SysUser> GetAllUsers(string id, bool hasPartTime = true);
|
||||
|
||||
/// <summary>
|
||||
/// 得到所有下级组织机构
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="isMe">是否包含自己</param>
|
||||
/// <returns></returns>
|
||||
public List<SysOrg> GetAllChilds(string id, bool isMe = false);
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID查询一个组织机构
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public SysOrg Get(string id);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个人员的主要组织显示
|
||||
/// </summary>
|
||||
/// <param name="id">人员ID</param>
|
||||
/// <param name="isShowRoot">是否显示根</param>
|
||||
/// <returns></returns>
|
||||
public string GetOrganizeMainShowHtml(string id, bool isShowRoot = true);
|
||||
/// <summary>
|
||||
/// 得到一个人员的主要组织显示
|
||||
/// </summary>
|
||||
/// <param name="id">人员ID</param>
|
||||
/// <param name="isShowRoot">是否显示根</param>
|
||||
/// <returns></returns>
|
||||
public Dictionary<string, string> GetOrganizeMainShowHtml(IEnumerable<string> ids, bool isShowRoot = true);
|
||||
}
|
||||
}
|
||||
269
back_end_code/Ewide.RoadFlow/Data/Organize/Organize.cs
Normal file
269
back_end_code/Ewide.RoadFlow/Data/Organize/Organize.cs
Normal file
@@ -0,0 +1,269 @@
|
||||
using Ewide.Core;
|
||||
using Furion;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Furion.DependencyInjection;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class Organize:IOrganize, ITransient
|
||||
{
|
||||
private readonly IRepository<SysUser> _sysUserRep = App.GetService<IRepository<SysUser>>(); // 用户表仓储
|
||||
private readonly IRepository<SysOrg> _sysOrgRep = App.GetService<IRepository<SysOrg>>();
|
||||
private readonly IRepository<SysEmp> _sysEmpRep = App.GetService<IRepository<SysEmp>>();
|
||||
private readonly IRepository<SysEmpExtOrgPos> _sysEmpExtOrgPosRep = App.GetService<IRepository<SysEmpExtOrgPos>>();
|
||||
private readonly IUserManager _userManager = App.GetService<IUserManager>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID字符串得到所有人员ID
|
||||
/// </summary>
|
||||
/// <param name="idString">u_人员,id,w_工作且,r_兼职</param>
|
||||
/// <returns>逗号分开的ID</returns>
|
||||
public string GetAllUsersId(string idString)
|
||||
{
|
||||
var users = GetAllUsers(idString);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
foreach (var user in users)
|
||||
{
|
||||
stringBuilder.Append(user.Id);
|
||||
stringBuilder.Append(",");
|
||||
}
|
||||
return stringBuilder.ToString().TrimEnd(',');
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个机构下所有人员
|
||||
/// </summary>
|
||||
/// <param name="id">机构ID</param>
|
||||
/// <param name="hasPartTime">是否包含兼任人员</param>
|
||||
/// <returns></returns>
|
||||
public List<SysUser> GetAllUsers(string id, bool hasPartTime = true)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(id)&&id.StartsWith(IOrganize.PREFIX_USER))
|
||||
return _sysUserRep.DetachedEntities.Where(x => x.Id == id.RemoveUserPrefix()).ToList();
|
||||
|
||||
var allChilds = GetAllChilds(id, true);
|
||||
List<string> orgids = new List<string>();
|
||||
foreach (var child in allChilds)
|
||||
{
|
||||
orgids.Add(child.Id);
|
||||
}
|
||||
List<string> userIds = new List<string>();
|
||||
var empList =_sysEmpRep.DetachedEntities.Where(x => orgids.Contains(x.OrgId)).ToList();
|
||||
foreach (var emp in empList)
|
||||
userIds.Add(emp.Id);
|
||||
if (hasPartTime)
|
||||
{
|
||||
var empExtList = _sysEmpExtOrgPosRep.DetachedEntities.Where(x => orgids.Contains(x.SysOrgId)).ToList();
|
||||
foreach (var emp in empExtList)
|
||||
userIds.Add(emp.SysEmpId);
|
||||
}
|
||||
|
||||
return _sysUserRep.DetachedEntities.Where(x => userIds.Contains(x.Id)).ToList();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得到所有下级组织机构
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="isMe">是否包含自己</param>
|
||||
/// <returns></returns>
|
||||
public List<SysOrg> GetAllChilds(string id, bool isMe = false)
|
||||
{
|
||||
List<SysOrg> organizes = new List<SysOrg>();
|
||||
var org = Get(id);
|
||||
if (null == org)
|
||||
{
|
||||
return organizes;
|
||||
}
|
||||
if (isMe)
|
||||
{
|
||||
organizes.Add(org);
|
||||
}
|
||||
var all = _sysOrgRep.DetachedEntities.ToList();//GetAll();
|
||||
AddChilds(org, organizes, all);
|
||||
return organizes;
|
||||
}
|
||||
private void AddChilds(SysOrg organize, List<SysOrg> organizes, List<SysOrg> all)
|
||||
{
|
||||
if (null == organize)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var childs = all.FindAll(p => p.Pid == organize.Id).OrderBy(p => p.Sort).ToList();
|
||||
foreach (var child in childs)
|
||||
{
|
||||
organizes.Add(child);
|
||||
AddChilds(child, organizes, all);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据ID查询一个组织机构
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public SysOrg Get(string id)
|
||||
{
|
||||
return _sysOrgRep.DetachedEntities.FirstOrDefault(x=>x.Id ==id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据JSON字符串得到组织机构选择属性
|
||||
/// </summary>
|
||||
/// <param name="json">例:{"dept":"1","station":"0"}</param>
|
||||
/// <returns>dept="1" station="0"</returns>
|
||||
public string GetOrganizeAttrString(string json)
|
||||
{
|
||||
Newtonsoft.Json.Linq.JObject jObject = null;
|
||||
try
|
||||
{
|
||||
jObject = Newtonsoft.Json.Linq.JObject.Parse(json);
|
||||
}
|
||||
catch { }
|
||||
if (null == jObject)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
string unit = jObject.Value<string>("unit");
|
||||
string dept = jObject.Value<string>("dept");
|
||||
string station = jObject.Value<string>("station");
|
||||
string user = jObject.Value<string>("user");
|
||||
string more = jObject.Value<string>("more");
|
||||
string group = jObject.Value<string>("group");
|
||||
string role = jObject.Value<string>("role");
|
||||
string rootid = jObject.Value<string>("rootid");
|
||||
stringBuilder.Append(" unit=\"" + (unit.IsNullOrWhiteSpace() ? "0" : unit) + "\"");
|
||||
stringBuilder.Append(" dept=\"" + (dept.IsNullOrWhiteSpace() ? "0" : dept) + "\"");
|
||||
stringBuilder.Append(" station=\"" + (station.IsNullOrWhiteSpace() ? "0" : station) + "\"");
|
||||
stringBuilder.Append(" user=\"" + (user.IsNullOrWhiteSpace() ? "0" : user) + "\"");
|
||||
stringBuilder.Append(" more=\"" + (more.IsNullOrWhiteSpace() ? "0" : more) + "\"");
|
||||
stringBuilder.Append(" group=\"" + (group.IsNullOrWhiteSpace() ? "0" : group) + "\"");
|
||||
stringBuilder.Append(" role=\"" + (role.IsNullOrWhiteSpace() ? "0" : role) + "\"");
|
||||
stringBuilder.Append(" rootid=\"" + (rootid.IsNullOrWhiteSpace() ? "" : rootid) + "\"");
|
||||
return stringBuilder.ToString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据ID字符串得到名称
|
||||
/// </summary>
|
||||
/// <param name="idString">逗号分开的人员ID,机构ID,工作组ID等</param>
|
||||
/// <param name="splitChar">多个名称之前的分隔字符</param>
|
||||
/// <returns></returns>
|
||||
public string GetNames(string idString, string splitChar = "、")
|
||||
{
|
||||
if (idString.IsNullOrWhiteSpace())
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
foreach (string id in idString.Split(','))
|
||||
{
|
||||
if (id.IsGuid(out Guid orgId))
|
||||
{
|
||||
stringBuilder.Append(_sysOrgRep.DetachedEntities.FirstOrDefault(x => x.Id == id)?.Name);
|
||||
stringBuilder.Append(splitChar);
|
||||
}
|
||||
else if (id.StartsWith(IOrganize.PREFIX_USER))
|
||||
{
|
||||
stringBuilder.Append(_sysUserRep.DetachedEntities.FirstOrDefault(x=>x.Id==id.RemoveUserPrefix())?.Name);
|
||||
stringBuilder.Append(splitChar);
|
||||
}
|
||||
else if (id.StartsWith(IOrganize.PREFIX_RELATION))
|
||||
{
|
||||
|
||||
stringBuilder.Append(_sysUserRep.DetachedEntities.FirstOrDefault(x => x.Id == id.RemoveUserRelationPrefix())?.Name);
|
||||
stringBuilder.Append(splitChar);
|
||||
|
||||
}
|
||||
else if (id.StartsWith(IOrganize.PREFIX_WORKGROUP))
|
||||
{
|
||||
/* 无workgroup
|
||||
stringBuilder.Append(workGroup.GetName(id.RemoveWorkGroupPrefix().ToGuid()));
|
||||
stringBuilder.Append(splitChar);
|
||||
*/
|
||||
}
|
||||
}
|
||||
return stringBuilder.ToString().TrimEnd(splitChar.ToCharArray());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个人员的主要组织显示
|
||||
/// </summary>
|
||||
/// <param name="id">人员ID</param>
|
||||
/// <param name="isShowRoot">是否显示根</param>
|
||||
/// <returns></returns>
|
||||
public string GetOrganizeMainShowHtml(string id, bool isShowRoot = true)
|
||||
{
|
||||
var emp =_sysEmpRep.DetachedEntities.FirstOrDefault(x => x.Id == id);
|
||||
if (emp == null)
|
||||
return "";
|
||||
var org = _sysOrgRep.DetachedEntities.FirstOrDefault(x=>x.Id==emp.OrgId);
|
||||
string[] pararr = org.Pids.TrimStart('[').TrimEnd(',',']').Split("],[");
|
||||
var parents = _sysOrgRep.DetachedEntities.Where(x => pararr.Contains(x.Id));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
var tmp = org;
|
||||
while (tmp.Pid != "00000000 - 0000 - 0000 - 0000 - 000000000000")
|
||||
{
|
||||
sb.Insert(0, "\\" + tmp.Name);
|
||||
tmp = parents.FirstOrDefault(x => x.Id == tmp.Pid);
|
||||
}
|
||||
if(isShowRoot)
|
||||
sb.Insert(0, tmp.Name);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个人员的主要组织显示
|
||||
/// </summary>
|
||||
/// <param name="id">人员ID</param>
|
||||
/// <param name="isShowRoot">是否显示根</param>
|
||||
/// <returns></returns>
|
||||
public Dictionary<string,string> GetOrganizeMainShowHtml(IEnumerable<string> ids, bool isShowRoot = true)
|
||||
{
|
||||
var emps =_sysEmpRep.DetachedEntities.ToList();
|
||||
var orgs = _sysOrgRep.DetachedEntities.ToList();
|
||||
Dictionary<string, string> rtn = new Dictionary<string, string>();
|
||||
foreach (string id in ids)
|
||||
{
|
||||
var emp =emps.FirstOrDefault(x => x.Id == id);
|
||||
if (emp == null)
|
||||
rtn.Add(id, "");
|
||||
else
|
||||
{
|
||||
string orgId = emp.OrgId;
|
||||
var org =orgs.FirstOrDefault(x => x.Id == orgId);
|
||||
if (org == null)
|
||||
{
|
||||
rtn.Add(id, "");
|
||||
continue;
|
||||
}
|
||||
string[] pararr = org.Pids.TrimStart('[').TrimEnd(',', ']').Split("],[");
|
||||
var parents = orgs.Where(x => pararr.Contains(x.Id));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
var tmp = org;
|
||||
while (tmp.Pid != "00000000 - 0000 - 0000 - 0000 - 000000000000")
|
||||
{
|
||||
sb.Insert(0, "\\" + tmp.Name);
|
||||
tmp = parents.FirstOrDefault(x => x.Id == tmp.Pid);
|
||||
}
|
||||
if(isShowRoot)
|
||||
sb.Insert(0, tmp.Name);
|
||||
rtn.Add(id, sb.ToString());
|
||||
}
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
}
|
||||
}
|
||||
31
back_end_code/Ewide.RoadFlow/Data/Program/IProgram.cs
Normal file
31
back_end_code/Ewide.RoadFlow/Data/Program/IProgram.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Ewide.Core;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IProgram : IRoadFlowRepository<RoadFlow.Model.rf_program>
|
||||
{
|
||||
/// <summary>
|
||||
/// 得到运行时实体
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
public Model.ProgramRun GetRunModel(string id, IStringLocalizer localizer = null);
|
||||
|
||||
/// <summary>
|
||||
/// 得到运行时实体
|
||||
/// </summary>
|
||||
/// <param name="id">应用程序ID,RF_Program表ID</param>
|
||||
/// <param name="userModel">用户实体,用于判断按钮权限</param>
|
||||
/// <param name="menuId">菜单id</param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
public Model.ProgramRun VueGetRunModel(string id, SysUser userModel, string menuId, IStringLocalizer localizer = null);
|
||||
}
|
||||
}
|
||||
757
back_end_code/Ewide.RoadFlow/Data/Program/Program.cs
Normal file
757
back_end_code/Ewide.RoadFlow/Data/Program/Program.cs
Normal file
@@ -0,0 +1,757 @@
|
||||
using Ewide.Core;
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class Program: RoadFlowRepository<RoadFlow.Model.rf_program>,IProgram, ITransient
|
||||
{
|
||||
/// <summary>
|
||||
/// 得到运行时实体
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
public Model.ProgramRun GetRunModel(string id, IStringLocalizer localizer = null)
|
||||
{
|
||||
string key = "ProgramRun_" + id;
|
||||
var obj = _memoryCache.Get(key);
|
||||
if (obj != null)
|
||||
{
|
||||
return (Model.ProgramRun)obj;
|
||||
}
|
||||
else
|
||||
{
|
||||
var programModel = GetOneById(id);
|
||||
if (null == programModel)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
Model.ProgramRun programRunModel = new Model.ProgramRun
|
||||
{
|
||||
ButtonLocation = programModel.ButtonLocation,
|
||||
ClientScript = programModel.ClientScript,
|
||||
ConnId = programModel.ConnId.ToGuid(),
|
||||
CreateTime = programModel.CreateTime,
|
||||
CreateUserId = programModel.CreateUserId.ToGuid(),
|
||||
EditModel = programModel.EditModel,
|
||||
ExportFileName = programModel.ExportFileName,
|
||||
ExportHeaderText = programModel.ExportHeaderText,
|
||||
ExportTemplate = programModel.ExportTemplate,
|
||||
FormId = programModel.FormId,
|
||||
Height = programModel.Height,
|
||||
Id = programModel.Id.ToGuid(),
|
||||
InDataNumberFiledName = programModel.InDataNumberFiledName,
|
||||
IsAdd = programModel.IsAdd,
|
||||
IsPager = programModel.IsPager,
|
||||
RowNumber = programModel.RowNumber,
|
||||
Name = programModel.Name,
|
||||
ProgramButtons = new ProgramButton().GetAllByProgramId(programModel.Id),
|
||||
ProgramExports = new ProgramExport().GetAllByProgramId(programModel.Id),
|
||||
ProgramFields = new ProgramField().GetAllByProgramId(programModel.Id),
|
||||
ProgramQueries = new ProgramQuery().GetAllByProgramId(programModel.Id),
|
||||
ProgramValidates = new ProgramValidate().GetAllByProgramId(programModel.Id),
|
||||
PublishTime = programModel.PublishTime,
|
||||
SelectColumn = programModel.SelectColumn,
|
||||
SqlString = programModel.SqlString,
|
||||
Status = programModel.Status,
|
||||
TableHead = programModel.TableHead,
|
||||
TableStyle = programModel.TableStyle,
|
||||
Type = programModel.Type.ToGuid(),
|
||||
Width = programModel.Width,
|
||||
GroupHeaders = programModel.GroupHeaders,
|
||||
DefaultSort = programModel.DefaultSort,
|
||||
EditEvents = programModel.EditEvents
|
||||
};
|
||||
programRunModel.QueryHtml = GetQueryHtml(programRunModel.ProgramQueries, localizer);
|
||||
programRunModel.QueryData = GetQueryData(programRunModel.ProgramQueries);
|
||||
programRunModel.GridColNames = GetColNames(programRunModel.ProgramFields);
|
||||
programRunModel.GridColModels = GetColModels(programRunModel.ProgramFields);
|
||||
programRunModel.DefaultSort =
|
||||
programModel.DefaultSort.IsNullOrWhiteSpace() ? GetDefaultSort(programRunModel.ProgramFields) : programModel.DefaultSort;
|
||||
|
||||
_memoryCache.Set(key, programRunModel);
|
||||
return programRunModel;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 得到查询HTML
|
||||
/// </summary>
|
||||
/// <param name="programQueries"></param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
private string GetQueryHtml(List<Model.rf_programquery> programQueries, IStringLocalizer localizer = null)
|
||||
{
|
||||
StringBuilder query_controls = new StringBuilder();
|
||||
if (null == programQueries)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
foreach (var query in programQueries)
|
||||
{
|
||||
string title = query.ShowTitle.IsNullOrWhiteSpace() ? query.Field : query.ShowTitle;
|
||||
string controlName = query.ControlName.IsNullOrWhiteSpace() ? "ctl_" + query.Id : query.ControlName;
|
||||
query_controls.Append("<span style=\"margin-right:8px;display:inline-block;word-wrap:break-word;white-space:normal;\">");
|
||||
query_controls.Append("<label>" + title + ":</label>");
|
||||
switch (query.InputType)
|
||||
{
|
||||
case 0: //文本框
|
||||
query_controls.Append("<input type='text' class='mytext'");
|
||||
query_controls.Append(" id='" + controlName + "'");
|
||||
query_controls.Append(" name='" + controlName + "'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
query_controls.Append("/>");
|
||||
break;
|
||||
case 1://日期
|
||||
query_controls.Append("<input type='text' class='mycalendar'");
|
||||
query_controls.Append(" id='" + controlName + "'");
|
||||
query_controls.Append(" name='" + controlName + "'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
query_controls.Append("/>");
|
||||
break;
|
||||
case 2://日期范围
|
||||
query_controls.Append("<input type='text' class='mycalendar'");
|
||||
query_controls.Append(" id='" + controlName + "'");
|
||||
query_controls.Append(" name='" + controlName + "'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
query_controls.Append("/>");
|
||||
query_controls.Append(localizer == null ? (localizer == null ? " 至 " : localizer["To"]) : localizer["To"]);
|
||||
query_controls.Append("<input type='text' class='mycalendar'");
|
||||
query_controls.Append(" id='" + controlName + "1'");
|
||||
query_controls.Append(" name='" + controlName + "1'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
query_controls.Append("/>");
|
||||
break;
|
||||
case 3://日期时间
|
||||
query_controls.Append("<input type='text' class='mycalendar' istime='1'");
|
||||
query_controls.Append(" id='" + controlName + "'");
|
||||
query_controls.Append(" name='" + controlName + "'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
query_controls.Append("/>");
|
||||
break;
|
||||
case 4://日期时间范围
|
||||
query_controls.Append("<input type='text' class='mycalendar' istime='1'");
|
||||
query_controls.Append(" id='" + controlName + "'");
|
||||
query_controls.Append(" name='" + controlName + "'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
query_controls.Append("/>");
|
||||
query_controls.Append(localizer == null ? (localizer == null ? " 至 " : localizer["To"]) : localizer["To"]);
|
||||
query_controls.Append("<input type='text' class='mycalendar' istime='1'");
|
||||
query_controls.Append(" id='" + controlName + "1'");
|
||||
query_controls.Append(" name='" + controlName + "1'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
query_controls.Append("/>");
|
||||
break;
|
||||
case 5://下拉选项
|
||||
query_controls.Append("<select class='myselect'");
|
||||
query_controls.Append(" id='" + controlName + "'");
|
||||
query_controls.Append(" name='" + controlName + "'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
query_controls.Append(">");
|
||||
query_controls.Append("<option value=\"\"></option>");
|
||||
switch (query.DataSource.Value)
|
||||
{
|
||||
case 0://字符串表达式
|
||||
query_controls.Append(new Form().GetOptionsByStringExpression(query.DataSourceString, ""));
|
||||
break;
|
||||
case 1://数据字典
|
||||
Dictionary.ValueField valueField = Dictionary.ValueField.Id;
|
||||
switch (query.OrgAttribute.ToInt(0))
|
||||
{
|
||||
case 1:
|
||||
valueField = Dictionary.ValueField.Title;
|
||||
break;
|
||||
case 2:
|
||||
valueField = Dictionary.ValueField.Code;
|
||||
break;
|
||||
case 3:
|
||||
valueField = Dictionary.ValueField.Value;
|
||||
break;
|
||||
case 4:
|
||||
valueField = Dictionary.ValueField.Note;
|
||||
break;
|
||||
case 5:
|
||||
valueField = Dictionary.ValueField.Other;
|
||||
break;
|
||||
default:
|
||||
valueField = Dictionary.ValueField.Id;
|
||||
break;
|
||||
}
|
||||
query_controls.Append(new Dictionary().GetOptionsByID(query.DictValue, valueField));
|
||||
break;
|
||||
case 2://SQL
|
||||
query_controls.Append(new Form().GetOptionsBySQL(query.ConnId, query.DataSourceString, ""));
|
||||
break;
|
||||
}
|
||||
query_controls.Append("</select>");
|
||||
break;
|
||||
case 6://组织机构选择
|
||||
query_controls.Append("<input type='text' class='mymember'");
|
||||
query_controls.Append(" id='" + controlName + "'");
|
||||
query_controls.Append(" name='" + controlName + "'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
string orgOptions = new Organize().GetOrganizeAttrString(query.OrgAttribute);
|
||||
query_controls.Append(orgOptions);
|
||||
query_controls.Append("/>");
|
||||
break;
|
||||
case 7://数据字典选择
|
||||
query_controls.Append("<input type='text' class='mydict'");
|
||||
query_controls.Append(" id='" + controlName + "'");
|
||||
query_controls.Append(" name='" + controlName + "'");
|
||||
query_controls.Append(" rootid='" + query.DictValue + "'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
query_controls.Append("/>");
|
||||
break;
|
||||
}
|
||||
query_controls.Append("</span>");
|
||||
}
|
||||
return query_controls.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得到查询的JSON data
|
||||
/// </summary>
|
||||
/// <param name="programQueries"></param>
|
||||
/// <returns></returns>
|
||||
private string GetQueryData(List<Model.rf_programquery> programQueries)
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.Append("\"pagesize\": size || curPageSize, \"pagenumber\": number || curPageNumber,");
|
||||
foreach (var query in programQueries)
|
||||
{
|
||||
string controlName = query.ControlName.IsNullOrWhiteSpace() ? "ctl_" + query.Id : query.ControlName;
|
||||
stringBuilder.Append("\"" + controlName + "\":$(\"#" + controlName + "\").val(),");
|
||||
if (query.InputType.In(2, 4))//如果是日期时间范围要加上截止时间
|
||||
{
|
||||
stringBuilder.Append("\"" + controlName + "1\":$(\"#" + controlName + "1\").val(),");
|
||||
}
|
||||
}
|
||||
return "{" + stringBuilder.ToString().TrimEnd(',') + "}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到Grid列头
|
||||
/// </summary>
|
||||
/// <param name="programFields"></param>
|
||||
/// <returns></returns>
|
||||
private string GetColNames(List<Model.rf_programfield> programFields)
|
||||
{
|
||||
if (null == programFields)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.Append("[");
|
||||
foreach (var field in programFields)
|
||||
{
|
||||
stringBuilder.Append("\"" + (field.ShowTitle.IsNullOrWhiteSpace() ? field.Field : field.ShowTitle) + "\",");
|
||||
}
|
||||
return stringBuilder.ToString().TrimEnd(',') + "]";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到GRID列JSON
|
||||
/// </summary>
|
||||
/// <param name="programFields"></param>
|
||||
/// <returns></returns>
|
||||
private string GetColModels(List<Model.rf_programfield> programFields)
|
||||
{
|
||||
if (null == programFields)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
Newtonsoft.Json.Linq.JArray jArray = new Newtonsoft.Json.Linq.JArray();
|
||||
foreach (var field in programFields)
|
||||
{
|
||||
Newtonsoft.Json.Linq.JObject jObject = new Newtonsoft.Json.Linq.JObject();
|
||||
string name = field.Field;
|
||||
if (name.IsNullOrWhiteSpace())
|
||||
{
|
||||
if (100 == field.ShowType)
|
||||
{
|
||||
name = "opation";
|
||||
}
|
||||
else if (1 == field.ShowType)
|
||||
{
|
||||
name = "rowserialnumber";
|
||||
}
|
||||
}
|
||||
jObject.Add("name", name);
|
||||
if (!field.IsSort.IsNullOrWhiteSpace())
|
||||
{
|
||||
jObject.Add("index", field.IsSort.Trim());
|
||||
}
|
||||
else
|
||||
{
|
||||
jObject.Add("sortable", false);
|
||||
}
|
||||
if (field.ShowType == 100)
|
||||
{
|
||||
jObject.Add("title", false);
|
||||
}
|
||||
if (field.IsShow == 0)
|
||||
{
|
||||
jObject.Add("hidedlg", true);
|
||||
jObject.Add("hidden", true);
|
||||
}
|
||||
if (!field.Width.IsNullOrWhiteSpace())
|
||||
{
|
||||
jObject.Add("width", field.Width.GetNumber());
|
||||
}
|
||||
jObject.Add("align", field.Align);
|
||||
|
||||
jArray.Add(jObject);
|
||||
}
|
||||
return jArray.ToString(Newtonsoft.Json.Formatting.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到默认排序列
|
||||
/// </summary>
|
||||
/// <param name="programFields"></param>
|
||||
/// <returns></returns>
|
||||
private string GetDefaultSort(List<Model.rf_programfield> programFields)
|
||||
{
|
||||
if (null == programFields || programFields.Count == 0)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
var filed = programFields.Find(p => !p.IsSort.IsNullOrWhiteSpace());
|
||||
if (null != filed)
|
||||
{
|
||||
return filed.IsSort;
|
||||
}
|
||||
else
|
||||
{
|
||||
return programFields.First().Field + " ASC";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到运行时实体
|
||||
/// </summary>
|
||||
/// <param name="id">应用程序ID,RF_Program表ID</param>
|
||||
/// <param name="userModel">用户实体,用于判断按钮权限</param>
|
||||
/// <param name="menuId">菜单id</param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
public Model.ProgramRun VueGetRunModel(string id, SysUser userModel, string menuId, IStringLocalizer localizer = null)
|
||||
{
|
||||
string key = "ProgramRun_VUE_" + id;
|
||||
var obj = _memoryCache.Get(key);
|
||||
Model.ProgramRun programRunModel;
|
||||
if (obj != null)
|
||||
{
|
||||
programRunModel = (Model.ProgramRun)obj;
|
||||
}
|
||||
else
|
||||
{
|
||||
var programModel = GetOneById(id);
|
||||
if (null == programModel)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
programRunModel = new Model.ProgramRun
|
||||
{
|
||||
ButtonLocation = programModel.ButtonLocation,
|
||||
ClientScript = programModel.ClientScript,
|
||||
ConnId = programModel.ConnId.ToGuid(),
|
||||
CreateTime = programModel.CreateTime,
|
||||
CreateUserId = programModel.CreateUserId.ToGuid(),
|
||||
EditModel = programModel.EditModel,
|
||||
ExportFileName = programModel.ExportFileName,
|
||||
ExportHeaderText = programModel.ExportHeaderText,
|
||||
ExportTemplate = programModel.ExportTemplate,
|
||||
FormId = programModel.FormId,
|
||||
Height = programModel.Height,
|
||||
Id = programModel.Id.ToGuid(),
|
||||
InDataNumberFiledName = programModel.InDataNumberFiledName,
|
||||
IsAdd = programModel.IsAdd,
|
||||
IsPager = programModel.IsPager,
|
||||
RowNumber = programModel.RowNumber,
|
||||
Name = programModel.Name,
|
||||
ProgramButtons = new ProgramButton().GetAllByProgramId(programModel.Id),
|
||||
ProgramExports = new ProgramExport().GetAllByProgramId(programModel.Id),
|
||||
ProgramFields = new ProgramField().GetAllByProgramId(programModel.Id),
|
||||
ProgramQueries = new ProgramQuery().GetAllByProgramId(programModel.Id),
|
||||
ProgramValidates = new ProgramValidate().GetAllByProgramId(programModel.Id),
|
||||
PublishTime = programModel.PublishTime,
|
||||
SelectColumn = programModel.SelectColumn,
|
||||
SqlString = programModel.SqlString,
|
||||
Status = programModel.Status,
|
||||
TableHead = programModel.TableHead,
|
||||
TableStyle = programModel.TableStyle,
|
||||
Type = programModel.Type.ToGuid(),
|
||||
Width = programModel.Width,
|
||||
GroupHeaders = programModel.GroupHeaders,
|
||||
DefaultSort = programModel.DefaultSort,
|
||||
EditEvents = programModel.EditEvents
|
||||
};
|
||||
programRunModel.QueryHtml = VueGetRunHtml(programRunModel, localizer);
|
||||
_memoryCache.Set(key, programRunModel);
|
||||
}
|
||||
|
||||
//替换按钮
|
||||
if (userModel != null)
|
||||
{
|
||||
var (normalButton, listButton) = VueGetButtons(programRunModel.ProgramButtons, userModel, menuId);
|
||||
programRunModel.QueryHtml = programRunModel.QueryHtml.Replace("{<button-normal>}", normalButton);
|
||||
foreach (JObject jObject in programRunModel.Cols)
|
||||
{
|
||||
if (jObject.ContainsKey("buttons"))
|
||||
{
|
||||
jObject["buttons"] = listButton;
|
||||
}
|
||||
}
|
||||
}
|
||||
return programRunModel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到运行时VUE组件HTML
|
||||
/// </summary>
|
||||
/// <param name="programRun"></param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
public string VueGetRunHtml(Model.ProgramRun programRunModel, IStringLocalizer localizer = null)
|
||||
{
|
||||
if (programRunModel == null)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
StringBuilder html = new StringBuilder();
|
||||
#region 查询字段
|
||||
string queryHtml = VueGetQueryHtml(programRunModel.ProgramQueries, localizer);
|
||||
html.Append("<div style='padding:0 10px;'>");
|
||||
html.Append(queryHtml);
|
||||
//查询按钮(查询后面)
|
||||
if (programRunModel.ButtonLocation == 1)
|
||||
{
|
||||
if (!queryHtml.IsNullOrWhiteSpace())
|
||||
{
|
||||
html.Append("<roadui-button @click.native=\"query()\">" + (localizer == null ? "查询" : localizer["Query"].Value) + "</roadui-button>");
|
||||
}
|
||||
//{<button-normal>}作为占位符,实际运行时根据当前用户获取有权限的按钮填充。
|
||||
html.Append("{<button-normal>}");
|
||||
}
|
||||
html.Append("</div>");
|
||||
//查询按钮(新行)
|
||||
if (programRunModel.ButtonLocation == 0)
|
||||
{
|
||||
html.Append("<div style='text-align:center;margin:15px 0 10px 0;'>" + (queryHtml.IsNullOrWhiteSpace() ? string.Empty : "<roadui-button @click.native=\"query()\">" + (localizer == null ? "查询" : localizer["Query"].Value) + "</roadui-button>") + "{<button-normal>}</div>");
|
||||
}
|
||||
#endregion
|
||||
#region 列表
|
||||
html.Append("<roadui-table style=\"margin-top:15px;\" :cols=\"cols\" :rows=\"table.rows\" :loading=\"loading\" :total=\"table.total\""
|
||||
+ " :pagenumber.sync=\"number\" :pagesize.sync=\"size\" :ordertype=\"0\" :height=\"tableHeight\""
|
||||
+ (programRunModel.RowNumber == 1 ? " number" : "")
|
||||
+ (programRunModel.SelectColumn == 2 ? " checkbox" : programRunModel.SelectColumn == 1 ? " radio" : "") + " v-model=\"selectRows\""
|
||||
+ (programRunModel.TableHead.IsNullOrWhiteSpace() ? "" : " :mythead=\"myThead\"")
|
||||
+ " :pager=\"" + (programRunModel.IsPager == 1 ? "true" : "false") + "\" :order.sync=\"order\" @load=\"query\"></roadui-table>");
|
||||
programRunModel.Cols = VueGetCols(programRunModel.ProgramFields);
|
||||
#endregion
|
||||
return html.ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取按钮
|
||||
/// </summary>
|
||||
/// <param name="programButtons"></param>
|
||||
/// <param name="userModel"></param>
|
||||
/// <param name="menuId">菜单id</param>
|
||||
/// <returns>(常规按钮,列表按钮)</returns>
|
||||
public (string, JArray) VueGetButtons(List<Model.rf_programbutton> programButtons, SysUser userModel, string menuId)
|
||||
{
|
||||
StringBuilder button_normal = new StringBuilder();
|
||||
JArray button_list = new JArray();
|
||||
|
||||
List<Model.rf_menuuser> menuusers = new MenuUser().GetAll();
|
||||
Menu menu = new Menu();
|
||||
SystemButton systemButton = new SystemButton();
|
||||
string language = Tools.GetCurrentLanguage();
|
||||
foreach (var button in programButtons.OrderBy(p => p.Sort))
|
||||
{
|
||||
//检查权限
|
||||
if (1 == button.IsValidateShow)
|
||||
{
|
||||
if (!menu.HasUseButton(menuId, button.Id, userModel.Id, menuusers))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
string butName = button.ButtonName;
|
||||
string ico = button.Ico;
|
||||
string note = button.Note;
|
||||
if (button.ShowType == 1)//常规按钮
|
||||
{
|
||||
button_normal.Append("<roadui-button");
|
||||
button_normal.Append(" @click.native=\"execScript('" + RoadFlow.Business.Wildcard.Filter(button.ClientScript, userModel).UrlEncode() + "')\"");
|
||||
if (!ico.IsNullOrWhiteSpace())
|
||||
{
|
||||
button_normal.Append(" ico=\"" + ico + "\"");
|
||||
}
|
||||
if (!note.IsNullOrWhiteSpace())
|
||||
{
|
||||
button_normal.Append(" title=\"" + note + "\"");
|
||||
}
|
||||
button_normal.Append(">");
|
||||
if (!butName.IsNullOrWhiteSpace())
|
||||
{
|
||||
button_normal.Append(butName);
|
||||
}
|
||||
button_normal.Append("</roadui-button>");
|
||||
}
|
||||
else if (button.ShowType == 2)//列表按钮 不替换通配符,列表按钮涉及运行时数据,在运行时替换。
|
||||
{
|
||||
button_list.Add(new JObject()
|
||||
{
|
||||
{ "title", butName },
|
||||
{ "ico", ico },
|
||||
{ "fun", RoadFlow.Business.Wildcard.Filter(button.ClientScript, userModel).UrlEncode()},
|
||||
{ "note", note },
|
||||
});
|
||||
}
|
||||
}
|
||||
return (button_normal.ToString(), button_list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到VUE查询HTML
|
||||
/// </summary>
|
||||
/// <param name="programQueries"></param>
|
||||
/// <param name="localizer">语言包</param>
|
||||
/// <returns></returns>
|
||||
public string VueGetQueryHtml(List<Model.rf_programquery> programQueries, IStringLocalizer localizer = null)
|
||||
{
|
||||
if (null == programQueries)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
StringBuilder query_controls = new StringBuilder();
|
||||
foreach (var query in programQueries)
|
||||
{
|
||||
string title = query.ShowTitle.IsNullOrWhiteSpace() ? query.Field : query.ShowTitle;
|
||||
string controlName = query.ControlName.IsNullOrWhiteSpace() ? "ctl_" + query.Id : query.ControlName;
|
||||
query_controls.Append("<span style=\"margin-right:8px;display:inline-block;word-wrap:break-word;white-space:normal;\">");
|
||||
query_controls.Append(title + ":");
|
||||
switch (query.InputType)
|
||||
{
|
||||
case 0: //文本框
|
||||
query_controls.Append("<roadui-text");
|
||||
query_controls.Append(" v-model='find." + controlName + "'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
query_controls.Append("></roadui-text>");
|
||||
break;
|
||||
case 1://日期
|
||||
query_controls.Append("<roadui-calendar");
|
||||
query_controls.Append(" v-model='find." + controlName + "'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
query_controls.Append("></roadui-calendar>");
|
||||
break;
|
||||
case 2://日期范围
|
||||
query_controls.Append("<roadui-calendar");
|
||||
query_controls.Append(" v-model='find." + controlName + "'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
query_controls.Append("></roadui-calendar>");
|
||||
query_controls.Append(localizer == null ? " 至 " : localizer["To"].Value);
|
||||
query_controls.Append("<roadui-calendar");
|
||||
query_controls.Append(" v-model='find." + controlName + "1'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
query_controls.Append("></roadui-calendar>");
|
||||
break;
|
||||
case 3://日期时间
|
||||
query_controls.Append("<roadui-calendar time='HH:mm'");
|
||||
query_controls.Append(" v-model='find." + controlName + "'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
query_controls.Append("></roadui-calendar>");
|
||||
break;
|
||||
case 4://日期时间范围
|
||||
query_controls.Append("<roadui-calendar time='HH:mm'");
|
||||
query_controls.Append(" v-model='find." + controlName + "'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
query_controls.Append("></roadui-calendar>");
|
||||
query_controls.Append(localizer == null ? " 至 " : localizer["To"].Value);
|
||||
query_controls.Append("<roadui-calendar time='HH:mm'");
|
||||
query_controls.Append(" v-model='find." + controlName + "1'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
query_controls.Append("></roadui-calendar>");
|
||||
break;
|
||||
case 5://下拉选项
|
||||
query_controls.Append("<roadui-combox");
|
||||
query_controls.Append(" v-model='find." + controlName + "'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
switch (query.DataSource.Value)
|
||||
{
|
||||
case 0://字符串表达式
|
||||
query_controls.Append(" :source=\"{type:1,str:'" + query.DataSourceString.UrlEncode().Replace("'", "\\'") + "'}\"");
|
||||
break;
|
||||
case 1://数据字典
|
||||
query_controls.Append(" :source=\"{type:0,dictId:'" + query.DataSourceString + "',childs:1,valueField:'" + query.DictValue + "'}\"");
|
||||
break;
|
||||
case 2://SQL
|
||||
query_controls.Append(" :source=\"{type:2,connId:'" + query.ConnId + "',sql:'" + query.DataSourceString.UrlEncode().Replace("'", "\\'") + "'}\"");
|
||||
break;
|
||||
}
|
||||
query_controls.Append("></roadui-combox>");
|
||||
break;
|
||||
case 6://组织机构选择
|
||||
query_controls.Append("<roadui-org");
|
||||
query_controls.Append(" v-model='find." + controlName + "'");
|
||||
if (!query.ShowStyle.IsNullOrWhiteSpace())
|
||||
{
|
||||
query_controls.Append(" style=\"" + query.ShowStyle + "\"");
|
||||
}
|
||||
JObject orgJObject = query.OrgAttribute.ToJObject();
|
||||
if (!orgJObject.IsEmptyJObject())
|
||||
{
|
||||
string selectrange = orgJObject.Value<string>("selectrange");//选择范围
|
||||
string multiple = orgJObject.Value<string>("multiple");//多选
|
||||
JArray selecttype = orgJObject.Value<JArray>("selecttype");//选择类型
|
||||
JArray selecttype1 = new JArray();
|
||||
foreach (JValue j in selecttype)
|
||||
{
|
||||
if (!j.ToString().IsNullOrWhiteSpace())
|
||||
{
|
||||
selecttype1.Add(j);
|
||||
}
|
||||
}
|
||||
if (selecttype1.Count == 0)//没有设置时为全部可选
|
||||
{
|
||||
selecttype1.Add("unit");
|
||||
selecttype1.Add("dept");
|
||||
selecttype1.Add("station");
|
||||
selecttype1.Add("user");
|
||||
selecttype1.Add("workgroup");
|
||||
}
|
||||
query_controls.Append("1".Equals(multiple) ? " multiple" : "");
|
||||
query_controls.Append(selectrange.IsNullOrWhiteSpace() ? "" : " root='" + selectrange + "'");
|
||||
query_controls.Append(" :selecttype='" + selecttype1.ToString(Newtonsoft.Json.Formatting.None) + "'");
|
||||
}
|
||||
query_controls.Append("></roadui-org>");
|
||||
break;
|
||||
}
|
||||
query_controls.Append("</span>");
|
||||
}
|
||||
return query_controls.ToString();
|
||||
}
|
||||
/// <summary>
|
||||
/// 得到列设置
|
||||
/// </summary>
|
||||
/// <param name="programFields"></param>
|
||||
/// <returns></returns>
|
||||
public JArray VueGetCols(List<Model.rf_programfield> programFields)
|
||||
{
|
||||
JArray jArray = new JArray
|
||||
{
|
||||
//添加id列
|
||||
new JObject()
|
||||
{
|
||||
{ "name", "Id" },
|
||||
{ "title", "" },
|
||||
{ "order", "none" },
|
||||
{ "width", "" },
|
||||
{ "key", true },
|
||||
{ "show", 0 },
|
||||
}
|
||||
};
|
||||
foreach (var field in programFields)
|
||||
{
|
||||
JObject jObject = new JObject() {
|
||||
{ "name", field.Field },
|
||||
{ "title", field.ShowTitle.IsNullOrEmpty() ? field.Field :field.ShowTitle },
|
||||
{ "width", field.Width },
|
||||
{ "align", field.Align },
|
||||
};
|
||||
if (field.IsSort.IsNullOrWhiteSpace())
|
||||
{
|
||||
jObject.Add("order", "none");
|
||||
}
|
||||
if (field.IsShow == 0)
|
||||
{
|
||||
jObject.Add("show", 0);
|
||||
}
|
||||
if (field.ShowType == 100)//操作列
|
||||
{
|
||||
jObject["name"] = "Opation";
|
||||
jObject["order"] = "none";
|
||||
jObject.Add("type", "buttons");
|
||||
jObject.Add("buttons", new JArray());
|
||||
}
|
||||
else if (field.ShowType == 1)//序号列
|
||||
{
|
||||
jObject["name"] = "RowSerialNumber";
|
||||
}
|
||||
else if (field.ShowType.In(8, 9, 10))//显示附件,全部显示,不省略内容, 列加属性noellipsis:true
|
||||
{
|
||||
jObject.Add("noellipsis", true);
|
||||
}
|
||||
jArray.Add(jObject);
|
||||
}
|
||||
return jArray;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IProgramButton : IRoadFlowRepository<RoadFlow.Model.rf_programbutton>
|
||||
{
|
||||
/// <summary>
|
||||
/// 按programId获取
|
||||
/// </summary>
|
||||
/// <param name="programId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_programbutton> GetAllByProgramId(string programId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class ProgramButton: RoadFlowRepository<RoadFlow.Model.rf_programbutton>,IProgramButton, ITransient
|
||||
{
|
||||
/// <summary>
|
||||
/// 按programId获取
|
||||
/// </summary>
|
||||
/// <param name="programId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_programbutton> GetAllByProgramId(string programId)
|
||||
{
|
||||
return this.GetListBy(x => x.ProgramId == programId).ToList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IProgramExport : IRoadFlowRepository<RoadFlow.Model.rf_programexport>
|
||||
{
|
||||
/// <summary>
|
||||
/// 按programId获取
|
||||
/// </summary>
|
||||
/// <param name="programId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_programexport> GetAllByProgramId(string programId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class ProgramExport: RoadFlowRepository<RoadFlow.Model.rf_programexport>, IProgramExport, ITransient
|
||||
{
|
||||
/// <summary>
|
||||
/// 按programId获取
|
||||
/// </summary>
|
||||
/// <param name="programId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_programexport> GetAllByProgramId(string programId)
|
||||
{
|
||||
return this.GetListBy(x => x.ProgramId == programId).ToList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IProgramField : IRoadFlowRepository<RoadFlow.Model.rf_programfield>
|
||||
{
|
||||
/// <summary>
|
||||
/// 按programId获取
|
||||
/// </summary>
|
||||
/// <param name="programId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_programfield> GetAllByProgramId(string programId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class ProgramField: RoadFlowRepository<RoadFlow.Model.rf_programfield>, IProgramField, ITransient
|
||||
{
|
||||
/// <summary>
|
||||
/// 按programId获取
|
||||
/// </summary>
|
||||
/// <param name="programId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_programfield> GetAllByProgramId(string programId)
|
||||
{
|
||||
return this.GetListBy(x => x.ProgramId == programId).ToList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IProgramQuery : IRoadFlowRepository<RoadFlow.Model.rf_programquery>
|
||||
{
|
||||
/// <summary>
|
||||
/// 按programId获取
|
||||
/// </summary>
|
||||
/// <param name="programId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_programquery> GetAllByProgramId(string programId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class ProgramQuery: RoadFlowRepository<RoadFlow.Model.rf_programquery>, IProgramQuery, ITransient
|
||||
{
|
||||
/// <summary>
|
||||
/// 按programId获取
|
||||
/// </summary>
|
||||
/// <param name="programId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_programquery> GetAllByProgramId(string programId)
|
||||
{
|
||||
return this.GetListBy(x => x.ProgramId == programId).ToList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IProgramValidate: IRoadFlowRepository<RoadFlow.Model.rf_programvalidate>
|
||||
{
|
||||
/// <summary>
|
||||
/// 按programId获取
|
||||
/// </summary>
|
||||
/// <param name="programId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_programvalidate> GetAllByProgramId(string programId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class ProgramValidate: RoadFlowRepository<RoadFlow.Model.rf_programvalidate>, IProgramValidate, ITransient
|
||||
{
|
||||
/// <summary>
|
||||
/// 按programId获取
|
||||
/// </summary>
|
||||
/// <param name="programId"></param>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_programvalidate> GetAllByProgramId(string programId)
|
||||
{
|
||||
return this.GetListBy(x => x.ProgramId == programId).ToList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
210
back_end_code/Ewide.RoadFlow/Data/RoadFlowRepository.cs
Normal file
210
back_end_code/Ewide.RoadFlow/Data/RoadFlowRepository.cs
Normal file
@@ -0,0 +1,210 @@
|
||||
using Furion;
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class RoadFlowRepository<T> : IRoadFlowRepository<T>, ITransient where T:RoadFlow.Model.BaseEntity,new()
|
||||
{
|
||||
protected readonly IMemoryCache _memoryCache;
|
||||
protected readonly ISqlSugarRepository repository;
|
||||
protected readonly SqlSugarClient db;
|
||||
protected readonly string CACHEKEY = "roadflow_cache_" + typeof(T).FullName;
|
||||
public RoadFlowRepository()
|
||||
{
|
||||
_memoryCache = App.GetService< IMemoryCache > ();
|
||||
repository = App.GetService<ISqlSugarRepository>();
|
||||
db = repository.Context;
|
||||
//db选择
|
||||
db.ChangeDatabase("RoadFlowDB");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有的数据对象并缓存
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public virtual List<T> GetAll()
|
||||
{
|
||||
return _memoryCache.GetOrCreate(CACHEKEY, v =>
|
||||
{
|
||||
return db.Queryable<T>().ToList();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 按Id获取一个对象
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public virtual T GetOneById(string id)
|
||||
{
|
||||
List<T> list = GetAll();
|
||||
return list.Find(p => p.Id == id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按条件获取一个对象
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <returns></returns>
|
||||
public virtual T GetOneBy(Predicate<T> predicate)
|
||||
{
|
||||
return GetAll().Find(predicate);
|
||||
}
|
||||
/// <summary>
|
||||
/// 按条件获取列表
|
||||
/// </summary>
|
||||
/// <param name="predicate"></param>
|
||||
/// <returns></returns>
|
||||
public virtual List<T> GetListBy(Predicate<T> predicate)
|
||||
{
|
||||
return GetAll().FindAll(predicate);
|
||||
}
|
||||
/// <summary>
|
||||
/// 增加对象
|
||||
/// </summary>
|
||||
/// <param name="t"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int Add(T t)
|
||||
{
|
||||
int rtn =db.Insertable<T>(t).ExecuteCommand();
|
||||
ClearCache();
|
||||
return rtn;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加多个对象
|
||||
/// </summary>
|
||||
/// <param name="ts"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int AddRangeList(List<T> ts)
|
||||
{
|
||||
int rtn =db.Insertable<T>(ts).ExecuteCommand();
|
||||
ClearCache();
|
||||
return rtn;
|
||||
}
|
||||
/// <summary>
|
||||
/// 更新对象
|
||||
/// </summary>
|
||||
/// <param name="t"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int Update(T t,bool clearCache=true)
|
||||
{
|
||||
int rtn =db.Updateable<T>(t).ExecuteCommand();
|
||||
if(clearCache)
|
||||
ClearCache();
|
||||
return rtn;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新多个对象
|
||||
/// </summary>
|
||||
/// <param name="ts"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int Update(List<T> ts,bool trans=true)
|
||||
{
|
||||
int rslt = 0;
|
||||
|
||||
try
|
||||
{
|
||||
if(trans)
|
||||
db.BeginTran();
|
||||
foreach (var t in ts)
|
||||
{
|
||||
rslt += this.Update(t,false);
|
||||
}
|
||||
if(trans)
|
||||
db.CommitTran();
|
||||
ClearCache();
|
||||
}
|
||||
catch
|
||||
{
|
||||
db.RollbackTran();
|
||||
}
|
||||
return rslt;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除对象(物理)
|
||||
/// </summary>
|
||||
/// <param name="t"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int Delete(T t)
|
||||
{
|
||||
int rtn =db.Deleteable<T>(t).ExecuteCommand();
|
||||
ClearCache();
|
||||
return rtn;
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除一批对象(物理)
|
||||
/// </summary>
|
||||
/// <param name="ts"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int Delete(List<T> ts)
|
||||
{
|
||||
int rtn = db.Deleteable<T>(ts).ExecuteCommand();
|
||||
ClearCache();
|
||||
return rtn;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按条件删除对象
|
||||
/// </summary>
|
||||
/// <param name="expression"></param>
|
||||
/// <returns></returns>
|
||||
public virtual int DeleteBy(System.Linq.Expressions.Expression<Func<T, bool>> expression)
|
||||
{
|
||||
int rtn =db.Deleteable<T>(expression).ExecuteCommand();
|
||||
ClearCache();
|
||||
return rtn;
|
||||
}
|
||||
/// <summary>
|
||||
/// 清空缓存
|
||||
/// </summary>
|
||||
public virtual void ClearCache()
|
||||
{
|
||||
_memoryCache.Remove(CACHEKEY);
|
||||
}
|
||||
/// <summary>
|
||||
/// 清空缓存
|
||||
/// </summary>
|
||||
public virtual void ClearCache(string id)
|
||||
{
|
||||
_memoryCache.Remove(CACHEKEY + id);
|
||||
}
|
||||
|
||||
public virtual SqlSugarClient getClient()
|
||||
{
|
||||
// string str =this.db.Ado.Connection.ConnectionString;
|
||||
return this.db;
|
||||
|
||||
}
|
||||
|
||||
public virtual void BeginTrans()
|
||||
{
|
||||
this.db.Ado.BeginTran();
|
||||
}
|
||||
|
||||
public virtual void CommitTran()
|
||||
{
|
||||
this.db.Ado.CommitTran();
|
||||
}
|
||||
|
||||
public virtual void RollbackTran()
|
||||
{
|
||||
this.db.Ado.RollbackTran();
|
||||
}
|
||||
|
||||
public virtual string getCacheKey()
|
||||
{
|
||||
return this.CACHEKEY;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface ISystemButton: IRoadFlowRepository<RoadFlow.Model.rf_systembutton>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class SystemButton: RoadFlowRepository<RoadFlow.Model.rf_systembutton>, ISystemButton, ITransient
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
50
back_end_code/Ewide.RoadFlow/Data/User/IUserDummy.cs
Normal file
50
back_end_code/Ewide.RoadFlow/Data/User/IUserDummy.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using Ewide.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IUserDummy
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据一组ID字符串得到人员的姓名
|
||||
/// </summary>
|
||||
/// <param name="id">逗号分开的ID</param>
|
||||
/// <returns></returns>
|
||||
public string GetNames(string ids);
|
||||
|
||||
/// <summary>
|
||||
/// 判断一个人员ID是否在一个组织机构字符串中
|
||||
/// </summary>
|
||||
/// <param name="organizeIds"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public bool Contains(string organizeIds, string userId);
|
||||
/// <summary>
|
||||
/// 判断一个人员是否在一个组织架构字符串里
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="memberIds"></param>
|
||||
/// <returns></returns>
|
||||
public bool IsIn(string userId, string memberIds);
|
||||
|
||||
/// <summary>
|
||||
/// 得到人员的签章图片路径(VUE版本)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetSignSrcVue(string userId = "", string userName = "");
|
||||
|
||||
/// <summary>
|
||||
/// 得到用户加密后的密码
|
||||
/// </summary>
|
||||
/// <param name="userId">用户ID</param>
|
||||
/// <param name="password">密码</param>
|
||||
/// <returns></returns>
|
||||
public string GetMD5Password(string userId, string password);
|
||||
|
||||
public SysUser Get(string id);
|
||||
}
|
||||
}
|
||||
550
back_end_code/Ewide.RoadFlow/Data/User/UserDummy.cs
Normal file
550
back_end_code/Ewide.RoadFlow/Data/User/UserDummy.cs
Normal file
@@ -0,0 +1,550 @@
|
||||
using Ewide.Core;
|
||||
using Furion;
|
||||
using Furion.DatabaseAccessor;
|
||||
using Furion.DependencyInjection;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RoadFlow.Data;
|
||||
using RoadFlow.Model.FlowRunModel;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class UserDummy: IUserDummy, ITransient
|
||||
{
|
||||
private readonly IRepository<SysUser> _sysUserRep =App.GetService<IRepository<SysUser>>(); // 用户表仓储
|
||||
private readonly IRepository<SysOrg> _sysOrgRep =App.GetService< IRepository<SysOrg>>();
|
||||
private readonly IRepository<SysEmp> _sysEmpRep=App.GetService<IRepository<SysEmp>>();
|
||||
private readonly IRepository<SysEmpExtOrgPos> _sysEmpExtOrgPosRep= App.GetService<IRepository<SysEmpExtOrgPos>>();
|
||||
private readonly IRepository<SysRole> _sysRoleRep= App.GetService<IRepository<SysRole>>();
|
||||
private readonly IOrganize _organize = new Organize();
|
||||
private readonly IUserManager _userManager = App.GetService<IUserManager>();
|
||||
private readonly IRepository<SysRoleDataScope> _sysRoleDataScopeRep= App.GetService<IRepository<SysRoleDataScope>>();
|
||||
|
||||
/// <summary>
|
||||
/// 根据一组ID字符串得到人员的姓名
|
||||
/// </summary>
|
||||
/// <param name="id">逗号分开的ID</param>
|
||||
/// <returns></returns>
|
||||
public string GetNames(string ids)
|
||||
{
|
||||
if (ids.IsNullOrEmpty())
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
List<string> userids = new List<string>();
|
||||
foreach (string id in ids.Split(','))
|
||||
{
|
||||
string userId = id;
|
||||
if (id.StartsWith(IOrganize.PREFIX_USER))
|
||||
{
|
||||
userId = id.RemoveUserPrefix();
|
||||
}
|
||||
if (!userId.IsGuid())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
userids.Add(userId);
|
||||
}
|
||||
List<SysUser> users = _sysUserRep.DetachedEntities.Where(x => userids.Contains(x.Id)).ToList();
|
||||
foreach (SysUser u in users)
|
||||
{
|
||||
stringBuilder.Append(u.Name);
|
||||
stringBuilder.Append("、");
|
||||
}
|
||||
return stringBuilder.ToString().TrimEnd('、');
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 判断一个人员ID是否在一个组织机构字符串中
|
||||
/// </summary>
|
||||
/// <param name="organizeIds"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public bool Contains(string organizeIds, string userId)
|
||||
{
|
||||
string[] orgids = organizeIds.Split(',');
|
||||
for (int a = 0; a < orgids.Length; a++)
|
||||
{
|
||||
string curent = orgids[a];
|
||||
if (curent.StartsWith(IOrganize.PREFIX_USER) && curent.RemoveUserPrefix() == userId)
|
||||
return true;
|
||||
if (curent.StartsWith(IOrganize.PREFIX_RELATION) && curent.RemoveUserRelationPrefix() == userId)
|
||||
return true;
|
||||
if (curent.StartsWith(IOrganize.PREFIX_WORKGROUP))
|
||||
orgids[a] = curent.RemoveWorkGroupPrefix();
|
||||
}
|
||||
bool emp =_sysEmpRep.Count(x => x.Id == userId && orgids.Contains(x.OrgId))>0;
|
||||
bool extEmp=_sysEmpExtOrgPosRep.Count(x => x.SysEmpId == userId && orgids.Contains(x.SysOrgId)) > 0;
|
||||
return emp | extEmp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断一个人员是否在一个组织架构字符串里
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="memberIds"></param>
|
||||
/// <returns></returns>
|
||||
public bool IsIn(string userId, string memberIds)
|
||||
{
|
||||
if (!userId.IsGuid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (userId.StartsWith(IOrganize.PREFIX_USER))
|
||||
{
|
||||
userId = userId.RemoveUserPrefix();
|
||||
}
|
||||
else if (userId.StartsWith(IOrganize.PREFIX_RELATION))
|
||||
{
|
||||
userId = userId.RemoveUserRelationPrefix ();
|
||||
}
|
||||
|
||||
var users = _organize.GetAllUsers(memberIds);
|
||||
return users.Exists(p => p.Id == userId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到人员的签章图片路径(VUE版本)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetSignSrcVue(string userId = "", string userName = "")
|
||||
{
|
||||
string rootPath = Tools.GetContentRootPath() + "/wwwroot";
|
||||
string signPath = "/roadflow-files/user-signs/" + (userId.IsNullOrWhiteSpace() ? _userManager.UserId.ToLower() : userId.ToLower()) + "/default.png";
|
||||
if (File.Exists(rootPath + signPath))
|
||||
{
|
||||
return signPath;
|
||||
}
|
||||
else
|
||||
{
|
||||
string dirName = Path.GetDirectoryName(rootPath + signPath);
|
||||
if (!Directory.Exists(dirName))
|
||||
{
|
||||
Directory.CreateDirectory(dirName);
|
||||
}
|
||||
var img = CreateSignImage(userName.IsNullOrWhiteSpace() ? _userManager.Name : userName);
|
||||
img.Save(rootPath + signPath, System.Drawing.Imaging.ImageFormat.Png);
|
||||
return signPath;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重置签章图片
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="userName"></param>
|
||||
/// <returns></returns>
|
||||
public string ResetSignSrcVue(string userId = "", string userName = "")
|
||||
{
|
||||
string rootPath = Tools.GetContentRootPath() + "/wwwroot";
|
||||
string signPath = "/roadflow-files/user-signs/" + (userId.IsNullOrWhiteSpace() ? _userManager.UserId.ToLower(): userId.ToLower()) + "/default.png";
|
||||
string dirName = Path.GetDirectoryName(rootPath + signPath);
|
||||
if (!Directory.Exists(dirName))
|
||||
{
|
||||
Directory.CreateDirectory(dirName);
|
||||
}
|
||||
var img = CreateSignImage(userName.IsNullOrWhiteSpace() ? _userManager.Name : userName);
|
||||
img.Save(rootPath + signPath, System.Drawing.Imaging.ImageFormat.Png);
|
||||
return signPath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成签章图片
|
||||
/// </summary>
|
||||
/// <param name="UserName"></param>
|
||||
/// <returns></returns>
|
||||
public Bitmap CreateSignImage(string UserName)
|
||||
{
|
||||
if (UserName.IsNullOrEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
Random rand = new Random(UserName.GetHashCode());
|
||||
Size ImageSize = Size.Empty;
|
||||
Font myFont;
|
||||
try
|
||||
{
|
||||
myFont = new Font("LiSu", 16);
|
||||
}
|
||||
catch
|
||||
{
|
||||
myFont = new Font(new FontFamily(System.Drawing.Text.GenericFontFamilies.Monospace), 16);
|
||||
}
|
||||
// 计算图片大小
|
||||
using (Bitmap bmp1 = new Bitmap(5, 5))
|
||||
{
|
||||
using (Graphics g = Graphics.FromImage(bmp1))
|
||||
{
|
||||
SizeF size = g.MeasureString(UserName, myFont, 10000);
|
||||
ImageSize.Width = (int)size.Width + 4;
|
||||
ImageSize.Height = (int)size.Height;
|
||||
}
|
||||
}
|
||||
// 创建图片
|
||||
Bitmap bmp = new Bitmap(ImageSize.Width, ImageSize.Height);
|
||||
// 绘制文本
|
||||
using (Graphics g = Graphics.FromImage(bmp))
|
||||
{
|
||||
g.Clear(Color.White);
|
||||
using (StringFormat f = new StringFormat())
|
||||
{
|
||||
f.Alignment = StringAlignment.Center;
|
||||
f.LineAlignment = StringAlignment.Center;
|
||||
f.FormatFlags = StringFormatFlags.NoWrap;
|
||||
g.DrawString(
|
||||
UserName,
|
||||
myFont,
|
||||
Brushes.Red,
|
||||
new RectangleF(
|
||||
0,
|
||||
2,
|
||||
ImageSize.Width,
|
||||
ImageSize.Height),
|
||||
f);
|
||||
}
|
||||
}
|
||||
|
||||
// 随机制造噪点 (用户名绑定)
|
||||
Color c = Color.Red;
|
||||
int x, y;
|
||||
int num = ImageSize.Width * ImageSize.Height * 8 / 100;
|
||||
for (int iCount = 0; iCount < num; iCount++)
|
||||
{
|
||||
x = rand.Next(0, 4);
|
||||
y = rand.Next(ImageSize.Height);
|
||||
bmp.SetPixel(x, y, c);
|
||||
|
||||
x = rand.Next(ImageSize.Width - 4, ImageSize.Width);
|
||||
y = rand.Next(ImageSize.Height);
|
||||
bmp.SetPixel(x, y, c);
|
||||
|
||||
}
|
||||
|
||||
int num1 = ImageSize.Width * ImageSize.Height * 20 / 100;
|
||||
for (int iCount = 0; iCount < num1; iCount++)
|
||||
{
|
||||
x = rand.Next(ImageSize.Width);
|
||||
y = rand.Next(0, 4);
|
||||
bmp.SetPixel(x, y, c);
|
||||
|
||||
x = rand.Next(ImageSize.Width);
|
||||
y = rand.Next(ImageSize.Height - 4, ImageSize.Height);
|
||||
bmp.SetPixel(x, y, c);
|
||||
}
|
||||
|
||||
int num2 = ImageSize.Width * ImageSize.Height / 150;
|
||||
for (int iCount = 0; iCount < num2; iCount++)
|
||||
{
|
||||
x = rand.Next(ImageSize.Width);
|
||||
y = rand.Next(ImageSize.Height);
|
||||
bmp.SetPixel(x, y, c);
|
||||
}
|
||||
myFont.Dispose();
|
||||
return bmp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取用户部门
|
||||
/// </summary>
|
||||
/// <param name="uid"></param>
|
||||
/// <returns></returns>
|
||||
public SysOrg GetDept(string uid)
|
||||
{
|
||||
string oid = _sysEmpRep.DetachedEntities.FirstOrDefault(x => x.Id == uid).OrgId;
|
||||
return _sysOrgRep.DetachedEntities.FirstOrDefault(x => x.Id == oid);
|
||||
|
||||
}
|
||||
|
||||
public SysPos GetStation(string uid)
|
||||
{
|
||||
return _sysEmpRep.DetachedEntities.FirstOrDefault(x => x.Id == uid).SysEmpPos[0].SysPos;
|
||||
}
|
||||
|
||||
public string GetWorkGroupsId(string userId)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
public string GetWorkGroupsName(string userId)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
public static string LEADER_CODE="";
|
||||
|
||||
public string GetLeader(string userId)
|
||||
{
|
||||
string orgid =_sysEmpRep.DetachedEntities.FirstOrDefault(x => x.Id == userId).OrgId;
|
||||
var emps =_sysEmpRep.DetachedEntities.Where(x => x.OrgId == orgid).ToList();
|
||||
HashSet<string> userIds = new HashSet<string>();
|
||||
foreach (var e in emps)
|
||||
userIds.Add(e.Id);
|
||||
var leaders =_sysRoleRep.DetachedEntities.Where(x => x.Code == LEADER_CODE).ToList();
|
||||
foreach (var l in leaders)
|
||||
{
|
||||
foreach (var u in l.SysUsers)
|
||||
{
|
||||
if (userIds.Contains(u.Id))
|
||||
return u.Id;
|
||||
}
|
||||
|
||||
}
|
||||
return string.Empty;
|
||||
|
||||
}
|
||||
public SysOrg GetUnit(string userId)
|
||||
{
|
||||
string orgid =_sysEmpRep.DetachedEntities.FirstOrDefault(x => x.Id == userId).OrgId;
|
||||
return _sysOrgRep.DetachedEntities.FirstOrDefault(x => x.Id == orgid);
|
||||
}
|
||||
|
||||
public string GetName(string userId)
|
||||
{
|
||||
return _sysUserRep.DetachedEntities.FirstOrDefault(x => x.Id == userId)?.Name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个人员所在部门的工作角色
|
||||
/// </summary>
|
||||
/// <param name="id">人员id</param>
|
||||
/// <returns></returns>
|
||||
public JArray GetWorkRole(string userId)
|
||||
{
|
||||
SysUser usr =_sysUserRep.DetachedEntities.FirstOrDefault(x => x.Id == userId);
|
||||
return JArray.FromObject(usr.SysRoles);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一批人员的部门领导和分管领导
|
||||
/// </summary>
|
||||
/// <param name="userIds"></param>
|
||||
/// <returns></returns>
|
||||
public (string leader, string chargeLeader) GetLeader(List<string> userIds)
|
||||
{
|
||||
StringBuilder leaderBuilder = new StringBuilder();
|
||||
StringBuilder chargeLeaderBuilder = new StringBuilder();
|
||||
foreach (string userId in userIds)
|
||||
{
|
||||
string leader = GetLeader(userId);
|
||||
string chargeLeader = leader;
|
||||
leaderBuilder.Append(leader);
|
||||
leaderBuilder.Append(",");
|
||||
chargeLeaderBuilder.Append(chargeLeader);
|
||||
chargeLeaderBuilder.Append(",");
|
||||
}
|
||||
return (leaderBuilder.ToString().TrimEnd(','), chargeLeaderBuilder.ToString().TrimEnd(','));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个人员的上级部门领导
|
||||
/// </summary>
|
||||
/// <param name="userId">guid(人ID),u_guid(人ID),r_guid(关系表ID)</param>
|
||||
/// <returns></returns>
|
||||
public (string leader, string chargeLeader) GetParentLeader(string userId)
|
||||
{
|
||||
var emp = _sysEmpRep.DetachedEntities.FirstOrDefault(x => x.Id == userId);
|
||||
var org = _sysOrgRep.DetachedEntities.FirstOrDefault(x => x.Id == emp.OrgId);
|
||||
var parent = _sysOrgRep.DetachedEntities.FirstOrDefault(x => x.Id == org.Pid);
|
||||
|
||||
var emps = _sysEmpRep.DetachedEntities.Where(x => x.OrgId == parent.Id).ToList();
|
||||
HashSet<string> userIds = new HashSet<string>();
|
||||
foreach (var e in emps)
|
||||
userIds.Add(e.Id);
|
||||
var leaders = _sysRoleRep.DetachedEntities.Where(x => x.Code == LEADER_CODE).ToList();
|
||||
foreach (var l in leaders)
|
||||
{
|
||||
foreach (var u in l.SysUsers)
|
||||
{
|
||||
if (userIds.Contains(u.Id))
|
||||
return (u.Id,u.Id);
|
||||
}
|
||||
|
||||
}
|
||||
return (string.Empty, string.Empty);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得到一批人员的上级部门领导
|
||||
/// </summary>
|
||||
/// <param name="userId">guid(人ID),u_guid(人ID),r_guid(关系表ID)</param>
|
||||
/// <returns></returns>
|
||||
public (string leader, string chargeLeader) GetParentLeader(List<string> userIds)
|
||||
{
|
||||
StringBuilder leaderBuilder = new StringBuilder();
|
||||
StringBuilder chargeLeaderBuilder = new StringBuilder();
|
||||
foreach (string userId in userIds)
|
||||
{
|
||||
(string leader, string chargeLeader) = GetParentLeader(userId);
|
||||
leaderBuilder.Append(leader);
|
||||
leaderBuilder.Append(",");
|
||||
chargeLeaderBuilder.Append(chargeLeader);
|
||||
chargeLeaderBuilder.Append(",");
|
||||
}
|
||||
return (leaderBuilder.ToString().TrimEnd(','), chargeLeaderBuilder.ToString().TrimEnd(','));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个人员的所有上级部门领导
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public (string leader, string chargeLeader) GetAllParentLeader(string userId)
|
||||
{
|
||||
|
||||
var emp = _sysEmpRep.DetachedEntities.FirstOrDefault(x => x.Id == userId);
|
||||
var org = _sysOrgRep.DetachedEntities.FirstOrDefault(x => x.Id == emp.OrgId);
|
||||
List<string> orgIds = new List<string>();
|
||||
foreach (string str in org.Pids.Split("],",StringSplitOptions.RemoveEmptyEntries))
|
||||
{
|
||||
orgIds.Add(str.TrimStart('['));
|
||||
}
|
||||
List<SysEmp> emps =_sysEmpRep.DetachedEntities.Where(x => orgIds.Contains(x.OrgId)).ToList();
|
||||
HashSet<string> uids = new HashSet<string>();
|
||||
foreach (SysEmp em in emps)
|
||||
uids.Add(em.Id);
|
||||
|
||||
var leaders = _sysRoleRep.DetachedEntities.Where(x => x.Code == LEADER_CODE).ToList();
|
||||
|
||||
StringBuilder leader = new StringBuilder();
|
||||
foreach (var l in leaders)
|
||||
{
|
||||
foreach (var u in l.SysUsers)
|
||||
{
|
||||
if (uids.Contains(u.Id))
|
||||
leader.Append(u.Id).Append(",");
|
||||
}
|
||||
}
|
||||
string rtn = leader.ToString().TrimEnd(',');
|
||||
return (rtn,rtn);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 得到一批人员的所有上级部门领导
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public (string leader, string chargeLeader) GetAllParentLeader(List<string> userIds)
|
||||
{
|
||||
var empss = _sysEmpRep.DetachedEntities.Where(x => userIds.Contains(x.Id) ).ToList();
|
||||
HashSet<string> orgset = new HashSet<string>();
|
||||
foreach (var em in empss)
|
||||
{
|
||||
orgset.Add(em.OrgId);
|
||||
}
|
||||
var orgs =_sysOrgRep.DetachedEntities.Where(x => orgset.Contains(x.Id));
|
||||
HashSet<string> orgIds = new HashSet<string>();
|
||||
foreach (var org in orgs)
|
||||
{
|
||||
foreach (string str in org.Pids.Split("],", StringSplitOptions.RemoveEmptyEntries))
|
||||
{
|
||||
orgIds.Add(str.TrimStart('['));
|
||||
}
|
||||
}
|
||||
List<SysEmp> emps = _sysEmpRep.DetachedEntities.Where(x => orgIds.Contains(x.OrgId)).ToList();
|
||||
HashSet<string> uids = new HashSet<string>();
|
||||
foreach (SysEmp em in emps)
|
||||
uids.Add(em.Id);
|
||||
|
||||
var leaders = _sysRoleRep.DetachedEntities.Where(x => x.Code == LEADER_CODE).ToList();
|
||||
|
||||
StringBuilder leader = new StringBuilder();
|
||||
foreach (var l in leaders)
|
||||
{
|
||||
foreach (var u in l.SysUsers)
|
||||
{
|
||||
if (uids.Contains(u.Id))
|
||||
leader.Append(u.Id).Append(",");
|
||||
}
|
||||
}
|
||||
string rtn = leader.ToString().TrimEnd(',');
|
||||
return (rtn, rtn);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 得到人员ID字符串
|
||||
/// </summary>
|
||||
/// <param name="users"></param>
|
||||
/// <returns>u_人员ID1,u_人员ID2</returns>
|
||||
public string GetUserIds(List<User> users)
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
foreach (var user in users)
|
||||
{
|
||||
stringBuilder.Append(IOrganize.PREFIX_USER);
|
||||
stringBuilder.Append(user.Id);
|
||||
stringBuilder.Append(",");
|
||||
}
|
||||
return stringBuilder.ToString().TrimEnd(',');
|
||||
}
|
||||
public string GetUserIds(List<SysUser> users)
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
foreach (var user in users)
|
||||
{
|
||||
stringBuilder.Append(IOrganize.PREFIX_USER);
|
||||
stringBuilder.Append(user.Id);
|
||||
stringBuilder.Append(",");
|
||||
}
|
||||
return stringBuilder.ToString().TrimEnd(',');
|
||||
}
|
||||
|
||||
public string GetUserIds(List<SysEmp> users)
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
foreach (var user in users)
|
||||
{
|
||||
stringBuilder.Append(IOrganize.PREFIX_USER);
|
||||
stringBuilder.Append(user.Id);
|
||||
stringBuilder.Append(",");
|
||||
}
|
||||
return stringBuilder.ToString().TrimEnd(',');
|
||||
}
|
||||
/// <summary>
|
||||
/// 得到一个人员所在部门所有人员
|
||||
/// </summary>
|
||||
/// <param name="userId">guid(人ID),u_guid(人ID),r_guid(关系表ID)</param>
|
||||
/// <returns></returns>
|
||||
public List<SysEmp> GetOrganizeUsers(string userId)
|
||||
{
|
||||
string id = userId.StartsWith(IOrganize.PREFIX_RELATION) ? userId.RemoveUserRelationPrefix() : userId.StartsWith(IOrganize.PREFIX_USER) ? userId.RemoveUserPrefix() : userId;
|
||||
string oid =_sysEmpRep.DetachedEntities.FirstOrDefault(x => x.Id == id).OrgId;
|
||||
return _sysEmpRep.DetachedEntities.Where(x => x.OrgId == oid).ToList();
|
||||
/*Guid organzieId = GetOrganizeId(userId);
|
||||
return new Organize(systemCode).GetAllUsers(organzieId);*/
|
||||
}
|
||||
private HashSet<SysUser> tmpUserCache;
|
||||
public SysUser GetFromTempCache(string userId)
|
||||
{
|
||||
if (tmpUserCache == null)
|
||||
tmpUserCache = _sysUserRep.DetachedEntities.ToHashSet();
|
||||
return tmpUserCache.FirstOrDefault(x => x.Id == userId);
|
||||
}
|
||||
|
||||
public SysUser Get(string id)
|
||||
{
|
||||
return _sysUserRep.DetachedEntities.FirstOrDefault(x=>x.Id ==id);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得到用户加密后的密码
|
||||
/// </summary>
|
||||
/// <param name="userId">用户ID</param>
|
||||
/// <param name="password">密码</param>
|
||||
/// <returns></returns>
|
||||
public string GetMD5Password(string userId, string password)
|
||||
{
|
||||
return (userId.ToString().ToUpper() + password).MD5();
|
||||
}
|
||||
}
|
||||
}
|
||||
541
back_end_code/Ewide.RoadFlow/Data/Wildcard.cs
Normal file
541
back_end_code/Ewide.RoadFlow/Data/Wildcard.cs
Normal file
@@ -0,0 +1,541 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Ewide.Core;
|
||||
using RoadFlow.Data;
|
||||
using RoadFlow.Utility;
|
||||
|
||||
namespace RoadFlow.Business
|
||||
{
|
||||
/// <summary>
|
||||
/// 通配符类
|
||||
/// </summary>
|
||||
public class Wildcard
|
||||
{
|
||||
|
||||
|
||||
private static readonly string[] wildcardList = new string[] {
|
||||
"{<UserId>}",
|
||||
"{<UserName>}",
|
||||
"{<UserAccount>}",
|
||||
"{<UserDeptId>}",
|
||||
"{<UserDeptName>}",
|
||||
"{<UserStationId>}",
|
||||
"{<UserStationName>}",
|
||||
"{<UserWorkGroupId>}",
|
||||
"{<UserWorkGroupName>}",
|
||||
"{<UserDeptLeaderId>}",
|
||||
"{<UserDeptLeaderName>}",
|
||||
"{<UserCharegLeaderId>}",
|
||||
"{<UserCharegLeaderName>}",
|
||||
"{<UserUnitId>}",
|
||||
"{<UserUnitName>}",
|
||||
"{<InitiatorId>}",
|
||||
"{<InitiatorName>}",
|
||||
"{<InitiatorDeptId>}",
|
||||
"{<InitiatorDeptName>}",
|
||||
"{<InitiatorStationId>}",
|
||||
"{<InitiatorStationName>}",
|
||||
"{<InitiatorRoleId>}",
|
||||
"{<InitiatorRoleName>}",
|
||||
"{<InitiatorUnitId>}",
|
||||
"{<InitiatorUnitName>}",
|
||||
"{<InitiatorLeaderId>}",
|
||||
"{<InitiatorLeaderName>}",
|
||||
"{<InitiatorCharegId>}",
|
||||
"{<InitiatorCharegName>}",
|
||||
"{<ShortDate>}",
|
||||
"{<LongDate>}",
|
||||
"{<ShortDateTime>}",
|
||||
"{<LongDateTime>}",
|
||||
"{<ShortDateTimeSecond>}",
|
||||
"{<LongDateTimeSecond>}",
|
||||
"{<FlowId>}",
|
||||
"{<FlowName>}",
|
||||
"{<StepId>}",
|
||||
"{<StepName>}",
|
||||
"{<TaskId>}",
|
||||
"{<InstanceId>}",
|
||||
"{<GroupId>}",
|
||||
"{<PrevInstanceId>}",
|
||||
"{<PrevFlowTitle>}",
|
||||
"{<Guid>}",
|
||||
"{<EmptyGuid>}",
|
||||
|
||||
"{Query<",
|
||||
"{Form<",
|
||||
"{DataRow<",
|
||||
"{Date<",
|
||||
"{Method<",
|
||||
"{SQL<",
|
||||
"{JArray<",
|
||||
"{JObject<"
|
||||
};
|
||||
|
||||
public static string GetWildcardValue(string wildcard, SysUser userModel, object obj)
|
||||
{
|
||||
IUserManager userManager = Furion.App.GetService<IUserManager>();
|
||||
UserDummy user = new UserDummy();
|
||||
|
||||
var httpContext = Tools.HttpContext;
|
||||
Microsoft.AspNetCore.Http.HttpRequest request = httpContext?.Request;
|
||||
switch (wildcard.ToLower())
|
||||
{
|
||||
case "{<userid>}"://当前用户ID
|
||||
userModel = userModel ?? userManager.User;
|
||||
return userModel == null ? "" : userModel.Id.ToUpper();
|
||||
case "{<username>}"://当前用户姓名
|
||||
userModel = userModel ?? userManager.User;
|
||||
return userModel == null ? "" : userModel.Name;
|
||||
case "{<useraccount>}"://当前帐号
|
||||
userModel = userModel ?? userManager.User;
|
||||
return userModel == null ? "" : userModel.Account;
|
||||
case "{<userdeptid>}"://当前用户部门ID
|
||||
userModel = userModel ?? userManager.User;
|
||||
if (userModel == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
var dept = user.GetDept(userModel.Id);
|
||||
return dept == null ? "" : dept.Id.ToUpper();
|
||||
case "{<userdeptname>}"://当前用户部门名称
|
||||
userModel = userModel ?? userManager.User;
|
||||
if (userModel == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
var dept1 = user.GetDept(userModel.Id);
|
||||
return dept1 == null ? "" : dept1.Name;
|
||||
case "{<userstationid>}"://当前用户岗位ID
|
||||
userModel = userModel ?? userManager.User;
|
||||
if (userModel == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
var station = user.GetStation(userModel.Id);
|
||||
return station == null ? "" : station.Id.ToUpper();
|
||||
case "{<userstationname>}"://当前用户岗位名称
|
||||
userModel = userModel ?? userManager.User;
|
||||
if (userModel == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
var station1 = user.GetStation(userModel.Id);
|
||||
return station1 == null ? "" : station1.Name;
|
||||
case "{<userworkgroupid>}"://当前用户工作组ID
|
||||
userModel = userModel ?? userManager.User;
|
||||
return userModel == null ? "" : user.GetWorkGroupsId(userModel.Id);
|
||||
case "{<userworkgroupname>}"://当前用户工作组名称
|
||||
userModel = userModel ?? userManager.User;
|
||||
return userModel == null ? "" : user.GetWorkGroupsName(userModel.Id);
|
||||
case "{<userdeptleaderid>}"://当前用户部门领导ID
|
||||
userModel = userModel ?? userManager.User;
|
||||
return userModel == null ? "" : user.GetLeader(userModel.Id.ToString());
|
||||
case "{<userdeptleadername>}"://当前用户部门领导姓名
|
||||
userModel = userModel ?? userManager.User;
|
||||
return userModel == null ? "" : user.GetNames(user.GetLeader(userModel.Id));
|
||||
case "{<usercharegleaderid>}"://当前用户分管领导ID
|
||||
userModel = userModel ?? userManager.User;
|
||||
return userModel == null ? "" : user.GetLeader(userModel.Id);
|
||||
case "{<usercharegleadername>}"://当前用户分管领导姓名
|
||||
userModel = userModel ?? userManager.User;
|
||||
return userModel == null ? "" : user.GetNames(user.GetLeader(userModel.Id));
|
||||
case "{<userunitid>}"://当前用户单位ID
|
||||
userModel = userModel ?? userManager.User;
|
||||
if (userModel == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
var unit = user.GetUnit(userModel.Id);
|
||||
return unit == null ? "" : unit.Id.ToUpper();
|
||||
case "{<userunitname>}"://当前用户单位名称
|
||||
userModel = userModel ?? userManager.User;
|
||||
if (userModel == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
var unit1 = user.GetUnit(userModel.Id.ToString());
|
||||
return unit1 == null ? "" : unit1.Name;
|
||||
case "{<initiatorid>}"://发起者ID
|
||||
userModel = userModel ?? userManager.User;
|
||||
var firstId = new FlowTask().GetFirstSenderId(request.Querys("groupid"));
|
||||
return firstId.IsNullOrWhiteSpace() && userModel != null ? userModel.Id.ToString() : firstId.ToString();
|
||||
case "{<initiatorname>}"://发起者姓名
|
||||
userModel = userModel ?? userManager.User;
|
||||
var firstId1 = new FlowTask().GetFirstSenderId(request.Querys("groupid"));
|
||||
return firstId1.IsNullOrWhiteSpace() && userModel != null ? userModel.Name : user.GetName(firstId1);
|
||||
case "{<initiatordeptid>}"://发起者部门ID
|
||||
userModel = userModel ?? userManager.User;
|
||||
var firstId2 = new FlowTask().GetFirstSenderId(request.Querys("groupid"));
|
||||
if (firstId2.IsNullOrWhiteSpace() && null != userModel)
|
||||
{
|
||||
firstId2 = userModel.Id;
|
||||
}
|
||||
var dept2 = user.GetDept(firstId2.ToString());
|
||||
return null == dept2 ? "" : dept2.Id.ToString();
|
||||
case "{<initiatordeptname>}"://发起者部门名称
|
||||
userModel = userModel ?? userManager.User;
|
||||
var firstId3 = new FlowTask().GetFirstSenderId(request.Querys("groupid"));
|
||||
if (firstId3.IsNullOrWhiteSpace() && null != userModel)
|
||||
{
|
||||
firstId3 = userModel.Id;
|
||||
}
|
||||
var dept3 = user.GetDept(firstId3.ToString());
|
||||
return dept3 == null ? "" : dept3.Name;
|
||||
case "{<initiatorstationid>}"://发起者岗位ID
|
||||
userModel = userModel ?? userManager.User;
|
||||
var firstId4 = new FlowTask().GetFirstSenderId(request.Querys("groupid"));
|
||||
if (firstId4.IsNullOrWhiteSpace() && null != userModel)
|
||||
{
|
||||
firstId4 = userModel.Id;
|
||||
}
|
||||
var station4 = user.GetStation(firstId4.ToString());
|
||||
return station4 == null ? "" : station4.Id.ToString();
|
||||
case "{<initiatorstationname>}"://发起者岗位名称
|
||||
var firstId5 = new FlowTask().GetFirstSenderId(request.Querys("groupid"));
|
||||
userModel = userModel ?? userManager.User;
|
||||
if (firstId5.IsNullOrWhiteSpace() && null != userModel)
|
||||
{
|
||||
firstId5 = userModel.Id;
|
||||
}
|
||||
var station5 = user.GetStation(firstId5.ToString());
|
||||
return station5 == null ? "" : station5.Name;
|
||||
case "{<initiatorworkgroupid>}"://发起者角色组ID
|
||||
var firstId6 = new FlowTask().GetFirstSenderId(request.Querys("groupid"));
|
||||
userModel = userModel ?? userManager.User;
|
||||
if (firstId6.IsNullOrWhiteSpace() && null != userModel)
|
||||
{
|
||||
firstId6 = userModel.Id;
|
||||
}
|
||||
return user.GetWorkGroupsId(firstId6);
|
||||
case "{<initiatorworkgroupname>}"://发起者角色组名称
|
||||
var firstId7 = new FlowTask().GetFirstSenderId(request.Querys("groupid"));
|
||||
userModel = userModel ?? userManager.User;
|
||||
if (firstId7.IsNullOrWhiteSpace() && null != userModel)
|
||||
{
|
||||
firstId7 = userModel.Id;
|
||||
}
|
||||
return user.GetWorkGroupsName(firstId7);
|
||||
case "{<initiatorunitid>}"://发起者单位ID
|
||||
var firstId8 = new FlowTask().GetFirstSenderId(request.Querys("groupid"));
|
||||
userModel = userModel ?? userManager.User;
|
||||
if (firstId8.IsNullOrWhiteSpace() && null != userModel)
|
||||
{
|
||||
firstId8 = userModel.Id;
|
||||
}
|
||||
var unit8 = user.GetUnit(firstId8.ToString());
|
||||
return unit8 == null ? "" : unit8.Id.ToString();
|
||||
case "{<initiatorunitname>}"://发起者单位名称
|
||||
var firstId9 = new FlowTask().GetFirstSenderId(request.Querys("groupid"));
|
||||
userModel = userModel ?? userManager.User;
|
||||
if (firstId9.IsNullOrWhiteSpace() && null != userModel)
|
||||
{
|
||||
firstId9 = userModel.Id;
|
||||
}
|
||||
var unit9 = user.GetUnit(firstId9.ToString());
|
||||
return unit9 == null ? "" : unit9.Name;
|
||||
case "{<initiatorleaderid>}"://发起者部门领导ID
|
||||
var firstId10 = new FlowTask().GetFirstSenderId(request.Querys("groupid"));
|
||||
userModel = userModel ?? userManager.User;
|
||||
if (firstId10.IsNullOrWhiteSpace() && null != userModel)
|
||||
{
|
||||
firstId10 = userModel.Id;
|
||||
}
|
||||
return user.GetLeader(firstId10.ToString());
|
||||
case "{<initiatorleadername>}"://发起者部门领导姓名
|
||||
var firstId11 = new FlowTask().GetFirstSenderId(request.Querys("groupid"));
|
||||
userModel = userModel ?? userManager.User;
|
||||
if (firstId11.IsNullOrWhiteSpace() && null != userModel)
|
||||
{
|
||||
firstId11 = userModel.Id;
|
||||
}
|
||||
return user.GetNames(user.GetLeader(firstId11));
|
||||
case "{<initiatorcharegid>}"://发起者分管领导ID
|
||||
var firstId12 = new FlowTask().GetFirstSenderId(request.Querys("groupid"));
|
||||
userModel = userModel ?? userManager.User;
|
||||
if (firstId12.IsNullOrWhiteSpace() && null != userModel)
|
||||
{
|
||||
firstId12 = userModel.Id;
|
||||
}
|
||||
return user.GetLeader(firstId12.ToString());
|
||||
case "{<initiatorcharegname>}"://发起者分管领导姓名
|
||||
var firstId13 = new FlowTask().GetFirstSenderId(request.Querys("groupid"));
|
||||
userModel = userModel ?? userManager.User;
|
||||
if (firstId13.IsNullOrWhiteSpace() && null != userModel)
|
||||
{
|
||||
firstId13 = userModel.Id;
|
||||
}
|
||||
return user.GetNames(user.GetLeader(firstId13.ToString()));
|
||||
case "{<shortdate>}"://短日期格式(yyyy-MM-dd)
|
||||
return DateExtensions.Now.ToString("yyyy-MM-dd");
|
||||
case "{<longdate>}"://长日期格式(yyyy年MM月dd日)
|
||||
return DateExtensions.Now.ToString("yyyy年MM月dd日");
|
||||
case "{<shortdatetime>}"://短日期时间(yyyy-MM-dd HH:mm)
|
||||
return DateExtensions.Now.ToString("yyyy-MM-dd HH:mm");
|
||||
case "{<longdatetime>}"://长日期格式(yyyy年MM月dd日 HH时mm分)
|
||||
return DateExtensions.Now.ToString("yyyy年MM月dd日 HH时mm分");
|
||||
case "{<shortdatetimesecond>}"://短日期时间(yyyy-MM-dd HH:mm:ss)
|
||||
return DateExtensions.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
case "{<longdatetimesecond>}"://长日期格式(yyyy年MM月dd日 HH时mm分ss秒)
|
||||
return DateExtensions.Now.ToString("yyyy年MM月dd日 HH时mm分ss秒");
|
||||
case "{<flowid>}"://流程ID
|
||||
return request.Querys("flowid").IsNullOrWhiteSpace() ? GetValueFromObj(obj, "flowid") : request.Querys("flowid");
|
||||
case "{<flowname>}"://流程名称
|
||||
string flowId = request.Querys("flowid").IsNullOrWhiteSpace() ? GetValueFromObj(obj, "flowid") : request.Querys("flowid");
|
||||
return !flowId.IsGuid() ? "" : new Flow().GetOneById(flowId).Name;
|
||||
case "{<stepid>}"://流程步骤ID
|
||||
return request.Querys("stepid").IsNullOrWhiteSpace() ? GetValueFromObj(obj, "stepid") : request.Querys("stepid");
|
||||
case "{<stepname>}"://流程步骤名称
|
||||
string flowId1 = request.Querys("flowid").IsNullOrWhiteSpace() ? GetValueFromObj(obj, "flowid") : request.Querys("flowid");
|
||||
string stepId = request.Querys("stepid").IsNullOrWhiteSpace() ? GetValueFromObj(obj, "stepid") : request.Querys("stepid");
|
||||
return flowId1.IsGuid() ? new Flow().GetStepName(flowId1, stepId.ToGuid()) : string.Empty;
|
||||
case "{<taskid>}"://任务ID
|
||||
return request.Querys("taskid").IsNullOrWhiteSpace() ? GetValueFromObj(obj, "taskid") : request.Querys("taskid");
|
||||
case "{<instanceid>}"://实例ID
|
||||
string instanceId = request.Querys("instanceid");
|
||||
if (instanceId.IsNullOrWhiteSpace())
|
||||
{
|
||||
instanceId = GetValueFromObj(obj, "instanceid");
|
||||
}
|
||||
if (instanceId.IsNullOrWhiteSpace())
|
||||
{
|
||||
instanceId = request.Forms("form_instanceid");
|
||||
}
|
||||
if (instanceId.IsNullOrWhiteSpace())
|
||||
{
|
||||
instanceId = request.Querys("instanceid1");
|
||||
}
|
||||
return instanceId;
|
||||
case "{<groupid>}"://组ID
|
||||
return request.Querys("groupid").IsNullOrWhiteSpace() ? GetValueFromObj(obj, "groupid") : request.Querys("groupid");
|
||||
case "{<previnstanceid>}"://前一步实例ID
|
||||
return new FlowTask().GetPrevInstanceID(request.Querys("taskid").IsNullOrWhiteSpace() ? GetValueFromObj(obj, "taskid") : request.Querys("taskid"));
|
||||
case "{<prevflowtitle>}"://前一步流程任务标题
|
||||
return new FlowTask().GetPrevTitle(request.Querys("taskid").IsNullOrWhiteSpace() ? GetValueFromObj(obj, "taskid") : request.Querys("taskid"));
|
||||
case "{<guid>}"://随机生成UUID
|
||||
return GuidExtensions.NewGuid().ToString();
|
||||
case "{<emptyguid>}"://空UUID
|
||||
return Guid.Empty.ToString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从对象中获取值
|
||||
/// </summary>
|
||||
/// <param name="obj"></param>
|
||||
/// <param name="idName"></param>
|
||||
/// <returns></returns>
|
||||
private static string GetValueFromObj(object obj, string idName)
|
||||
{
|
||||
if (obj == null || idName.IsNullOrWhiteSpace())
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
if (obj is Model.FlowRunModel.Execute executeModel)
|
||||
{
|
||||
switch (idName.ToLower())
|
||||
{
|
||||
case "flowid":
|
||||
return executeModel.FlowId.ToString();
|
||||
case "stepid":
|
||||
return executeModel.StepId.ToString();
|
||||
case "taskid":
|
||||
return executeModel.TaskId.ToString();
|
||||
case "instanceid":
|
||||
return executeModel.InstanceId.ToString();
|
||||
case "groupid":
|
||||
return executeModel.GroupId.ToString();
|
||||
}
|
||||
}
|
||||
else if (obj is Model.rf_flowtask taskModel)
|
||||
{
|
||||
switch (idName.ToLower())
|
||||
{
|
||||
case "flowid":
|
||||
return taskModel.FlowId.ToString();
|
||||
case "stepid":
|
||||
return taskModel.StepId.ToString();
|
||||
case "taskid":
|
||||
return taskModel.Id.ToString();
|
||||
case "instanceid":
|
||||
return taskModel.InstanceId.ToString();
|
||||
case "groupid":
|
||||
return taskModel.GroupId.ToString();
|
||||
}
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 过滤通配符
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <param name="currentUser">当前登录用户实体</param>
|
||||
/// <param name="obj">对象</param>
|
||||
/// <returns></returns>
|
||||
public static string Filter(string str, SysUser user = null, object obj = null)
|
||||
{
|
||||
if (str.IsNullOrWhiteSpace())
|
||||
{
|
||||
return "";
|
||||
}
|
||||
var httpContent = Tools.HttpContext;
|
||||
Microsoft.AspNetCore.Http.HttpRequest request = httpContent?.Request;
|
||||
foreach (string wildcard in wildcardList)
|
||||
{
|
||||
while (str.ContainsIgnoreCase(wildcard))
|
||||
{
|
||||
string value = string.Empty;
|
||||
string wildcard1 = wildcard;
|
||||
if ("{Query<".EqualsIgnoreCase(wildcard))
|
||||
{
|
||||
string key = str.Substring(str.IndexOf("{Query<") + 7);
|
||||
string key1 = key.Substring(0, key.IndexOf(">}"));
|
||||
if (!key1.IsNullOrWhiteSpace())
|
||||
{
|
||||
wildcard1 = wildcard + key1 + ">}";
|
||||
value = request.Querys(key1).FilterSelectSql();//2021-3-8增加了.FilterSelectSql(),过滤危险SQL。
|
||||
}
|
||||
}
|
||||
else if ("{Form<".EqualsIgnoreCase(wildcard))
|
||||
{
|
||||
string key = str.Substring(str.IndexOf("{Form<") + 6);
|
||||
string key1 = key.Substring(0, key.IndexOf(">}"));
|
||||
if (!key1.IsNullOrWhiteSpace())
|
||||
{
|
||||
wildcard1 = wildcard + key1 + ">}";
|
||||
value = request.Forms(key1).FilterSelectSql();//2021-3-8增加了.FilterSelectSql(),过滤危险SQL。
|
||||
}
|
||||
}
|
||||
else if ("{DataRow<".EqualsIgnoreCase(wildcard))
|
||||
{
|
||||
string key = str.Substring(str.IndexOf("{DataRow<") + 9);
|
||||
string key1 = key.Substring(0, key.IndexOf(">}"));
|
||||
if (!key1.IsNullOrWhiteSpace())
|
||||
{
|
||||
wildcard1 = wildcard + key1 + ">}";
|
||||
var dr = (System.Data.DataRow)obj;
|
||||
try
|
||||
{
|
||||
value = dr[key1].ToString().FilterSelectSql();//2021-3-8增加了.FilterSelectSql(),过滤危险SQL。
|
||||
}
|
||||
catch
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ("{Method<".EqualsIgnoreCase(wildcard))
|
||||
{
|
||||
//执行一个方法替换通配符 object为方法参数
|
||||
string key = str.Substring(str.IndexOf("{Method<") + 8);
|
||||
string key1 = key.Substring(0, key.IndexOf(">}"));
|
||||
if (!key1.IsNullOrWhiteSpace())
|
||||
{
|
||||
wildcard1 = wildcard + key1 + ">}";
|
||||
var (o, err) = obj == null ? Tools.ExecuteMethod(key1) : Tools.ExecuteMethod(key1, obj);
|
||||
value = null == o ? "" : o.ToString().FilterSelectSql();//2021-3-8增加了.FilterSelectSql(),过滤危险SQL。
|
||||
}
|
||||
}
|
||||
else if ("{SQL<".EqualsIgnoreCase(wildcard))
|
||||
{
|
||||
//执行一个SQL替换通配符
|
||||
string key = str.Substring(str.IndexOf("{SQL<") + 5);
|
||||
string key1 = key.Substring(0, key.IndexOf(">}"));
|
||||
if (!key1.IsNullOrWhiteSpace())
|
||||
{
|
||||
wildcard1 = wildcard + key1 + ">}";
|
||||
value = new DbConnection().GetFieldValue(key1).FilterSelectSql();//2021-3-8增加了.FilterSelectSql(),过滤危险SQL。
|
||||
}
|
||||
}
|
||||
else if ("{Date<".EqualsIgnoreCase(wildcard))
|
||||
{
|
||||
//取当前日期替换指定格式
|
||||
string key = str.Substring(str.IndexOf("{Date<") + 6);
|
||||
string key1 = key.Substring(0, key.IndexOf(">}"));
|
||||
if (!key1.IsNullOrWhiteSpace())
|
||||
{
|
||||
wildcard1 = wildcard + key1 + ">}";
|
||||
value = DateExtensions.Now.ToString(key1);
|
||||
}
|
||||
}
|
||||
else if ("{Object<".EqualsIgnoreCase(wildcard))
|
||||
{
|
||||
//将对象转换为字符串替换
|
||||
string key = str.Substring(str.IndexOf("{Object<") + 8);
|
||||
string key1 = key.Substring(0, key.IndexOf(">}"));
|
||||
if (!key1.IsNullOrWhiteSpace())
|
||||
{
|
||||
wildcard1 = wildcard + key1 + ">}";
|
||||
value = obj == null ? "" : obj.ToString();
|
||||
}
|
||||
}
|
||||
else if ("{JArray<".EqualsIgnoreCase(wildcard))
|
||||
{
|
||||
//取json数组值
|
||||
string key = str.Substring(str.IndexOf("{JArray<") + 8);
|
||||
string key1 = key.Substring(0, key.IndexOf(">}"));
|
||||
if (!key1.IsNullOrWhiteSpace())
|
||||
{
|
||||
wildcard1 = wildcard + key1 + ">}";
|
||||
Newtonsoft.Json.Linq.JArray jArray = (Newtonsoft.Json.Linq.JArray)obj;
|
||||
if (null != jArray)
|
||||
{
|
||||
foreach (Newtonsoft.Json.Linq.JObject jObject in jArray)
|
||||
{
|
||||
if (jObject.ContainsKey(key1))
|
||||
{
|
||||
value = jObject.Value<string>(key1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (value.IsNullOrEmpty())
|
||||
{
|
||||
//这里循环找是取表单数据形式的JSON [{"name":"","value":""}] 这里取表单字段对应的值
|
||||
foreach (Newtonsoft.Json.Linq.JObject jObject in jArray)
|
||||
{
|
||||
if (jObject.ContainsKey("name") && jObject.Value<string>("name").Equals(key1))
|
||||
{
|
||||
value = jObject.Value<string>("value");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ("{JObject<".EqualsIgnoreCase(wildcard))
|
||||
{
|
||||
//取json对象值
|
||||
string key = str.Substring(str.IndexOf("{JObject<") + 9);
|
||||
string key1 = key.Substring(0, key.IndexOf(">}"));
|
||||
if (!key1.IsNullOrWhiteSpace())
|
||||
{
|
||||
wildcard1 = wildcard + key1 + ">}";
|
||||
Newtonsoft.Json.Linq.JObject jObject = (Newtonsoft.Json.Linq.JObject)obj;
|
||||
if (null != jObject && jObject.ContainsKey(key1))
|
||||
{
|
||||
value = jObject.Value<string>(key1);
|
||||
}
|
||||
else
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
value = GetWildcardValue(wildcard, user, obj);
|
||||
}
|
||||
str = str.ReplaceIgnoreCase(wildcard1, value);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
back_end_code/Ewide.RoadFlow/Data/WorkDate/IWorkDate.cs
Normal file
13
back_end_code/Ewide.RoadFlow/Data/WorkDate/IWorkDate.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public interface IWorkDate : IRoadFlowRepository<RoadFlow.Model.rf_workdate>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
71
back_end_code/Ewide.RoadFlow/Data/WorkDate/WorkDate.cs
Normal file
71
back_end_code/Ewide.RoadFlow/Data/WorkDate/WorkDate.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using Furion.DependencyInjection;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using RoadFlow.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Data
|
||||
{
|
||||
public class WorkDate: RoadFlowRepository<RoadFlow.Model.rf_workdate>, IWorkDate, ITransient
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 得到一个时间加上几天之后的工作时间
|
||||
/// </summary>
|
||||
/// <param name="days">天数</param>
|
||||
/// <param name="dt">时间</param>
|
||||
/// <returns></returns>
|
||||
public DateTime GetWorkDateTime(double days, DateTime? dt = null)
|
||||
{
|
||||
DateTime dateTime = dt != null && dt.HasValue ? dt.Value : Utility.DateExtensions.Now;
|
||||
var yearList = GetYearList(dateTime.Year);
|
||||
int max = (int)Math.Floor(days);
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
if (yearList.Exists(p => p.WorkDay == dateTime.AddDays(i).Date && p.IsWork == 0))
|
||||
{
|
||||
max++;
|
||||
}
|
||||
}
|
||||
return dateTime.AddDays(max + (days - Math.Floor(days)));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 得到一年所有工作日
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<Model.rf_workdate> GetYearList(int year)
|
||||
{
|
||||
string cacheKey = CACHEKEY + "_" + year.ToString();
|
||||
object obj = _memoryCache.Get(cacheKey);
|
||||
if (null == obj)
|
||||
{
|
||||
List<Model.rf_workdate> workDates = db.Queryable<Model.rf_workdate>()
|
||||
.Where("YEAR(WorkDay)="+ year)
|
||||
.ToList();
|
||||
_memoryCache.Set(CACHEKEY, workDates);
|
||||
return workDates;
|
||||
/*
|
||||
using (var db = new DataContext())
|
||||
{
|
||||
string sql = db.IsOracle ? "SELECT * FROM RF_WorkDate WHERE TO_CHAR(WorkDay,'yyyy')=" + year :
|
||||
db.IsPostgreSql ? "select * from rf_workdate where extract(year from WorkDay)=" + year :
|
||||
"SELECT * FROM RF_WorkDate WHERE YEAR(WorkDay)=" + year;
|
||||
var workDates = db.Query<Model.WorkDate>(sql);
|
||||
_memoryCache.set(CACHEKEY, workDates);
|
||||
return workDates;
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
return (List<Model.rf_workdate>)obj;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
25
back_end_code/Ewide.RoadFlow/Entity/BaseEntity.cs
Normal file
25
back_end_code/Ewide.RoadFlow/Entity/BaseEntity.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 基础实体类
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public abstract partial class BaseEntity
|
||||
{
|
||||
[DataMember]
|
||||
[Column("Id")]
|
||||
[Display(Name = "Id")]
|
||||
[Key]
|
||||
[SqlSugar.SugarColumn(IsNullable =false,IsPrimaryKey =true)]
|
||||
public string Id { get; set; }
|
||||
}
|
||||
}
|
||||
54
back_end_code/Ewide.RoadFlow/Entity/Extend/TableField.cs
Normal file
54
back_end_code/Ewide.RoadFlow/Entity/Extend/TableField.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 表字段实体
|
||||
/// </summary>
|
||||
public class TableField
|
||||
{
|
||||
/// <summary>
|
||||
/// 字段名称
|
||||
/// </summary>
|
||||
public string FieldName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字段类型
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 长度
|
||||
/// </summary>
|
||||
public int Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否可为空
|
||||
/// </summary>
|
||||
public bool IsNull { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否有默认值
|
||||
/// </summary>
|
||||
public bool IsDefault { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否是自增
|
||||
/// </summary>
|
||||
public bool IsIdentity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 默认值
|
||||
/// </summary>
|
||||
public string DefaultValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字段说明
|
||||
/// </summary>
|
||||
public string Comment { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
public partial class rf_dbconnection
|
||||
{
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public SqlSugar.DbType DbType
|
||||
{
|
||||
get
|
||||
{
|
||||
SqlSugar.DbType dbType = SqlSugar.DbType.MySql;
|
||||
switch (this.ConnType.ToLower())
|
||||
{
|
||||
case "sqlserver":
|
||||
dbType = SqlSugar.DbType.SqlServer;
|
||||
break;
|
||||
case "mysql":
|
||||
dbType = SqlSugar.DbType.MySql;
|
||||
break;
|
||||
case "oracle":
|
||||
dbType = SqlSugar.DbType.Oracle;
|
||||
break;
|
||||
case "postgresql":
|
||||
dbType = SqlSugar.DbType.PostgreSQL;
|
||||
break;
|
||||
}
|
||||
return dbType;
|
||||
}
|
||||
}
|
||||
public SqlSugarProvider GetConn(SqlSugarClient db)
|
||||
{
|
||||
SqlSugarProvider conn = null;
|
||||
if(db.IsAnyConnection(this.Id))
|
||||
conn = db.GetConnection(this.Id);
|
||||
if (conn == null)
|
||||
{
|
||||
db.AddConnection(new ConnectionConfig
|
||||
{
|
||||
DbType = this.DbType,
|
||||
ConnectionString = this.ConnString,
|
||||
ConfigId = this.Id,
|
||||
IsAutoCloseConnection = true
|
||||
});
|
||||
conn = db.GetConnection(this.Id);
|
||||
}
|
||||
return conn;
|
||||
}
|
||||
}
|
||||
}
|
||||
100
back_end_code/Ewide.RoadFlow/Entity/Extend/rf_doc.cs
Normal file
100
back_end_code/Ewide.RoadFlow/Entity/Extend/rf_doc.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Model.Extend
|
||||
{
|
||||
public class rf_doc
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
/// <summary>
|
||||
/// 栏目Id
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "栏目Id")]
|
||||
[Column("DirId")]
|
||||
[DataMember]
|
||||
public string DirId { get; set; }
|
||||
/// <summary>
|
||||
/// 栏目名称
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "栏目名称")]
|
||||
[Column("DirName")]
|
||||
[DataMember]
|
||||
public string DirName { get; set; }
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "标题")]
|
||||
[Column("Title")]
|
||||
[DataMember]
|
||||
public string Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 添加时间
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "添加时间")]
|
||||
[Column("WriteTime")]
|
||||
[DataMember]
|
||||
public DateTime WriteTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 添加人员姓名
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "添加人员姓名")]
|
||||
[Column("WriteUserName")]
|
||||
[DataMember]
|
||||
public string WriteUserName { get; set; }
|
||||
/// <summary>
|
||||
/// 最后修改时间
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "最后修改时间")]
|
||||
[Column("EditTime")]
|
||||
[DataMember]
|
||||
public DateTime? EditTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改人姓名
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "修改人姓名")]
|
||||
[Column("EditUserName")]
|
||||
[DataMember]
|
||||
public string EditUserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 阅读次数
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "阅读次数")]
|
||||
[Column("ReadCount")]
|
||||
[DataMember]
|
||||
public int ReadCount { get; set; }
|
||||
/// <summary>
|
||||
/// 文档等级 0普通 1重要 2非常重要
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "文档等级 0普通 1重要 2非常重要")]
|
||||
[Column("DocRank")]
|
||||
[DataMember]
|
||||
public int DocRank { get; set; }
|
||||
/// <summary>
|
||||
/// 是否已读
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "是否已读")]
|
||||
[Column("IsRead")]
|
||||
[DataMember]
|
||||
public int IsRead { get; set; }
|
||||
}
|
||||
}
|
||||
29
back_end_code/Ewide.RoadFlow/Entity/Extend/rf_flowtask.cs
Normal file
29
back_end_code/Ewide.RoadFlow/Entity/Extend/rf_flowtask.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
public partial class rf_flowtask
|
||||
{
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string CurrentStepName { get; set; }
|
||||
|
||||
public rf_flowtask Clone()
|
||||
{
|
||||
return (rf_flowtask)this.MemberwiseClone();
|
||||
}
|
||||
}
|
||||
public partial class rf_flowtask_Group1
|
||||
{
|
||||
public string GroupId { get; set; }
|
||||
public DateTime ReceiveTime { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
34
back_end_code/Ewide.RoadFlow/Entity/FlowRunModel/Database.cs
Normal file
34
back_end_code/Ewide.RoadFlow/Entity/FlowRunModel/Database.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace RoadFlow.Model.FlowRunModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 流程数据连接实体
|
||||
/// </summary>
|
||||
public class Database
|
||||
{
|
||||
/// <summary>
|
||||
/// 连接ID
|
||||
/// </summary>
|
||||
public Guid ConnectionId { get; set; }
|
||||
/// <summary>
|
||||
/// 连接名称
|
||||
/// </summary>
|
||||
public string ConnectionName { get; set; }
|
||||
/// <summary>
|
||||
/// 表名
|
||||
/// </summary>
|
||||
public string Table { get; set; }
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string PrimaryKey { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace RoadFlow.Model.FlowRunModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 流程事件参数实体
|
||||
/// </summary>
|
||||
public class EventParam
|
||||
{
|
||||
/// <summary>
|
||||
/// 流程ID
|
||||
/// </summary>
|
||||
public Guid FlowId { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤ID
|
||||
/// </summary>
|
||||
public Guid StepId { get; set; }
|
||||
/// <summary>
|
||||
/// 任务ID
|
||||
/// </summary>
|
||||
public Guid TaskId { get; set; }
|
||||
/// <summary>
|
||||
/// 分组ID
|
||||
/// </summary>
|
||||
public Guid GroupId { get; set; }
|
||||
/// <summary>
|
||||
/// 业务表ID值
|
||||
/// </summary>
|
||||
public string InstanceId { get; set; }
|
||||
/// <summary>
|
||||
/// 任务标题
|
||||
/// </summary>
|
||||
public string TaskTitle { get; set; }
|
||||
/// <summary>
|
||||
/// 流程运行时实体
|
||||
/// </summary>
|
||||
public FlowRun FlowRunModel { get; set; }
|
||||
/// <summary>
|
||||
/// 其它参数
|
||||
/// </summary>
|
||||
public object Other { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
135
back_end_code/Ewide.RoadFlow/Entity/FlowRunModel/Execute.cs
Normal file
135
back_end_code/Ewide.RoadFlow/Entity/FlowRunModel/Execute.cs
Normal file
@@ -0,0 +1,135 @@
|
||||
using Ewide.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace RoadFlow.Model.FlowRunModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 流程执行参数实体
|
||||
/// </summary>
|
||||
public class Execute
|
||||
{
|
||||
public Execute()
|
||||
{
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 操作类型
|
||||
/// </summary>
|
||||
public enum Type
|
||||
{
|
||||
/// <summary>
|
||||
/// 提交
|
||||
/// </summary>
|
||||
Submit,
|
||||
/// <summary>
|
||||
/// 自由发送
|
||||
/// </summary>
|
||||
FreeSubmit,
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
Save,
|
||||
/// <summary>
|
||||
/// 退回
|
||||
/// </summary>
|
||||
Back,
|
||||
/// <summary>
|
||||
/// 完成
|
||||
/// </summary>
|
||||
Completed,
|
||||
/// <summary>
|
||||
/// 转交
|
||||
/// </summary>
|
||||
Redirect,
|
||||
/// <summary>
|
||||
/// 加签
|
||||
/// </summary>
|
||||
AddWrite,
|
||||
/// <summary>
|
||||
/// 抄送完成
|
||||
/// </summary>
|
||||
CopyforCompleted,
|
||||
/// <summary>
|
||||
/// 终止
|
||||
/// </summary>
|
||||
TaskEnd
|
||||
}
|
||||
/// <summary>
|
||||
/// 流程ID
|
||||
/// </summary>
|
||||
public Guid FlowId { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤ID
|
||||
/// </summary>
|
||||
public Guid StepId { get; set; }
|
||||
/// <summary>
|
||||
/// 任务ID
|
||||
/// </summary>
|
||||
public Guid TaskId { get; set; }
|
||||
/// <summary>
|
||||
/// 实例ID
|
||||
/// </summary>
|
||||
public string InstanceId { get; set; }
|
||||
/// <summary>
|
||||
/// 分组ID
|
||||
/// </summary>
|
||||
public Guid GroupId { get; set; }
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
public string Title { get; set; }
|
||||
/// <summary>
|
||||
/// 操作类型
|
||||
/// </summary>
|
||||
public Type ExecuteType { get; set; }
|
||||
/// <summary>
|
||||
/// 发送人员
|
||||
/// </summary>
|
||||
public SysUser Sender { get; set; }
|
||||
/// <summary>
|
||||
/// 接收的步骤和人员和要求完成时间
|
||||
/// <para>stepId:步骤ID</para>
|
||||
/// <para>stepName:步骤名称(如果为空根据步骤ID去流程实体中查询,主要是保存动态步骤中自定义的步骤名称)</para>
|
||||
/// <para>beforeStepId:原步骤ID(动态步骤的原步骤ID)</para>
|
||||
/// <para>parallelOrSerial:0并行 1串行</para>
|
||||
/// <para>receiveUsers:接收人</para>
|
||||
/// <para>completedTime:要求完成时间</para>
|
||||
/// </summary>
|
||||
public List<(Guid stepId, string stepName, Guid? beforeStepId, int? parallelOrSerial, List<SysUser> receiveUsers, DateTime? completedTime)> Steps { get; set; }
|
||||
/// <summary>
|
||||
/// 处理意见
|
||||
/// </summary>
|
||||
public string Comment { get; set; }
|
||||
/// <summary>
|
||||
/// 是否签章
|
||||
/// </summary>
|
||||
public int IsSign { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Note { get; set; }
|
||||
/// <summary>
|
||||
/// 其他类型
|
||||
/// </summary>
|
||||
public int OtherType { get; set; }
|
||||
/// <summary>
|
||||
/// 执行的参数json字符串
|
||||
/// </summary>
|
||||
public string ParamsJSON { get; set; }
|
||||
/// <summary>
|
||||
/// 是否是自动提交
|
||||
/// </summary>
|
||||
public bool IsAutoSubmit { get; set; }
|
||||
/// <summary>
|
||||
/// 附件
|
||||
/// </summary>
|
||||
public string Attachment { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace RoadFlow.Model.FlowRunModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 流程处理结果类
|
||||
/// </summary>
|
||||
public class ExecuteResult
|
||||
{
|
||||
public ExecuteResult()
|
||||
{
|
||||
NextTasks = new List<rf_flowtask>();
|
||||
AutoSubmitTasks = new List<rf_flowtask>();
|
||||
}
|
||||
/// <summary>
|
||||
/// 是否成功
|
||||
/// </summary>
|
||||
public bool IsSuccess { get; set; }
|
||||
/// <summary>
|
||||
/// 提示信息
|
||||
/// </summary>
|
||||
public string Messages { get; set; }
|
||||
/// <summary>
|
||||
/// 调试信息
|
||||
/// </summary>
|
||||
public string DebugMessages { get; set; }
|
||||
/// <summary>
|
||||
/// 其它信息
|
||||
/// </summary>
|
||||
public object Other { get; set; }
|
||||
/// <summary>
|
||||
/// 当前任务
|
||||
/// </summary>
|
||||
public Model.rf_flowtask CurrentTask { get; set; }
|
||||
/// <summary>
|
||||
/// 后续任务
|
||||
/// </summary>
|
||||
public List<rf_flowtask> NextTasks { get; set; }
|
||||
/// <summary>
|
||||
/// 完成后要自动提交的任务
|
||||
/// </summary>
|
||||
public List<rf_flowtask> AutoSubmitTasks { get; set; }
|
||||
/// <summary>
|
||||
/// 当前步骤是否通过
|
||||
/// </summary>
|
||||
public bool StepIsPass { get; set; } = false;
|
||||
/// <summary>
|
||||
/// 当前步骤是否已退回
|
||||
/// </summary>
|
||||
public bool StepIsBack { get; set; } = false;
|
||||
/// <summary>
|
||||
/// 当前流程是否完成
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool FlowIsCompleted { get; set; } = false;
|
||||
/// <summary>
|
||||
/// 当前流程是否被终止
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool FlowIsStop { get; set; } = false;
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
115
back_end_code/Ewide.RoadFlow/Entity/FlowRunModel/FlowRun.cs
Normal file
115
back_end_code/Ewide.RoadFlow/Entity/FlowRunModel/FlowRun.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 流程运行时实体
|
||||
/// </summary>
|
||||
public class FlowRun
|
||||
{
|
||||
/// <summary>
|
||||
/// 流程ID
|
||||
/// </summary>
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
/// <summary>
|
||||
/// 流程名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// 流程分类
|
||||
/// </summary>
|
||||
public Guid Type { get; set; }
|
||||
/// <summary>
|
||||
/// 流程管理人员
|
||||
/// </summary>
|
||||
public string Manager { get; set; }
|
||||
/// <summary>
|
||||
/// 流程实例管理人员
|
||||
/// </summary>
|
||||
public string InstanceManager { get; set; }
|
||||
/// <summary>
|
||||
/// 第一步ID
|
||||
/// </summary>
|
||||
public Guid FirstStepId { get; set; }
|
||||
/// <summary>
|
||||
/// 创建日期
|
||||
/// </summary>
|
||||
public DateTime CreateDate { get; set; }
|
||||
/// <summary>
|
||||
/// 创建人员
|
||||
/// </summary>
|
||||
public string CreateUserId { get; set; }
|
||||
/// <summary>
|
||||
/// 设计时JSON
|
||||
/// </summary>
|
||||
public string DesignerJSON { get; set; }
|
||||
/// <summary>
|
||||
/// 安装日期
|
||||
/// </summary>
|
||||
public DateTime? InstallDate { get; set; }
|
||||
/// <summary>
|
||||
/// 安装人员ID
|
||||
/// </summary>
|
||||
public string InstallUserId { get; set; }
|
||||
/// <summary>
|
||||
/// 运行时JSON
|
||||
/// </summary>
|
||||
public string RunJSON { get; set; }
|
||||
/// <summary>
|
||||
/// 流程图标(发起流程列表时用)
|
||||
/// </summary>
|
||||
public string Ico { get; set; }
|
||||
/// <summary>
|
||||
/// 图标颜色
|
||||
/// </summary>
|
||||
public string Color { get; set; }
|
||||
/// <summary>
|
||||
/// 状态 0:设计中 1:已安装 2:已卸载 3:已删除
|
||||
/// </summary>
|
||||
public int Status { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Note { get; set; }
|
||||
/// <summary>
|
||||
/// 所属系统Id
|
||||
/// </summary>
|
||||
public Guid? SystemId { get; set; }
|
||||
/// <summary>
|
||||
/// 调试模式 0关闭 1开启(有调试窗口) 2开启(无调试窗口)
|
||||
/// </summary>
|
||||
public int Debug { get; set; }
|
||||
/// <summary>
|
||||
/// 调试人员ID
|
||||
/// </summary>
|
||||
public string DebugUserIds { get; set; }
|
||||
/// <summary>
|
||||
/// 流程数据连接信息
|
||||
/// </summary>
|
||||
public List<FlowRunModel.Database> Databases { get; set; }
|
||||
/// <summary>
|
||||
/// 标识字段
|
||||
/// </summary>
|
||||
public FlowRunModel.TitleField TitleField { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤信息
|
||||
/// </summary>
|
||||
public List<FlowRunModel.Step> Steps { get; set; }
|
||||
/// <summary>
|
||||
/// 连线信息
|
||||
/// </summary>
|
||||
public List<FlowRunModel.Line> Lines { get; set; }
|
||||
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Furion.JsonSerialization.JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
46
back_end_code/Ewide.RoadFlow/Entity/FlowRunModel/Line.cs
Normal file
46
back_end_code/Ewide.RoadFlow/Entity/FlowRunModel/Line.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace RoadFlow.Model.FlowRunModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 流程连线实体
|
||||
/// </summary>
|
||||
public class Line
|
||||
{
|
||||
/// <summary>
|
||||
/// 连线ID
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
/// <summary>
|
||||
/// 来原步骤ID
|
||||
/// </summary>
|
||||
public Guid FromId { get; set; }
|
||||
/// <summary>
|
||||
/// 到步骤ID
|
||||
/// </summary>
|
||||
public Guid ToId { get; set; }
|
||||
/// <summary>
|
||||
/// 条件判断的方法
|
||||
/// </summary>
|
||||
public string CustomMethod { get; set; }
|
||||
/// <summary>
|
||||
/// 条件判断的SQL条件
|
||||
/// </summary>
|
||||
public string SqlWhere { get; set; }
|
||||
/// <summary>
|
||||
/// 条件判断的组织机构表达式
|
||||
/// </summary>
|
||||
public string OrganizeExpression { get; set; }
|
||||
/// <summary>
|
||||
/// 判断类型 0:OR 1:AND
|
||||
/// </summary>
|
||||
public int JudgeType { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
144
back_end_code/Ewide.RoadFlow/Entity/FlowRunModel/Step.cs
Normal file
144
back_end_code/Ewide.RoadFlow/Entity/FlowRunModel/Step.cs
Normal file
@@ -0,0 +1,144 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace RoadFlow.Model.FlowRunModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 步骤实体
|
||||
/// </summary>
|
||||
public class Step
|
||||
{
|
||||
/// <summary>
|
||||
/// 步骤ID
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤类型 0常规 1子流程
|
||||
/// </summary>
|
||||
public int Type { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// 是否是动态步骤
|
||||
/// <para>0:不是动态步骤(常规步骤) </para>
|
||||
/// <para>1:动态步骤 </para>
|
||||
/// <para>2:动态步骤从字段值中获取,字段值中存:机构ID1|默认处理人ID1,机构ID2|默认处理人ID2</para>
|
||||
/// <para>VUE版本字段值中存:步骤名称1|默认处理人ID1,步骤名称2|默认处理人ID2</para>
|
||||
/// <para>动态步骤是指步骤数量不固定,发送时可以自行添加。例如审批部门不确定的情况下,发送时自行添加要发送到几个部门审批。</para>
|
||||
/// </summary>
|
||||
public int Dynamic { get; set; }
|
||||
/// <summary>
|
||||
/// 动态步骤中设定的字段
|
||||
/// </summary>
|
||||
public string DynamicField { get; set; }
|
||||
/// <summary>
|
||||
/// 意见显示 0不显示 1显示
|
||||
/// </summary>
|
||||
public int CommentDisplay { get; set; }
|
||||
/// <summary>
|
||||
/// 签章意见时是否可传附件 0不可以 1可以
|
||||
/// </summary>
|
||||
public int Attachment { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤是否可以批量处理 0不可以 1可以
|
||||
/// </summary>
|
||||
public int BatchExecute { get; set; }
|
||||
/// <summary>
|
||||
/// 超期提醒0不提醒 1提前多少天提醒
|
||||
/// </summary>
|
||||
public int ExpiredPrompt { get; set; }
|
||||
/// <summary>
|
||||
/// 提前多少天提醒
|
||||
/// </summary>
|
||||
public decimal ExpiredPromptDays { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// 审签类型 0无签批意见栏 1有签批意见(无须签章) 2有签批意见(须签章)
|
||||
/// </summary>
|
||||
public int SignatureType { get; set; }
|
||||
/// <summary>
|
||||
/// 工时(天)
|
||||
/// </summary>
|
||||
public decimal WorkTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否归档 0不归档 1要归档
|
||||
/// </summary>
|
||||
public int Archives { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤说明
|
||||
/// </summary>
|
||||
public string Note { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤发送后提示语
|
||||
/// </summary>
|
||||
public string SendShowMessage { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤退回后提示语
|
||||
/// </summary>
|
||||
public string BackShowMessage { get; set; }
|
||||
/// <summary>
|
||||
/// X坐标
|
||||
/// </summary>
|
||||
public decimal Position_X { get; set; }
|
||||
/// <summary>
|
||||
/// Y坐标
|
||||
/// </summary>
|
||||
public decimal Position_Y { get; set; }
|
||||
/// <summary>
|
||||
/// 是否要在发送时指定接收人的完成时间
|
||||
/// </summary>
|
||||
public int SendSetWorkTime{ get; set; }
|
||||
/// <summary>
|
||||
/// 任务超时的处理方式 0不处理 1自动提交
|
||||
/// </summary>
|
||||
public int ExpiredExecuteModel { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤运行时获取的默认处理人员
|
||||
/// </summary>
|
||||
public string RunDefaultMembers { get; set; }
|
||||
/// <summary>
|
||||
/// 数据编辑模式 0共同编辑 1独立编辑
|
||||
/// </summary>
|
||||
public int DataEditModel { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// 步骤基本设置
|
||||
/// </summary>
|
||||
public StepBase StepBase { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤表单
|
||||
/// </summary>
|
||||
public StepForm StepForm { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤按钮
|
||||
/// </summary>
|
||||
public List<StepButton> StepButtons { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤字段状态
|
||||
/// </summary>
|
||||
public List<StepFieldStatus> StepFieldStatuses { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤事件
|
||||
/// </summary>
|
||||
public StepEvent StepEvent { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤子流程设置
|
||||
/// </summary>
|
||||
public StepSubFlow StepSubFlow { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤抄送设置
|
||||
/// </summary>
|
||||
public StepCopyFor StepCopyFor { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
|
||||
public Step Clone()
|
||||
{
|
||||
return (Step)MemberwiseClone();
|
||||
}
|
||||
}
|
||||
}
|
||||
128
back_end_code/Ewide.RoadFlow/Entity/FlowRunModel/StepBase.cs
Normal file
128
back_end_code/Ewide.RoadFlow/Entity/FlowRunModel/StepBase.cs
Normal file
@@ -0,0 +1,128 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace RoadFlow.Model.FlowRunModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 步骤基本设置
|
||||
/// </summary>
|
||||
public class StepBase
|
||||
{
|
||||
/// <summary>
|
||||
///<para>流转类型</para>
|
||||
///<para>0 根据条件判断(无后续步骤时提示)</para>
|
||||
///<para>1 单选一个步骤</para>
|
||||
///<para>2 多选几个步骤(默认选中第一个)</para>
|
||||
///<para>3 多选几个步骤(默认全部选中)</para>
|
||||
///<para>4 多选几个步骤(默认全部选中不能取消)</para>
|
||||
///<para>5 根据条件判断(无后续步骤时完成)</para>
|
||||
/// </summary>
|
||||
public int FlowType { get; set; }
|
||||
/// <summary>
|
||||
/// 运行时选择 0不允许 1允许
|
||||
/// </summary>
|
||||
public int RunSelect { get; set; }
|
||||
/// <summary>
|
||||
/// 处理者类型 0所有成员 1部门 2岗位 3工作组 4人员 5发起者 6前一步骤处理者 7某一步骤处理者 8字段值 9发起者主管 10发起者分管领导 11当前处理者主管 12当前处理者分管领导
|
||||
/// </summary>
|
||||
public string HandlerType { get; set; }
|
||||
/// <summary>
|
||||
/// 选择范围
|
||||
/// </summary>
|
||||
public string SelectRange { get; set; }
|
||||
/// <summary>
|
||||
/// 将默认处理者作为限定选择范围 0默认处理者选中 1默认处理者不选中
|
||||
/// </summary>
|
||||
public int SelectRangeForDefaultHandler { get; set; }
|
||||
/// <summary>
|
||||
/// 当处理者类型为 7某一步骤处理者 时的处理者步骤
|
||||
/// </summary>
|
||||
public Guid? HandlerStepId { get; set; }
|
||||
/// <summary>
|
||||
/// 当处理者类型为 8字段值 时的字段
|
||||
/// </summary>
|
||||
public string ValueField { get; set; }
|
||||
/// <summary>
|
||||
/// 没有找到处理者的时,是否取上一次的处理人作为默认处理者 0否 1是
|
||||
/// </summary>
|
||||
public int LastHadler { get; set; }
|
||||
/// <summary>
|
||||
/// 默认处理者
|
||||
/// </summary>
|
||||
public string DefaultHandler { get; set; }
|
||||
/// <summary>
|
||||
/// 退回策略 0不能退回 1根据处理策略退回 2一人退回全部退回 3所有人退回才退回 4独立退回
|
||||
/// </summary>
|
||||
public int BackModel { get; set; }
|
||||
/// <summary>
|
||||
/// 处理策略 0所有人必须处理 1一人同意即可 2依据人数比例 3独立处理 4 按选择人员顺序处理
|
||||
/// </summary>
|
||||
public int HanlderModel { get; set; }
|
||||
/// <summary>
|
||||
/// 处理策略分组 0不分组 1按发送人分组 2按接收人分组
|
||||
/// </summary>
|
||||
public int HanlderModelGroup { get; set; }
|
||||
/// <summary>
|
||||
/// 退回类型 0退回前一步 1退回第一步 2退回某一步
|
||||
/// </summary>
|
||||
public int BackType { get; set; }
|
||||
/// <summary>
|
||||
/// 是否可以在退回时选择接收人(默认是退回给上一步的发送人)
|
||||
/// </summary>
|
||||
public int BackSelectUser { get; set; }
|
||||
/// <summary>
|
||||
/// 策略百分比
|
||||
/// </summary>
|
||||
public decimal Percentage { get; set; }
|
||||
/// <summary>
|
||||
/// 退回步骤ID 当退回类型为 2退回某一步时
|
||||
/// </summary>
|
||||
public Guid? BackStepId { get; set; }
|
||||
/// <summary>
|
||||
/// 会签策略 0 不会签 1 所有步骤同意 2 一个步骤同意即可 3 依据比例
|
||||
/// </summary>
|
||||
public int Countersignature { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤会签的起点步骤Id
|
||||
/// </summary>
|
||||
public Guid? CountersignatureStartStepId { get; set; }
|
||||
/// <summary>
|
||||
/// 会签策略是依据比例时设置的百分比
|
||||
/// </summary>
|
||||
public decimal CountersignaturePercentage { get; set; }
|
||||
/// <summary>
|
||||
/// 子流程处理策略 0 子流程完成后才能提交 1 子流程发起即可提交
|
||||
/// </summary>
|
||||
public int SubFlowStrategy { get; set; }
|
||||
/// <summary>
|
||||
/// 并发控制 0不控制 1控制
|
||||
/// </summary>
|
||||
public int ConcurrentModel { get; set; }
|
||||
/// <summary>
|
||||
/// 默认处理者SQL或方法
|
||||
/// </summary>
|
||||
public string DefaultHandlerSqlOrMethod { get; set; }
|
||||
/// <summary>
|
||||
/// 后续步骤有默认处理人直接发送(不需要点确定)
|
||||
/// </summary>
|
||||
public int AutoConfirm { get; set; }
|
||||
/// <summary>
|
||||
/// 发送人和接收人是同一人时跳过
|
||||
/// </summary>
|
||||
public int SkipIdenticalUser { get; set; }
|
||||
/// <summary>
|
||||
/// 根据方法跳过(方法返回1或true时跳过)
|
||||
/// </summary>
|
||||
public string SkipMethod { get; set; }
|
||||
/// <summary>
|
||||
/// 发送到退回步骤
|
||||
/// </summary>
|
||||
public int SendToBackStep { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace RoadFlow.Model.FlowRunModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 步骤按钮实体
|
||||
/// </summary>
|
||||
public class StepButton
|
||||
{
|
||||
/// <summary>
|
||||
/// 按钮ID
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
/// <summary>
|
||||
/// 按钮说明
|
||||
/// </summary>
|
||||
public string Note { get; set; }
|
||||
/// <summary>
|
||||
/// 显示标题
|
||||
/// </summary>
|
||||
public string ShowTitle { get; set; }
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public int Sort { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace RoadFlow.Model.FlowRunModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 步骤抄送实体
|
||||
/// </summary>
|
||||
public class StepCopyFor
|
||||
{
|
||||
/// <summary>
|
||||
/// 抄送组织机构人员
|
||||
/// </summary>
|
||||
public string MemberId { get; set; }
|
||||
/// <summary>
|
||||
/// 处理者类型
|
||||
/// </summary>
|
||||
public string HandlerType { get; set; }
|
||||
/// <summary>
|
||||
/// 处理者步骤
|
||||
/// </summary>
|
||||
public string Steps { get; set; }
|
||||
/// <summary>
|
||||
/// 方法或SQL
|
||||
/// </summary>
|
||||
public string MethodOrSql { get; set; }
|
||||
/// <summary>
|
||||
/// 抄送时间 0步骤接收时 1步骤完成时
|
||||
/// </summary>
|
||||
public int CopyforTime { get; set; }
|
||||
/// <summary>
|
||||
/// 发送待办消息方式 0站内短信 1手机短信 2微信 3公众号 4邮件
|
||||
/// </summary>
|
||||
public string SendMessageType { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace RoadFlow.Model.FlowRunModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 步骤事件实体
|
||||
/// </summary>
|
||||
public class StepEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// 步骤提交前事件
|
||||
/// </summary>
|
||||
public string SubmitBefore { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤提交后事件
|
||||
/// </summary>
|
||||
public string SubmitAfter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 步骤通过后事件
|
||||
/// </summary>
|
||||
public string SubmitPassAfter { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤退回前事件
|
||||
/// </summary>
|
||||
public string BackBefore { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤退回后事件
|
||||
/// </summary>
|
||||
public string BackAfter { get; set; }
|
||||
/// <summary>
|
||||
/// 步骤退回通过后事件
|
||||
/// </summary>
|
||||
public string BackPassAfter { get; set; }
|
||||
/// <summary>
|
||||
/// 子流程激活前事件
|
||||
/// </summary>
|
||||
public string SubFlowActivationBefore { get; set; }
|
||||
/// <summary>
|
||||
/// 子流程完成后事件
|
||||
/// </summary>
|
||||
public string SubFlowCompletedBefore { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace RoadFlow.Model.FlowRunModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 步骤字段状态实体
|
||||
/// </summary>
|
||||
public class StepFieldStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// 字段 连接ID.表名.字段名
|
||||
/// </summary>
|
||||
public string Field { get; set; }
|
||||
/// <summary>
|
||||
/// 状态 0编辑 1只读 2隐藏
|
||||
/// </summary>
|
||||
public int Status { get; set; }
|
||||
/// <summary>
|
||||
/// 数据检查 0不检查 1允许为空,非空时检查 2不允许为空,并检查
|
||||
/// </summary>
|
||||
public int Check { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
34
back_end_code/Ewide.RoadFlow/Entity/FlowRunModel/StepForm.cs
Normal file
34
back_end_code/Ewide.RoadFlow/Entity/FlowRunModel/StepForm.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace RoadFlow.Model.FlowRunModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 步骤表单实体
|
||||
/// </summary>
|
||||
public class StepForm
|
||||
{
|
||||
/// <summary>
|
||||
/// 表单ID
|
||||
/// </summary>
|
||||
public Guid Id { get; set; }
|
||||
/// <summary>
|
||||
/// 表单名称
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// 移动端表单ID
|
||||
/// </summary>
|
||||
public Guid MobileId { get; set; }
|
||||
/// <summary>
|
||||
/// 移动端表单名称
|
||||
/// </summary>
|
||||
public string MobileName { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace RoadFlow.Model.FlowRunModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 步骤子流程实体
|
||||
/// </summary>
|
||||
public class StepSubFlow
|
||||
{
|
||||
/// <summary>
|
||||
/// 子流程ID
|
||||
/// </summary>
|
||||
public Guid SubFlowId { get; set; }
|
||||
/// <summary>
|
||||
/// 子流程策略,0子流程完成才能提交,1子流程发起即可提交,2子流程完成自动提交
|
||||
/// </summary>
|
||||
public int SubFlowStrategy { get; set; }
|
||||
/// <summary>
|
||||
/// 实例类型 0所有人同一实例 1每个人单独实例
|
||||
/// </summary>
|
||||
public int TaskType { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace RoadFlow.Model.FlowRunModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 标识字段
|
||||
/// </summary>
|
||||
public class TitleField
|
||||
{
|
||||
/// <summary>
|
||||
/// 连接ID
|
||||
/// </summary>
|
||||
public Guid ConnectionId { get; set; }
|
||||
/// <summary>
|
||||
/// 表
|
||||
/// </summary>
|
||||
public string Table { get; set; }
|
||||
/// <summary>
|
||||
/// 字段
|
||||
/// </summary>
|
||||
public string Field { get; set; }
|
||||
/// <summary>
|
||||
/// 标识值
|
||||
/// </summary>
|
||||
public string Value { get; set; }
|
||||
/// <summary>
|
||||
/// 流程审批完成后事件
|
||||
/// </summary>
|
||||
public string EventCompleted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 流程审批终止后事件
|
||||
/// </summary>
|
||||
public string EventStop { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
157
back_end_code/Ewide.RoadFlow/Entity/FlowRunModel/User.cs
Normal file
157
back_end_code/Ewide.RoadFlow/Entity/FlowRunModel/User.cs
Normal file
@@ -0,0 +1,157 @@
|
||||
using Ewide.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace RoadFlow.Model.FlowRunModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户实体类
|
||||
/// </summary>
|
||||
|
||||
public class User : IEqualityComparer<User>
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
[DisplayName("Id")]
|
||||
[Key]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 姓名
|
||||
/// </summary>
|
||||
[DisplayName("姓名")]
|
||||
[Required(ErrorMessage = "姓名不能为空")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 帐号
|
||||
/// </summary>
|
||||
[DisplayName("帐号")]
|
||||
[Required(ErrorMessage = "帐号不能为空")]
|
||||
public string Account { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 密码
|
||||
/// </summary>
|
||||
[DisplayName("密码")]
|
||||
[Required(ErrorMessage = "密码不能为空")]
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 性别 0男 1女
|
||||
/// </summary>
|
||||
[DisplayName("性别 0男 1女")]
|
||||
public int? Sex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态 0 正常 1 冻结
|
||||
/// </summary>
|
||||
[DisplayName("状态 0 正常 1 冻结")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 职务
|
||||
/// </summary>
|
||||
[DisplayName("职务")]
|
||||
public string Job { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[DisplayName("备注")]
|
||||
public string Note { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 手机
|
||||
/// </summary>
|
||||
[DisplayName("手机")]
|
||||
public string Mobile { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 办公电话
|
||||
/// </summary>
|
||||
[DisplayName("办公电话")]
|
||||
public string Tel { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 其它联系方式
|
||||
/// </summary>
|
||||
[DisplayName("其它联系方式")]
|
||||
public string OtherTel { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 传真
|
||||
/// </summary>
|
||||
[DisplayName("传真")]
|
||||
public string Fax { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 邮箱
|
||||
/// </summary>
|
||||
[DisplayName("邮箱")]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// QQ(此字段不保存QQ号了,用来保存流程处理时有时需要人员分组)
|
||||
/// </summary>
|
||||
[DisplayName("QQ")]
|
||||
public string QQ { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 头像
|
||||
/// </summary>
|
||||
[DisplayName("头像")]
|
||||
public string HeadImg { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 微信号(此字段不保存微信号,用来保存用户选择的当前语言)
|
||||
/// </summary>
|
||||
[DisplayName("微信号")]
|
||||
public string WeiXin { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 人员兼职的机构ID(兼职时有用)(organizeuser表ID)
|
||||
/// </summary>
|
||||
[DisplayName("人员兼职的机构ID")]
|
||||
public string PartTimeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 微信openid
|
||||
/// </summary>
|
||||
[DisplayName("微信openid")]
|
||||
public string WeiXinOpenId { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||
}
|
||||
|
||||
public bool Equals(User u1, User u2)
|
||||
{
|
||||
return u1.Id == u2.Id;
|
||||
}
|
||||
|
||||
public int GetHashCode(User u)
|
||||
{
|
||||
return u.Id.GetHashCode();
|
||||
}
|
||||
|
||||
public User Clone()
|
||||
{
|
||||
return (User)MemberwiseClone();
|
||||
}
|
||||
|
||||
public static User FromSysUser(SysUser u)
|
||||
{
|
||||
User rtn = new User();
|
||||
rtn.Id = u.Id;
|
||||
rtn.Name = u.Name;
|
||||
|
||||
return rtn;
|
||||
}
|
||||
}
|
||||
}
|
||||
259
back_end_code/Ewide.RoadFlow/Entity/ProgramRun/ProgramRun.cs
Normal file
259
back_end_code/Ewide.RoadFlow/Entity/ProgramRun/ProgramRun.cs
Normal file
@@ -0,0 +1,259 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 程序设计运行时实体,用于缓存
|
||||
/// </summary>
|
||||
public class ProgramRun
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
[DisplayName("Id")]
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 应用名称
|
||||
/// </summary>
|
||||
[DisplayName("应用名称")]
|
||||
[Required(ErrorMessage = "应用名称不能为空")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分类
|
||||
/// </summary>
|
||||
[Required]
|
||||
[DisplayName("分类")]
|
||||
public Guid Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[Required]
|
||||
[DisplayName("创建时间")]
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发布时间
|
||||
/// </summary>
|
||||
[DisplayName("发布时间")]
|
||||
public DateTime? PublishTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[Required]
|
||||
[DisplayName("创建人")]
|
||||
public Guid CreateUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询SQL
|
||||
/// </summary>
|
||||
[Required]
|
||||
[DisplayName("查询SQL")]
|
||||
public string SqlString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否显示新增按钮
|
||||
/// </summary>
|
||||
[Required]
|
||||
[DisplayName("是否显示新增按钮")]
|
||||
public int IsAdd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据连接ID
|
||||
/// </summary>
|
||||
[Required]
|
||||
[DisplayName("数据连接ID")]
|
||||
public Guid ConnId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态 0设计中 1已发布 2已作废
|
||||
/// </summary>
|
||||
[Required]
|
||||
[DisplayName("状态 0设计中 1已发布 2已作废")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 表单ID
|
||||
/// </summary>
|
||||
[DisplayName("表单ID")]
|
||||
public string FormId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 编辑模式 0,当前窗口 1,弹出层
|
||||
/// </summary>
|
||||
[DisplayName("编辑模式 0,当前窗口 1,弹出层")]
|
||||
public int? EditModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 弹出层宽度
|
||||
/// </summary>
|
||||
[DisplayName("弹出层宽度")]
|
||||
public string Width { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 弹出层高度
|
||||
/// </summary>
|
||||
[DisplayName("弹出层高度")]
|
||||
public string Height { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 按钮显示位置 0新行 1查询后面
|
||||
/// </summary>
|
||||
[DisplayName("按钮显示位置 0新行 1查询后面")]
|
||||
public int ButtonLocation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否分页
|
||||
/// </summary>
|
||||
[DisplayName("是否分页")]
|
||||
public int IsPager { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 选择列 0无 1单选 2多选
|
||||
/// </summary>
|
||||
public int SelectColumn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否显示序号列
|
||||
/// </summary>
|
||||
public int RowNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 页面脚本
|
||||
/// </summary>
|
||||
[DisplayName("页面脚本")]
|
||||
public string ClientScript { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出EXCEL模板
|
||||
/// </summary>
|
||||
[DisplayName("导出EXCEL模板")]
|
||||
public string ExportTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出Excel表头
|
||||
/// </summary>
|
||||
[DisplayName("导出Excel表头")]
|
||||
public string ExportHeaderText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导出EXCLE的文件名
|
||||
/// </summary>
|
||||
[DisplayName("导出EXCLE的文件名")]
|
||||
public string ExportFileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列表样式
|
||||
/// </summary>
|
||||
[DisplayName("列表样式")]
|
||||
public string TableStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列表表头HTML
|
||||
/// </summary>
|
||||
[DisplayName("列表表头HTML")]
|
||||
public string TableHead { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 导入EXCEL数据时的标识字段,每次导入生成一个编号区分
|
||||
/// </summary>
|
||||
[DisplayName("导入EXCEL数据时的标识字段,每次导入生成一个编号区分")]
|
||||
public string InDataNumberFiledName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 表头合并
|
||||
/// </summary>
|
||||
public string GroupHeaders { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///工具栏按钮HTML
|
||||
/// </summary>
|
||||
public string Button_Toolbar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///常规按钮HTML
|
||||
/// </summary>
|
||||
public string Button_Normal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///列表HTML
|
||||
/// </summary>
|
||||
public string Button_List { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询HTML
|
||||
/// </summary>
|
||||
public string QueryHtml { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询按钮时的JSON data
|
||||
/// function query(size, number) {var data = 这里的JSON;}
|
||||
/// </summary>
|
||||
public string QueryData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 表头
|
||||
/// </summary>
|
||||
public string GridColNames { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列设置
|
||||
/// </summary>
|
||||
public string GridColModels { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列设置(VUE用)
|
||||
/// </summary>
|
||||
public JArray Cols { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 默认排序列
|
||||
/// </summary>
|
||||
public string DefaultSort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 新增修改删除数据后执行的方法
|
||||
/// </summary>
|
||||
public string EditEvents { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 查询SQL
|
||||
/// </summary>
|
||||
public string QuerySql { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 得到条数SQL
|
||||
/// </summary>
|
||||
public string CountSql { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 列表字段
|
||||
/// </summary>
|
||||
public List<Model.rf_programfield> ProgramFields { get; set; }
|
||||
/// <summary>
|
||||
/// 按钮
|
||||
/// </summary>
|
||||
public List<Model.rf_programbutton> ProgramButtons { get; set; }
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
public List<Model.rf_programquery> ProgramQueries { get; set; }
|
||||
/// <summary>
|
||||
/// 验证
|
||||
/// </summary>
|
||||
public List<Model.rf_programvalidate> ProgramValidates { get; set; }
|
||||
/// <summary>
|
||||
/// 导出
|
||||
/// </summary>
|
||||
public List<Model.rf_programexport> ProgramExports { get; set; }
|
||||
}
|
||||
}
|
||||
132
back_end_code/Ewide.RoadFlow/Entity/rf_applibrary.cs
Normal file
132
back_end_code/Ewide.RoadFlow/Entity/rf_applibrary.cs
Normal file
@@ -0,0 +1,132 @@
|
||||
//----------rf_applibrary开始----------
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_applibrary
|
||||
/// </summary>
|
||||
[Table("rf_applibrary")]
|
||||
[Serializable]
|
||||
public partial class rf_applibrary: BaseEntity {
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="标题")]
|
||||
[Column("Title")]
|
||||
[DataMember]
|
||||
public string Title {get;set;}
|
||||
/// <summary>
|
||||
/// 地址
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="地址")]
|
||||
[Column("Address")]
|
||||
[DataMember]
|
||||
public string Address {get;set;}
|
||||
/// <summary>
|
||||
/// 分类ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="分类ID")]
|
||||
[Column("Type")]
|
||||
[DataMember]
|
||||
public string Type {get;set;}
|
||||
/// <summary>
|
||||
/// 打开方式 0-默认(标签方式),1-弹出层,2-弹出层(模态),3-弹出窗口,4-弹出窗口(模态),5-新窗口
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="打开方式 0-默认(标签方式),1-弹出层,2-弹出层(模态),3-弹出窗口,4-弹出窗口(模态),5-新窗口")]
|
||||
[Column("OpenMode")]
|
||||
[DataMember]
|
||||
public int OpenMode {get;set;}
|
||||
/// <summary>
|
||||
/// 弹出窗口宽度
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="弹出窗口宽度")]
|
||||
[Column("Width")]
|
||||
[DataMember]
|
||||
public int? Width {get;set;}
|
||||
/// <summary>
|
||||
/// 弹出窗口高度
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="弹出窗口高度")]
|
||||
[Column("Height")]
|
||||
[DataMember]
|
||||
public int? Height {get;set;}
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="备注")]
|
||||
[Column("Note")]
|
||||
[DataMember]
|
||||
public string Note {get;set;}
|
||||
/// <summary>
|
||||
/// 唯一标识符,流程应用时为流程ID,表单应用时对应表单ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="唯一标识符,流程应用时为流程ID,表单应用时对应表单ID")]
|
||||
[Column("Code")]
|
||||
[DataMember]
|
||||
public string Code {get;set;}
|
||||
/// <summary>
|
||||
/// 标题英语
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="标题英语")]
|
||||
[Column("Title_en")]
|
||||
[DataMember]
|
||||
public string Title_en {get;set;}
|
||||
/// <summary>
|
||||
/// 标题繁体中文
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="标题繁体中文")]
|
||||
[Column("Title_zh")]
|
||||
[DataMember]
|
||||
public string Title_zh {get;set;}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/// <summary>
|
||||
/// 数据表实体类Map:rf_applibrary
|
||||
/// </summary>
|
||||
public class rf_applibraryMap : EntityTypeConfiguration<rf_applibrary>
|
||||
{
|
||||
public rf_applibraryMap()
|
||||
{
|
||||
this.ToTable("rf_applibrary");
|
||||
this.HasKey(t => t.Id);
|
||||
this.Property(t => t.Title).HasColumnName("Title").IsRequired();
|
||||
this.Property(t => t.Address).HasColumnName("Address").IsRequired();
|
||||
this.Property(t => t.Type).HasColumnName("Type");
|
||||
this.Property(t => t.OpenMode).HasColumnName("OpenMode").IsRequired();
|
||||
this.Property(t => t.Width).HasColumnName("Width");
|
||||
this.Property(t => t.Height).HasColumnName("Height");
|
||||
this.Property(t => t.Note).HasColumnName("Note");
|
||||
this.Property(t => t.Code).HasColumnName("Code");
|
||||
this.Property(t => t.Title_en).HasColumnName("Title_en");
|
||||
this.Property(t => t.Title_zh).HasColumnName("Title_zh");
|
||||
}
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
|
||||
//----------rf_applibrary结束----------
|
||||
|
||||
|
||||
87
back_end_code/Ewide.RoadFlow/Entity/rf_dbconnection.cs
Normal file
87
back_end_code/Ewide.RoadFlow/Entity/rf_dbconnection.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
//----------rf_dbconnection开始----------
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_dbconnection
|
||||
/// </summary>
|
||||
[Table("rf_dbconnection")]
|
||||
[Serializable]
|
||||
public partial class rf_dbconnection: BaseEntity {
|
||||
/// <summary>
|
||||
/// 连接名称
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="连接名称")]
|
||||
[Column("Name")]
|
||||
[DataMember]
|
||||
public string Name {get;set;}
|
||||
/// <summary>
|
||||
/// 连接类型
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="连接类型")]
|
||||
[Column("ConnType")]
|
||||
[DataMember]
|
||||
public string ConnType {get;set;}
|
||||
/// <summary>
|
||||
/// 连接字符串
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="连接字符串")]
|
||||
[Column("ConnString")]
|
||||
[DataMember]
|
||||
public string ConnString {get;set;}
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="备注")]
|
||||
[Column("Note")]
|
||||
[DataMember]
|
||||
public string Note {get;set;}
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="排序")]
|
||||
[Column("Sort")]
|
||||
[DataMember]
|
||||
public int Sort {get;set;}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/// <summary>
|
||||
/// 数据表实体类Map:rf_dbconnection
|
||||
/// </summary>
|
||||
public class rf_dbconnectionMap : EntityTypeConfiguration<rf_dbconnection>
|
||||
{
|
||||
public rf_dbconnectionMap()
|
||||
{
|
||||
this.ToTable("rf_dbconnection");
|
||||
this.HasKey(t => t.Id);
|
||||
this.Property(t => t.Name).HasColumnName("Name").IsRequired();
|
||||
this.Property(t => t.ConnType).HasColumnName("ConnType").IsRequired();
|
||||
this.Property(t => t.ConnString).HasColumnName("ConnString").IsRequired();
|
||||
this.Property(t => t.Note).HasColumnName("Note");
|
||||
this.Property(t => t.Sort).HasColumnName("Sort").IsRequired();
|
||||
}
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
|
||||
//----------rf_dbconnection结束----------
|
||||
|
||||
|
||||
105
back_end_code/Ewide.RoadFlow/Entity/rf_dictionary.cs
Normal file
105
back_end_code/Ewide.RoadFlow/Entity/rf_dictionary.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_dictionary
|
||||
/// </summary>
|
||||
[Table("rf_dictionary")]
|
||||
[Serializable]
|
||||
public partial class rf_dictionary : BaseEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 上级ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "上级ID")]
|
||||
[Column("ParentId")]
|
||||
[DataMember]
|
||||
public string ParentId { get; set; }
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "标题")]
|
||||
[Column("Title")]
|
||||
[DataMember]
|
||||
public string Title { get; set; }
|
||||
/// <summary>
|
||||
/// 唯一代码
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "唯一代码")]
|
||||
[Column("Code")]
|
||||
[DataMember]
|
||||
public string Code { get; set; }
|
||||
/// <summary>
|
||||
/// 值
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "值")]
|
||||
[Column("Value")]
|
||||
[DataMember]
|
||||
public string Value { get; set; }
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "备注")]
|
||||
[Column("Note")]
|
||||
[DataMember]
|
||||
public string Note { get; set; }
|
||||
/// <summary>
|
||||
/// 其它信息
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "其它信息")]
|
||||
[Column("Other")]
|
||||
[DataMember]
|
||||
public string Other { get; set; }
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "排序")]
|
||||
[Column("Sort")]
|
||||
[DataMember]
|
||||
public int Sort { get; set; }
|
||||
/// <summary>
|
||||
/// 0 正常 1 删除
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "0 正常 1 删除")]
|
||||
[Column("Status")]
|
||||
[DataMember]
|
||||
public int Status { get; set; }
|
||||
/// <summary>
|
||||
/// 标题_英语
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "标题_英语")]
|
||||
[Column("Title_en")]
|
||||
[DataMember]
|
||||
public string Title_en { get; set; }
|
||||
/// <summary>
|
||||
/// 标题_繁体中文
|
||||
/// </summary>
|
||||
|
||||
[Display(Name = "标题_繁体中文")]
|
||||
[Column("Title_zh")]
|
||||
[DataMember]
|
||||
public string Title_zh { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
159
back_end_code/Ewide.RoadFlow/Entity/rf_flow.cs
Normal file
159
back_end_code/Ewide.RoadFlow/Entity/rf_flow.cs
Normal file
@@ -0,0 +1,159 @@
|
||||
//----------rf_flow开始----------
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_flow
|
||||
/// </summary>
|
||||
[Table("rf_flow")]
|
||||
[Serializable]
|
||||
public partial class rf_flow: BaseEntity {
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="名称")]
|
||||
[Column("Name")]
|
||||
[DataMember]
|
||||
public string Name {get;set;}
|
||||
/// <summary>
|
||||
/// 分类
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="分类")]
|
||||
[Column("FlowType")]
|
||||
[DataMember]
|
||||
public string FlowType {get;set;}
|
||||
/// <summary>
|
||||
/// 管理人员
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="管理人员")]
|
||||
[Column("Manager")]
|
||||
[DataMember]
|
||||
public string Manager {get;set;}
|
||||
/// <summary>
|
||||
/// 实例管理人员
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="实例管理人员")]
|
||||
[Column("InstanceManager")]
|
||||
[DataMember]
|
||||
public string InstanceManager {get;set;}
|
||||
/// <summary>
|
||||
/// 创建日期
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="创建日期")]
|
||||
[Column("CreateDate")]
|
||||
[DataMember]
|
||||
public DateTime CreateDate {get;set;}
|
||||
/// <summary>
|
||||
/// 创建人员
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="创建人员")]
|
||||
[Column("CreateUser")]
|
||||
[DataMember]
|
||||
public string CreateUser {get;set;}
|
||||
/// <summary>
|
||||
/// 设计时JSON
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="设计时JSON")]
|
||||
[Column("DesignerJSON")]
|
||||
[DataMember]
|
||||
public string DesignerJSON {get;set;}
|
||||
/// <summary>
|
||||
/// 运行时JSON
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="运行时JSON")]
|
||||
[Column("RunJSON")]
|
||||
[DataMember]
|
||||
public string RunJSON {get;set;}
|
||||
/// <summary>
|
||||
/// 安装日期
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="安装日期")]
|
||||
[Column("InstallDate")]
|
||||
[DataMember]
|
||||
public DateTime? InstallDate {get;set;}
|
||||
/// <summary>
|
||||
/// 安装人员
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="安装人员")]
|
||||
[Column("InstallUser")]
|
||||
[DataMember]
|
||||
public string InstallUser {get;set;}
|
||||
/// <summary>
|
||||
/// 状态 0设计中 1已安装 2已卸载 3已删除
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="状态 0设计中 1已安装 2已卸载 3已删除")]
|
||||
[Column("Status")]
|
||||
[DataMember]
|
||||
public int Status {get;set;}
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="备注")]
|
||||
[Column("Note")]
|
||||
[DataMember]
|
||||
public string Note {get;set;}
|
||||
/// <summary>
|
||||
/// 所属系统Id
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="所属系统Id")]
|
||||
[Column("SystemId")]
|
||||
[DataMember]
|
||||
public string SystemId {get;set;}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/// <summary>
|
||||
/// 数据表实体类Map:rf_flow
|
||||
/// </summary>
|
||||
public class rf_flowMap : EntityTypeConfiguration<rf_flow>
|
||||
{
|
||||
public rf_flowMap()
|
||||
{
|
||||
this.ToTable("rf_flow");
|
||||
this.HasKey(t => t.Id);
|
||||
this.Property(t => t.Name).HasColumnName("Name").IsRequired();
|
||||
this.Property(t => t.FlowType).HasColumnName("FlowType").IsRequired();
|
||||
this.Property(t => t.Manager).HasColumnName("Manager").IsRequired();
|
||||
this.Property(t => t.InstanceManager).HasColumnName("InstanceManager").IsRequired();
|
||||
this.Property(t => t.CreateDate).HasColumnName("CreateDate").IsRequired();
|
||||
this.Property(t => t.CreateUser).HasColumnName("CreateUser").IsRequired();
|
||||
this.Property(t => t.DesignerJSON).HasColumnName("DesignerJSON");
|
||||
this.Property(t => t.RunJSON).HasColumnName("RunJSON");
|
||||
this.Property(t => t.InstallDate).HasColumnName("InstallDate");
|
||||
this.Property(t => t.InstallUser).HasColumnName("InstallUser");
|
||||
this.Property(t => t.Status).HasColumnName("Status").IsRequired();
|
||||
this.Property(t => t.Note).HasColumnName("Note");
|
||||
this.Property(t => t.SystemId).HasColumnName("SystemId");
|
||||
}
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
|
||||
//----------rf_flow结束----------
|
||||
|
||||
|
||||
87
back_end_code/Ewide.RoadFlow/Entity/rf_flowapisystem.cs
Normal file
87
back_end_code/Ewide.RoadFlow/Entity/rf_flowapisystem.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
//----------rf_flowapisystem开始----------
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_flowapisystem
|
||||
/// </summary>
|
||||
[Table("rf_flowapisystem")]
|
||||
[Serializable]
|
||||
public partial class rf_flowapisystem: BaseEntity {
|
||||
/// <summary>
|
||||
/// 系统名称
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="系统名称")]
|
||||
[Column("Name")]
|
||||
[DataMember]
|
||||
public string Name {get;set;}
|
||||
/// <summary>
|
||||
/// 系统标识(不能重复)
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="系统标识(不能重复)")]
|
||||
[Column("SystemCode")]
|
||||
[DataMember]
|
||||
public string SystemCode {get;set;}
|
||||
/// <summary>
|
||||
/// 调用KEY
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="调用KEY")]
|
||||
[Column("SystemIP")]
|
||||
[DataMember]
|
||||
public string SystemIP {get;set;}
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="备注")]
|
||||
[Column("Note")]
|
||||
[DataMember]
|
||||
public string Note {get;set;}
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="排序")]
|
||||
[Column("Sort")]
|
||||
[DataMember]
|
||||
public int Sort {get;set;}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/// <summary>
|
||||
/// 数据表实体类Map:rf_flowapisystem
|
||||
/// </summary>
|
||||
public class rf_flowapisystemMap : EntityTypeConfiguration<rf_flowapisystem>
|
||||
{
|
||||
public rf_flowapisystemMap()
|
||||
{
|
||||
this.ToTable("rf_flowapisystem");
|
||||
this.HasKey(t => t.Id);
|
||||
this.Property(t => t.Name).HasColumnName("Name").IsRequired();
|
||||
this.Property(t => t.SystemCode).HasColumnName("SystemCode").IsRequired();
|
||||
this.Property(t => t.SystemIP).HasColumnName("SystemIP").IsRequired();
|
||||
this.Property(t => t.Note).HasColumnName("Note");
|
||||
this.Property(t => t.Sort).HasColumnName("Sort").IsRequired();
|
||||
}
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
|
||||
//----------rf_flowapisystem结束----------
|
||||
|
||||
|
||||
168
back_end_code/Ewide.RoadFlow/Entity/rf_flowarchive.cs
Normal file
168
back_end_code/Ewide.RoadFlow/Entity/rf_flowarchive.cs
Normal file
@@ -0,0 +1,168 @@
|
||||
//----------rf_flowarchive开始----------
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_flowarchive
|
||||
/// </summary>
|
||||
[Table("rf_flowarchive")]
|
||||
[Serializable]
|
||||
public partial class rf_flowarchive: BaseEntity {
|
||||
/// <summary>
|
||||
/// 流程ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="流程ID")]
|
||||
[Column("FlowId")]
|
||||
[DataMember]
|
||||
public string FlowId {get;set;}
|
||||
/// <summary>
|
||||
/// 步骤
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="步骤")]
|
||||
[Column("StepId")]
|
||||
[DataMember]
|
||||
public string StepId {get;set;}
|
||||
/// <summary>
|
||||
/// 流程名称
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="流程名称")]
|
||||
[Column("FlowName")]
|
||||
[DataMember]
|
||||
public string FlowName {get;set;}
|
||||
/// <summary>
|
||||
/// 步骤名称
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="步骤名称")]
|
||||
[Column("StepName")]
|
||||
[DataMember]
|
||||
public string StepName {get;set;}
|
||||
/// <summary>
|
||||
/// 任务ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="任务ID")]
|
||||
[Column("TaskId")]
|
||||
[DataMember]
|
||||
public string TaskId {get;set;}
|
||||
/// <summary>
|
||||
/// 组
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="组")]
|
||||
[Column("GroupId")]
|
||||
[DataMember]
|
||||
public string GroupId {get;set;}
|
||||
/// <summary>
|
||||
/// 实例ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="实例ID")]
|
||||
[Column("InstanceId")]
|
||||
[DataMember]
|
||||
public string InstanceId {get;set;}
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="标题")]
|
||||
[Column("Title")]
|
||||
[DataMember]
|
||||
public string Title {get;set;}
|
||||
/// <summary>
|
||||
/// 处理人ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="处理人ID")]
|
||||
[Column("UserId")]
|
||||
[DataMember]
|
||||
public string UserId {get;set;}
|
||||
/// <summary>
|
||||
/// 处理人姓名
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="处理人姓名")]
|
||||
[Column("UserName")]
|
||||
[DataMember]
|
||||
public string UserName {get;set;}
|
||||
/// <summary>
|
||||
/// 数据
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="数据")]
|
||||
[Column("DataJson")]
|
||||
[DataMember]
|
||||
public string DataJson {get;set;}
|
||||
/// <summary>
|
||||
/// 处理意见HTML
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="处理意见HTML")]
|
||||
[Column("Comments")]
|
||||
[DataMember]
|
||||
public string Comments {get;set;}
|
||||
/// <summary>
|
||||
/// 写入时间
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="写入时间")]
|
||||
[Column("WriteTime")]
|
||||
[DataMember]
|
||||
public DateTime WriteTime {get;set;}
|
||||
/// <summary>
|
||||
/// 表单HTML
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="表单HTML")]
|
||||
[Column("FormHtml")]
|
||||
[DataMember]
|
||||
public string FormHtml {get;set;}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/// <summary>
|
||||
/// 数据表实体类Map:rf_flowarchive
|
||||
/// </summary>
|
||||
public class rf_flowarchiveMap : EntityTypeConfiguration<rf_flowarchive>
|
||||
{
|
||||
public rf_flowarchiveMap()
|
||||
{
|
||||
this.ToTable("rf_flowarchive");
|
||||
this.HasKey(t => t.Id);
|
||||
this.Property(t => t.FlowId).HasColumnName("FlowId").IsRequired();
|
||||
this.Property(t => t.StepId).HasColumnName("StepId").IsRequired();
|
||||
this.Property(t => t.FlowName).HasColumnName("FlowName").IsRequired();
|
||||
this.Property(t => t.StepName).HasColumnName("StepName").IsRequired();
|
||||
this.Property(t => t.TaskId).HasColumnName("TaskId").IsRequired();
|
||||
this.Property(t => t.GroupId).HasColumnName("GroupId").IsRequired();
|
||||
this.Property(t => t.InstanceId).HasColumnName("InstanceId").IsRequired();
|
||||
this.Property(t => t.Title).HasColumnName("Title").IsRequired();
|
||||
this.Property(t => t.UserId).HasColumnName("UserId").IsRequired();
|
||||
this.Property(t => t.UserName).HasColumnName("UserName").IsRequired();
|
||||
this.Property(t => t.DataJson).HasColumnName("DataJson").IsRequired();
|
||||
this.Property(t => t.Comments).HasColumnName("Comments");
|
||||
this.Property(t => t.WriteTime).HasColumnName("WriteTime").IsRequired();
|
||||
this.Property(t => t.FormHtml).HasColumnName("FormHtml");
|
||||
}
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
|
||||
//----------rf_flowarchive结束----------
|
||||
|
||||
|
||||
123
back_end_code/Ewide.RoadFlow/Entity/rf_flowbutton.cs
Normal file
123
back_end_code/Ewide.RoadFlow/Entity/rf_flowbutton.cs
Normal file
@@ -0,0 +1,123 @@
|
||||
//----------rf_flowbutton开始----------
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_flowbutton
|
||||
/// </summary>
|
||||
[Table("rf_flowbutton")]
|
||||
[Serializable]
|
||||
public partial class rf_flowbutton: BaseEntity {
|
||||
/// <summary>
|
||||
/// 按钮标题
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="按钮标题")]
|
||||
[Column("Title")]
|
||||
[DataMember]
|
||||
public string Title {get;set;}
|
||||
/// <summary>
|
||||
/// 按钮图标
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="按钮图标")]
|
||||
[Column("Ico")]
|
||||
[DataMember]
|
||||
public string Ico {get;set;}
|
||||
/// <summary>
|
||||
/// 按钮脚本
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="按钮脚本")]
|
||||
[Column("Script")]
|
||||
[DataMember]
|
||||
public string Script {get;set;}
|
||||
/// <summary>
|
||||
/// 备注说明
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="备注说明")]
|
||||
[Column("Note")]
|
||||
[DataMember]
|
||||
public string Note {get;set;}
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="排序")]
|
||||
[Column("Sort")]
|
||||
[DataMember]
|
||||
public int Sort {get;set;}
|
||||
/// <summary>
|
||||
/// 标题英语
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="标题英语")]
|
||||
[Column("Title_en")]
|
||||
[DataMember]
|
||||
public string Title_en {get;set;}
|
||||
/// <summary>
|
||||
/// 标题繁体中文
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="标题繁体中文")]
|
||||
[Column("Title_zh")]
|
||||
[DataMember]
|
||||
public string Title_zh {get;set;}
|
||||
/// <summary>
|
||||
/// 备注英语
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="备注英语")]
|
||||
[Column("Note_en")]
|
||||
[DataMember]
|
||||
public string Note_en {get;set;}
|
||||
/// <summary>
|
||||
/// 备注繁体中文
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="备注繁体中文")]
|
||||
[Column("Note_zh")]
|
||||
[DataMember]
|
||||
public string Note_zh {get;set;}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/// <summary>
|
||||
/// 数据表实体类Map:rf_flowbutton
|
||||
/// </summary>
|
||||
public class rf_flowbuttonMap : EntityTypeConfiguration<rf_flowbutton>
|
||||
{
|
||||
public rf_flowbuttonMap()
|
||||
{
|
||||
this.ToTable("rf_flowbutton");
|
||||
this.HasKey(t => t.Id);
|
||||
this.Property(t => t.Title).HasColumnName("Title").IsRequired();
|
||||
this.Property(t => t.Ico).HasColumnName("Ico");
|
||||
this.Property(t => t.Script).HasColumnName("Script");
|
||||
this.Property(t => t.Note).HasColumnName("Note");
|
||||
this.Property(t => t.Sort).HasColumnName("Sort").IsRequired();
|
||||
this.Property(t => t.Title_en).HasColumnName("Title_en");
|
||||
this.Property(t => t.Title_zh).HasColumnName("Title_zh");
|
||||
this.Property(t => t.Note_en).HasColumnName("Note_en");
|
||||
this.Property(t => t.Note_zh).HasColumnName("Note_zh");
|
||||
}
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
|
||||
//----------rf_flowbutton结束----------
|
||||
|
||||
|
||||
91
back_end_code/Ewide.RoadFlow/Entity/rf_flowcomment.cs
Normal file
91
back_end_code/Ewide.RoadFlow/Entity/rf_flowcomment.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
//----------rf_flowcomment开始----------
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_flowcomment
|
||||
/// </summary>
|
||||
[Table("rf_flowcomment")]
|
||||
[Serializable]
|
||||
public partial class rf_flowcomment: BaseEntity, IEqualityComparer<rf_flowcomment>
|
||||
{
|
||||
/// <summary>
|
||||
/// 意见使用人
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="意见使用人")]
|
||||
[Column("UserId")]
|
||||
[DataMember]
|
||||
public string UserId {get;set;}
|
||||
/// <summary>
|
||||
/// 类型 0用户添加 1管理员添加
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="类型 0用户添加 1管理员添加")]
|
||||
[Column("AddType")]
|
||||
[DataMember]
|
||||
public int AddType {get;set;}
|
||||
/// <summary>
|
||||
/// 意见
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="意见")]
|
||||
[Column("Comments")]
|
||||
[DataMember]
|
||||
public string Comments {get;set;}
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="排序")]
|
||||
[Column("Sort")]
|
||||
[DataMember]
|
||||
public int Sort {get;set;}
|
||||
|
||||
public bool Equals(rf_flowcomment x, rf_flowcomment y)
|
||||
{
|
||||
return x.Comments == y.Comments;
|
||||
}
|
||||
|
||||
public int GetHashCode([DisallowNull] rf_flowcomment obj)
|
||||
{
|
||||
return obj.Comments.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/// <summary>
|
||||
/// 数据表实体类Map:rf_flowcomment
|
||||
/// </summary>
|
||||
public class rf_flowcommentMap : EntityTypeConfiguration<rf_flowcomment>
|
||||
{
|
||||
public rf_flowcommentMap()
|
||||
{
|
||||
this.ToTable("rf_flowcomment");
|
||||
this.HasKey(t => t.Id);
|
||||
this.Property(t => t.UserId).HasColumnName("UserId").IsRequired();
|
||||
this.Property(t => t.AddType).HasColumnName("AddType").IsRequired();
|
||||
this.Property(t => t.Comments).HasColumnName("Comments").IsRequired();
|
||||
this.Property(t => t.Sort).HasColumnName("Sort").IsRequired();
|
||||
}
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
|
||||
//----------rf_flowcomment结束----------
|
||||
|
||||
|
||||
69
back_end_code/Ewide.RoadFlow/Entity/rf_flowdynamic.cs
Normal file
69
back_end_code/Ewide.RoadFlow/Entity/rf_flowdynamic.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
//----------rf_flowdynamic开始----------
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_flowdynamic
|
||||
/// </summary>
|
||||
[Table("rf_flowdynamic")]
|
||||
[Serializable]
|
||||
public partial class rf_flowdynamic: BaseEntity {
|
||||
/// <summary>
|
||||
/// 动态步骤ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="动态步骤ID")]
|
||||
[Column("StepId")]
|
||||
[DataMember]
|
||||
public string StepId {get;set;}
|
||||
/// <summary>
|
||||
/// 组ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="组ID")]
|
||||
[Key]
|
||||
[Column("GroupId")]
|
||||
[DataMember]
|
||||
public string GroupId {get;set;}
|
||||
/// <summary>
|
||||
/// 流程JSON
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="流程JSON")]
|
||||
[Column("FlowJSON")]
|
||||
[DataMember]
|
||||
public string FlowJSON {get;set;}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/// <summary>
|
||||
/// 数据表实体类Map:rf_flowdynamic
|
||||
/// </summary>
|
||||
public class rf_flowdynamicMap : EntityTypeConfiguration<rf_flowdynamic>
|
||||
{
|
||||
public rf_flowdynamicMap()
|
||||
{
|
||||
this.ToTable("rf_flowdynamic");
|
||||
this.Property(t => t.StepId).HasColumnName("StepId").IsRequired();
|
||||
this.HasKey(t => t.GroupId);
|
||||
this.Property(t => t.FlowJSON).HasColumnName("FlowJSON").IsRequired();
|
||||
}
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
|
||||
//----------rf_flowdynamic结束----------
|
||||
|
||||
|
||||
105
back_end_code/Ewide.RoadFlow/Entity/rf_flowentrust.cs
Normal file
105
back_end_code/Ewide.RoadFlow/Entity/rf_flowentrust.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
//----------rf_flowentrust开始----------
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_flowentrust
|
||||
/// </summary>
|
||||
[Table("rf_flowentrust")]
|
||||
[Serializable]
|
||||
public partial class rf_flowentrust: BaseEntity {
|
||||
/// <summary>
|
||||
/// 委托人
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="委托人")]
|
||||
[Column("UserId")]
|
||||
[DataMember]
|
||||
public string UserId {get;set;}
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="开始时间")]
|
||||
[Column("StartTime")]
|
||||
[DataMember]
|
||||
public DateTime StartTime {get;set;}
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="结束时间")]
|
||||
[Column("EndTime")]
|
||||
[DataMember]
|
||||
public DateTime EndTime {get;set;}
|
||||
/// <summary>
|
||||
/// 委托流程ID,为空表示所有流程
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="委托流程ID,为空表示所有流程")]
|
||||
[Column("FlowId")]
|
||||
[DataMember]
|
||||
public string FlowId {get;set;}
|
||||
/// <summary>
|
||||
/// 被委托人
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="被委托人")]
|
||||
[Column("ToUserId")]
|
||||
[DataMember]
|
||||
public string ToUserId {get;set;}
|
||||
/// <summary>
|
||||
/// 设置时间
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="设置时间")]
|
||||
[Column("WriteTime")]
|
||||
[DataMember]
|
||||
public DateTime WriteTime {get;set;}
|
||||
/// <summary>
|
||||
/// 备注说明
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="备注说明")]
|
||||
[Column("Note")]
|
||||
[DataMember]
|
||||
public string Note {get;set;}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/// <summary>
|
||||
/// 数据表实体类Map:rf_flowentrust
|
||||
/// </summary>
|
||||
public class rf_flowentrustMap : EntityTypeConfiguration<rf_flowentrust>
|
||||
{
|
||||
public rf_flowentrustMap()
|
||||
{
|
||||
this.ToTable("rf_flowentrust");
|
||||
this.HasKey(t => t.Id);
|
||||
this.Property(t => t.UserId).HasColumnName("UserId").IsRequired();
|
||||
this.Property(t => t.StartTime).HasColumnName("StartTime").IsRequired();
|
||||
this.Property(t => t.EndTime).HasColumnName("EndTime").IsRequired();
|
||||
this.Property(t => t.FlowId).HasColumnName("FlowId");
|
||||
this.Property(t => t.ToUserId).HasColumnName("ToUserId").IsRequired();
|
||||
this.Property(t => t.WriteTime).HasColumnName("WriteTime").IsRequired();
|
||||
this.Property(t => t.Note).HasColumnName("Note");
|
||||
}
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
|
||||
//----------rf_flowentrust结束----------
|
||||
|
||||
|
||||
87
back_end_code/Ewide.RoadFlow/Entity/rf_flowreceive.cs
Normal file
87
back_end_code/Ewide.RoadFlow/Entity/rf_flowreceive.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
//----------rf_flowreceive开始----------
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_flowreceive
|
||||
/// </summary>
|
||||
[Table("rf_flowreceive")]
|
||||
[Serializable]
|
||||
public partial class rf_flowreceive: BaseEntity {
|
||||
/// <summary>
|
||||
/// 无描述
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="无描述")]
|
||||
[Column("FlowId")]
|
||||
[DataMember]
|
||||
public string FlowId {get;set;}
|
||||
/// <summary>
|
||||
/// 无描述
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="无描述")]
|
||||
[Column("StepId")]
|
||||
[DataMember]
|
||||
public string StepId {get;set;}
|
||||
/// <summary>
|
||||
/// 无描述
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="无描述")]
|
||||
[Column("SenderId")]
|
||||
[DataMember]
|
||||
public string SenderId {get;set;}
|
||||
/// <summary>
|
||||
/// 无描述
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="无描述")]
|
||||
[Column("SendTime")]
|
||||
[DataMember]
|
||||
public DateTime SendTime {get;set;}
|
||||
/// <summary>
|
||||
/// 无描述
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="无描述")]
|
||||
[Column("Members")]
|
||||
[DataMember]
|
||||
public string Members {get;set;}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/// <summary>
|
||||
/// 数据表实体类Map:rf_flowreceive
|
||||
/// </summary>
|
||||
public class rf_flowreceiveMap : EntityTypeConfiguration<rf_flowreceive>
|
||||
{
|
||||
public rf_flowreceiveMap()
|
||||
{
|
||||
this.ToTable("rf_flowreceive");
|
||||
this.HasKey(t => t.Id);
|
||||
this.Property(t => t.FlowId).HasColumnName("FlowId").IsRequired();
|
||||
this.Property(t => t.StepId).HasColumnName("StepId").IsRequired();
|
||||
this.Property(t => t.SenderId).HasColumnName("SenderId").IsRequired();
|
||||
this.Property(t => t.SendTime).HasColumnName("SendTime").IsRequired();
|
||||
this.Property(t => t.Members).HasColumnName("Members").IsRequired();
|
||||
}
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
|
||||
//----------rf_flowreceive结束----------
|
||||
|
||||
|
||||
310
back_end_code/Ewide.RoadFlow/Entity/rf_flowtask.cs
Normal file
310
back_end_code/Ewide.RoadFlow/Entity/rf_flowtask.cs
Normal file
@@ -0,0 +1,310 @@
|
||||
//----------rf_flowtask开始----------
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_flowtask
|
||||
/// </summary>
|
||||
[Table("rf_flowtask")]
|
||||
[Serializable]
|
||||
public partial class rf_flowtask: BaseEntity {
|
||||
/// <summary>
|
||||
/// 上一任务ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="上一任务ID")]
|
||||
[Column("PrevId")]
|
||||
[DataMember]
|
||||
public string PrevId {get;set;}
|
||||
/// <summary>
|
||||
/// 上一步骤ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="上一步骤ID")]
|
||||
[Column("PrevStepId")]
|
||||
[DataMember]
|
||||
public string PrevStepId {get;set;}
|
||||
/// <summary>
|
||||
/// 流程ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="流程ID")]
|
||||
[Column("FlowId")]
|
||||
[DataMember]
|
||||
public string FlowId {get;set;}
|
||||
/// <summary>
|
||||
/// 流程名称
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="流程名称")]
|
||||
[Column("FlowName")]
|
||||
[DataMember]
|
||||
public string FlowName {get;set;}
|
||||
/// <summary>
|
||||
/// 步骤ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="步骤ID")]
|
||||
[Column("StepId")]
|
||||
[DataMember]
|
||||
public string StepId {get;set;}
|
||||
/// <summary>
|
||||
/// 步骤名称
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="步骤名称")]
|
||||
[Column("StepName")]
|
||||
[DataMember]
|
||||
public string StepName {get;set;}
|
||||
/// <summary>
|
||||
/// 对应业务表主键值
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="对应业务表主键值")]
|
||||
[Column("InstanceId")]
|
||||
[DataMember]
|
||||
public string InstanceId {get;set;}
|
||||
/// <summary>
|
||||
/// 分组ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="分组ID")]
|
||||
[Column("GroupId")]
|
||||
[DataMember]
|
||||
public string GroupId {get;set;}
|
||||
/// <summary>
|
||||
/// 任务类型 0常规 1指派 2委托 3转交 4退回 5抄送 6前加签 7后加签 8并签 9跳转 10自由发送 11征求意见
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="任务类型 0常规 1指派 2委托 3转交 4退回 5抄送 6前加签 7后加签 8并签 9跳转 10自由发送 11征求意见")]
|
||||
[Column("TaskType")]
|
||||
[DataMember]
|
||||
public int TaskType {get;set;}
|
||||
/// <summary>
|
||||
/// 任务标题
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="任务标题")]
|
||||
[Column("Title")]
|
||||
[DataMember]
|
||||
public string Title {get;set;}
|
||||
/// <summary>
|
||||
/// 发送人ID(如果是兼职岗位R_关系表ID)
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="发送人ID(如果是兼职岗位R_关系表ID)")]
|
||||
[Column("SenderId")]
|
||||
[DataMember]
|
||||
public string SenderId {get;set;}
|
||||
/// <summary>
|
||||
/// 发送人姓名
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="发送人姓名")]
|
||||
[Column("SenderName")]
|
||||
[DataMember]
|
||||
public string SenderName {get;set;}
|
||||
/// <summary>
|
||||
/// 接收人ID(如果是兼职岗位R_关系表ID)
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="接收人ID(如果是兼职岗位R_关系表ID)")]
|
||||
[Column("ReceiveId")]
|
||||
[DataMember]
|
||||
public string ReceiveId {get;set;}
|
||||
/// <summary>
|
||||
/// 接收人姓名
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="接收人姓名")]
|
||||
[Column("ReceiveName")]
|
||||
[DataMember]
|
||||
public string ReceiveName {get;set;}
|
||||
/// <summary>
|
||||
/// 接收时间
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="接收时间")]
|
||||
[Column("ReceiveTime")]
|
||||
[DataMember]
|
||||
public DateTime ReceiveTime {get;set;}
|
||||
/// <summary>
|
||||
/// 打开时间
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="打开时间")]
|
||||
[Column("OpenTime")]
|
||||
[DataMember]
|
||||
public DateTime? OpenTime {get;set;}
|
||||
/// <summary>
|
||||
/// 要求完成时间
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="要求完成时间")]
|
||||
[Column("CompletedTime")]
|
||||
[DataMember]
|
||||
public DateTime? CompletedTime {get;set;}
|
||||
/// <summary>
|
||||
/// 实际完成时间
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="实际完成时间")]
|
||||
[Column("CompletedTime1")]
|
||||
[DataMember]
|
||||
public DateTime? CompletedTime1 {get;set;}
|
||||
/// <summary>
|
||||
/// 处理意见
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="处理意见")]
|
||||
[Column("Comments")]
|
||||
[DataMember]
|
||||
public string Comments {get;set;}
|
||||
/// <summary>
|
||||
/// 是否签章
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="是否签章")]
|
||||
[Column("IsSign")]
|
||||
[DataMember]
|
||||
public int IsSign {get;set;}
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="备注")]
|
||||
[Column("Note")]
|
||||
[DataMember]
|
||||
public string Note {get;set;}
|
||||
/// <summary>
|
||||
/// 子流程实例分组ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="子流程实例分组ID")]
|
||||
[Column("SubFlowGroupId")]
|
||||
[DataMember]
|
||||
public string SubFlowGroupId {get;set;}
|
||||
/// <summary>
|
||||
/// 是否超时自动提交 0否 1是
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="是否超时自动提交 0否 1是")]
|
||||
[Column("IsAutoSubmit")]
|
||||
[DataMember]
|
||||
public int IsAutoSubmit {get;set;}
|
||||
/// <summary>
|
||||
/// 附件
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="附件")]
|
||||
[Column("Attachment")]
|
||||
[DataMember]
|
||||
public string Attachment {get;set;}
|
||||
/// <summary>
|
||||
/// 任务状态 -1等待中 0未处理 1处理中 2已完成
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="任务状态 -1等待中 0未处理 1处理中 2已完成")]
|
||||
[Column("Status")]
|
||||
[DataMember]
|
||||
public int Status {get;set;}
|
||||
/// <summary>
|
||||
/// 任务顺序
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="任务顺序")]
|
||||
[Column("Sort")]
|
||||
[DataMember]
|
||||
public int Sort {get;set;}
|
||||
/// <summary>
|
||||
/// 处理类型 处理类型 -1等待中 0未处理 1处理中 2已完成 3已退回 4他人已处理 5他人已退回 6已转交 7已委托 8已阅知 9已指派 10已跳转 11已终止 12他人已终止 13已加签
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="处理类型 处理类型 -1等待中 0未处理 1处理中 2已完成 3已退回 4他人已处理 5他人已退回 6已转交 7已委托 8已阅知 9已指派 10已跳转 11已终止 12他人已终止 13已加签")]
|
||||
[Column("ExecuteType")]
|
||||
[DataMember]
|
||||
public int ExecuteType {get;set;}
|
||||
/// <summary>
|
||||
/// 接收人所在机构ID(如果是兼职人员的情况下这里有值)
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="接收人所在机构ID(如果是兼职人员的情况下这里有值)")]
|
||||
[Column("ReceiveOrganizeId")]
|
||||
[DataMember]
|
||||
public string ReceiveOrganizeId {get;set;}
|
||||
/// <summary>
|
||||
/// 一个步骤内的处理顺序(选择人员顺序处理时的处理顺序)
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="一个步骤内的处理顺序(选择人员顺序处理时的处理顺序)")]
|
||||
[Column("StepSort")]
|
||||
[DataMember]
|
||||
public int StepSort {get;set;}
|
||||
/// <summary>
|
||||
/// 如果是委托任务,这里记录委托人员ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="如果是委托任务,这里记录委托人员ID")]
|
||||
[Column("EntrustUserId")]
|
||||
[DataMember]
|
||||
public string EntrustUserId {get;set;}
|
||||
/// <summary>
|
||||
/// 其它类型 1 子流程任务 111前加签(所有人同意) 112前加签(一人同意) 113前加签(顺序处理) 121后加签(所有人同意) 122后加签(一人同意) 123后加签(顺序处理) 131并签(所有人同意) 132并签(一人同意) 133并签(顺序处理) 20征求意见自己可见 21征求意见参与人可见
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="其它类型 1 子流程任务 111前加签(所有人同意) 112前加签(一人同意) 113前加签(顺序处理) 121后加签(所有人同意) 122后加签(一人同意) 123后加签(顺序处理) 131并签(所有人同意) 132并签(一人同意) 133并签(顺序处理) 20征求意见自己可见 21征求意见参与人可见")]
|
||||
[Column("OtherType")]
|
||||
[DataMember]
|
||||
public int OtherType {get;set;}
|
||||
/// <summary>
|
||||
/// 指定的后续步骤处理人
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="指定的后续步骤处理人")]
|
||||
[Column("NextStepsHandle")]
|
||||
[DataMember]
|
||||
public string NextStepsHandle {get;set;}
|
||||
/// <summary>
|
||||
/// 原步骤ID(动态步骤的原步骤ID)
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="原步骤ID(动态步骤的原步骤ID)")]
|
||||
[Column("BeforeStepId")]
|
||||
[DataMember]
|
||||
public string BeforeStepId {get;set;}
|
||||
/// <summary>
|
||||
/// 提醒时间(如果任务设置了超期提示)
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="提醒时间(如果任务设置了超期提示)")]
|
||||
[Column("RemindTime")]
|
||||
[DataMember]
|
||||
public DateTime? RemindTime {get;set;}
|
||||
/// <summary>
|
||||
/// 是否可以批量提交
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="是否可以批量提交")]
|
||||
[Column("IsBatch")]
|
||||
[DataMember]
|
||||
public int? IsBatch {get;set;}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//----------rf_flowtask结束----------
|
||||
|
||||
|
||||
168
back_end_code/Ewide.RoadFlow/Entity/rf_form.cs
Normal file
168
back_end_code/Ewide.RoadFlow/Entity/rf_form.cs
Normal file
@@ -0,0 +1,168 @@
|
||||
//----------rf_form开始----------
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_form
|
||||
/// </summary>
|
||||
[Table("rf_form")]
|
||||
[Serializable]
|
||||
public partial class rf_form: BaseEntity {
|
||||
/// <summary>
|
||||
/// 表单名称
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="表单名称")]
|
||||
[Column("Name")]
|
||||
[DataMember]
|
||||
public string Name {get;set;}
|
||||
/// <summary>
|
||||
/// 表单分类
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="表单分类")]
|
||||
[Column("FormType")]
|
||||
[DataMember]
|
||||
public string FormType {get;set;}
|
||||
/// <summary>
|
||||
/// 创建人员ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="创建人员ID")]
|
||||
[Column("CreateUserId")]
|
||||
[DataMember]
|
||||
public string CreateUserId {get;set;}
|
||||
/// <summary>
|
||||
/// 创建人员姓名
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="创建人员姓名")]
|
||||
[Column("CreateUserName")]
|
||||
[DataMember]
|
||||
public string CreateUserName {get;set;}
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="创建时间")]
|
||||
[Column("CreateDate")]
|
||||
[DataMember]
|
||||
public DateTime CreateDate {get;set;}
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="修改时间")]
|
||||
[Column("EditDate")]
|
||||
[DataMember]
|
||||
public DateTime EditDate {get;set;}
|
||||
/// <summary>
|
||||
/// 表单HTML
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="表单HTML")]
|
||||
[Column("Html")]
|
||||
[DataMember]
|
||||
public string Html {get;set;}
|
||||
/// <summary>
|
||||
/// 子表json
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="子表json")]
|
||||
[Column("SubtableJSON")]
|
||||
[DataMember]
|
||||
public string SubtableJSON {get;set;}
|
||||
/// <summary>
|
||||
/// 事件json
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="事件json")]
|
||||
[Column("EventJSON")]
|
||||
[DataMember]
|
||||
public string EventJSON {get;set;}
|
||||
/// <summary>
|
||||
/// 属性json
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="属性json")]
|
||||
[Column("attribute")]
|
||||
[DataMember]
|
||||
public string attribute {get;set;}
|
||||
/// <summary>
|
||||
/// 状态:0 保存 1 编译 2作废
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="状态:0 保存 1 编译 2作废")]
|
||||
[Column("Status")]
|
||||
[DataMember]
|
||||
public int Status {get;set;}
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="备注")]
|
||||
[Column("Note")]
|
||||
[DataMember]
|
||||
public string Note {get;set;}
|
||||
/// <summary>
|
||||
/// 生成后的HTML
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="生成后的HTML")]
|
||||
[Column("RunHtml")]
|
||||
[DataMember]
|
||||
public string RunHtml {get;set;}
|
||||
/// <summary>
|
||||
/// 管理人员
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="管理人员")]
|
||||
[Column("ManageUser")]
|
||||
[DataMember]
|
||||
public string ManageUser {get;set;}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/// <summary>
|
||||
/// 数据表实体类Map:rf_form
|
||||
/// </summary>
|
||||
public class rf_formMap : EntityTypeConfiguration<rf_form>
|
||||
{
|
||||
public rf_formMap()
|
||||
{
|
||||
this.ToTable("rf_form");
|
||||
this.HasKey(t => t.Id);
|
||||
this.Property(t => t.Name).HasColumnName("Name").IsRequired();
|
||||
this.Property(t => t.FormType).HasColumnName("FormType").IsRequired();
|
||||
this.Property(t => t.CreateUserId).HasColumnName("CreateUserId").IsRequired();
|
||||
this.Property(t => t.CreateUserName).HasColumnName("CreateUserName").IsRequired();
|
||||
this.Property(t => t.CreateDate).HasColumnName("CreateDate").IsRequired();
|
||||
this.Property(t => t.EditDate).HasColumnName("EditDate").IsRequired();
|
||||
this.Property(t => t.Html).HasColumnName("Html");
|
||||
this.Property(t => t.SubtableJSON).HasColumnName("SubtableJSON");
|
||||
this.Property(t => t.EventJSON).HasColumnName("EventJSON");
|
||||
this.Property(t => t.attribute).HasColumnName("attribute");
|
||||
this.Property(t => t.Status).HasColumnName("Status").IsRequired();
|
||||
this.Property(t => t.Note).HasColumnName("Note");
|
||||
this.Property(t => t.RunHtml).HasColumnName("RunHtml");
|
||||
this.Property(t => t.ManageUser).HasColumnName("ManageUser");
|
||||
}
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
|
||||
//----------rf_form结束----------
|
||||
|
||||
|
||||
159
back_end_code/Ewide.RoadFlow/Entity/rf_log.cs
Normal file
159
back_end_code/Ewide.RoadFlow/Entity/rf_log.cs
Normal file
@@ -0,0 +1,159 @@
|
||||
//----------rf_log开始----------
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_log
|
||||
/// </summary>
|
||||
[Table("rf_log")]
|
||||
[Serializable]
|
||||
public partial class rf_log: BaseEntity {
|
||||
/// <summary>
|
||||
/// 标题
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="标题")]
|
||||
[Column("Title")]
|
||||
[DataMember]
|
||||
public string Title {get;set;}
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="类型")]
|
||||
[Column("Type")]
|
||||
[DataMember]
|
||||
public string Type {get;set;}
|
||||
/// <summary>
|
||||
/// 写入时间
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="写入时间")]
|
||||
[Column("WriteTime")]
|
||||
[DataMember]
|
||||
public DateTime WriteTime {get;set;}
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="用户ID")]
|
||||
[Column("UserId")]
|
||||
[DataMember]
|
||||
public string UserId {get;set;}
|
||||
/// <summary>
|
||||
/// 用户姓名
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="用户姓名")]
|
||||
[Column("UserName")]
|
||||
[DataMember]
|
||||
public string UserName {get;set;}
|
||||
/// <summary>
|
||||
/// IP
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="IP")]
|
||||
[Column("IPAddress")]
|
||||
[DataMember]
|
||||
public string IPAddress {get;set;}
|
||||
/// <summary>
|
||||
/// 来源URL
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="来源URL")]
|
||||
[Column("Referer")]
|
||||
[DataMember]
|
||||
public string Referer {get;set;}
|
||||
/// <summary>
|
||||
/// 发生URL
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="发生URL")]
|
||||
[Column("URL")]
|
||||
[DataMember]
|
||||
public string URL {get;set;}
|
||||
/// <summary>
|
||||
/// 内容
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="内容")]
|
||||
[Column("Contents")]
|
||||
[DataMember]
|
||||
public string Contents {get;set;}
|
||||
/// <summary>
|
||||
/// 其它
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="其它")]
|
||||
[Column("Others")]
|
||||
[DataMember]
|
||||
public string Others {get;set;}
|
||||
/// <summary>
|
||||
/// 更改后
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="更改后")]
|
||||
[Column("NewContents")]
|
||||
[DataMember]
|
||||
public string NewContents {get;set;}
|
||||
/// <summary>
|
||||
/// 更改前
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="更改前")]
|
||||
[Column("OldContents")]
|
||||
[DataMember]
|
||||
public string OldContents {get;set;}
|
||||
/// <summary>
|
||||
/// 浏览器信息
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="浏览器信息")]
|
||||
[Column("BrowseAgent")]
|
||||
[DataMember]
|
||||
public string BrowseAgent {get;set;}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/// <summary>
|
||||
/// 数据表实体类Map:rf_log
|
||||
/// </summary>
|
||||
public class rf_logMap : EntityTypeConfiguration<rf_log>
|
||||
{
|
||||
public rf_logMap()
|
||||
{
|
||||
this.ToTable("rf_log");
|
||||
this.HasKey(t => t.Id);
|
||||
this.Property(t => t.Title).HasColumnName("Title").IsRequired();
|
||||
this.Property(t => t.Type).HasColumnName("Type").IsRequired();
|
||||
this.Property(t => t.WriteTime).HasColumnName("WriteTime").IsRequired();
|
||||
this.Property(t => t.UserId).HasColumnName("UserId");
|
||||
this.Property(t => t.UserName).HasColumnName("UserName");
|
||||
this.Property(t => t.IPAddress).HasColumnName("IPAddress");
|
||||
this.Property(t => t.Referer).HasColumnName("Referer");
|
||||
this.Property(t => t.URL).HasColumnName("URL");
|
||||
this.Property(t => t.Contents).HasColumnName("Contents");
|
||||
this.Property(t => t.Others).HasColumnName("Others");
|
||||
this.Property(t => t.NewContents).HasColumnName("NewContents");
|
||||
this.Property(t => t.OldContents).HasColumnName("OldContents");
|
||||
this.Property(t => t.BrowseAgent).HasColumnName("BrowseAgent");
|
||||
}
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
|
||||
//----------rf_log结束----------
|
||||
|
||||
|
||||
123
back_end_code/Ewide.RoadFlow/Entity/rf_menu.cs
Normal file
123
back_end_code/Ewide.RoadFlow/Entity/rf_menu.cs
Normal file
@@ -0,0 +1,123 @@
|
||||
//----------rf_menu开始----------
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_menu
|
||||
/// </summary>
|
||||
[Table("rf_menu")]
|
||||
[Serializable]
|
||||
public partial class rf_menu: BaseEntity {
|
||||
/// <summary>
|
||||
/// 上级Id
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="上级Id")]
|
||||
[Column("ParentId")]
|
||||
[DataMember]
|
||||
public string ParentId {get;set;}
|
||||
/// <summary>
|
||||
/// 应用程序库Id
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="应用程序库Id")]
|
||||
[Column("AppLibraryId")]
|
||||
[DataMember]
|
||||
public string AppLibraryId {get;set;}
|
||||
/// <summary>
|
||||
/// 菜单名称
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="菜单名称")]
|
||||
[Column("Title")]
|
||||
[DataMember]
|
||||
public string Title {get;set;}
|
||||
/// <summary>
|
||||
/// URL参数
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="URL参数")]
|
||||
[Column("Params")]
|
||||
[DataMember]
|
||||
public string Params {get;set;}
|
||||
/// <summary>
|
||||
/// 图标
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="图标")]
|
||||
[Column("Ico")]
|
||||
[DataMember]
|
||||
public string Ico {get;set;}
|
||||
/// <summary>
|
||||
/// 图标颜色
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="图标颜色")]
|
||||
[Column("IcoColor")]
|
||||
[DataMember]
|
||||
public string IcoColor {get;set;}
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="排序")]
|
||||
[Column("Sort")]
|
||||
[DataMember]
|
||||
public int Sort {get;set;}
|
||||
/// <summary>
|
||||
/// 英文标题
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="英文标题")]
|
||||
[Column("Title_en")]
|
||||
[DataMember]
|
||||
public string Title_en {get;set;}
|
||||
/// <summary>
|
||||
/// 繁体中文标题
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="繁体中文标题")]
|
||||
[Column("Title_zh")]
|
||||
[DataMember]
|
||||
public string Title_zh {get;set;}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/// <summary>
|
||||
/// 数据表实体类Map:rf_menu
|
||||
/// </summary>
|
||||
public class rf_menuMap : EntityTypeConfiguration<rf_menu>
|
||||
{
|
||||
public rf_menuMap()
|
||||
{
|
||||
this.ToTable("rf_menu");
|
||||
this.HasKey(t => t.Id);
|
||||
this.Property(t => t.ParentId).HasColumnName("ParentId").IsRequired();
|
||||
this.Property(t => t.AppLibraryId).HasColumnName("AppLibraryId");
|
||||
this.Property(t => t.Title).HasColumnName("Title").IsRequired();
|
||||
this.Property(t => t.Params).HasColumnName("Params");
|
||||
this.Property(t => t.Ico).HasColumnName("Ico");
|
||||
this.Property(t => t.IcoColor).HasColumnName("IcoColor");
|
||||
this.Property(t => t.Sort).HasColumnName("Sort").IsRequired();
|
||||
this.Property(t => t.Title_en).HasColumnName("Title_en");
|
||||
this.Property(t => t.Title_zh).HasColumnName("Title_zh");
|
||||
}
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
|
||||
//----------rf_menu结束----------
|
||||
|
||||
|
||||
87
back_end_code/Ewide.RoadFlow/Entity/rf_menuuser.cs
Normal file
87
back_end_code/Ewide.RoadFlow/Entity/rf_menuuser.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
//----------rf_menuuser开始----------
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_menuuser
|
||||
/// </summary>
|
||||
[Table("rf_menuuser")]
|
||||
[Serializable]
|
||||
public partial class rf_menuuser: BaseEntity {
|
||||
/// <summary>
|
||||
/// 菜单ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="菜单ID")]
|
||||
[Column("MenuId")]
|
||||
[DataMember]
|
||||
public string MenuId {get;set;}
|
||||
/// <summary>
|
||||
/// 使用对象(组织机构ID)
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="使用对象(组织机构ID)")]
|
||||
[Column("Organizes")]
|
||||
[DataMember]
|
||||
public string Organizes {get;set;}
|
||||
/// <summary>
|
||||
/// 使用人员,人员ID
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="使用人员,人员ID")]
|
||||
[Column("Users")]
|
||||
[DataMember]
|
||||
public string Users {get;set;}
|
||||
/// <summary>
|
||||
/// 可使用的按钮
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="可使用的按钮")]
|
||||
[Column("Buttons")]
|
||||
[DataMember]
|
||||
public string Buttons {get;set;}
|
||||
/// <summary>
|
||||
/// 参数
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="参数")]
|
||||
[Column("Params")]
|
||||
[DataMember]
|
||||
public string Params {get;set;}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/// <summary>
|
||||
/// 数据表实体类Map:rf_menuuser
|
||||
/// </summary>
|
||||
public class rf_menuuserMap : EntityTypeConfiguration<rf_menuuser>
|
||||
{
|
||||
public rf_menuuserMap()
|
||||
{
|
||||
this.ToTable("rf_menuuser");
|
||||
this.HasKey(t => t.Id);
|
||||
this.Property(t => t.MenuId).HasColumnName("MenuId").IsRequired();
|
||||
this.Property(t => t.Organizes).HasColumnName("Organizes").IsRequired();
|
||||
this.Property(t => t.Users).HasColumnName("Users");
|
||||
this.Property(t => t.Buttons).HasColumnName("Buttons");
|
||||
this.Property(t => t.Params).HasColumnName("Params");
|
||||
}
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
|
||||
//----------rf_menuuser结束----------
|
||||
|
||||
|
||||
123
back_end_code/Ewide.RoadFlow/Entity/rf_message.cs
Normal file
123
back_end_code/Ewide.RoadFlow/Entity/rf_message.cs
Normal file
@@ -0,0 +1,123 @@
|
||||
//----------rf_message开始----------
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_message
|
||||
/// </summary>
|
||||
[Table("rf_message")]
|
||||
[Serializable]
|
||||
public partial class rf_message: BaseEntity {
|
||||
/// <summary>
|
||||
/// 消息内容
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="消息内容")]
|
||||
[Column("Contents")]
|
||||
[DataMember]
|
||||
public string Contents {get;set;}
|
||||
/// <summary>
|
||||
/// 发送方式 0站内消息 1手机短信 2微信
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="发送方式 0站内消息 1手机短信 2微信 ")]
|
||||
[Column("SendType")]
|
||||
[DataMember]
|
||||
public string SendType {get;set;}
|
||||
/// <summary>
|
||||
/// 是否是站内短信(把发送类型分开是为了提高查询效率)
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="是否是站内短信(把发送类型分开是为了提高查询效率)")]
|
||||
[Column("SiteMessage")]
|
||||
[DataMember]
|
||||
public int SiteMessage {get;set;}
|
||||
/// <summary>
|
||||
/// 发送人
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="发送人")]
|
||||
[Column("SenderId")]
|
||||
[DataMember]
|
||||
public string SenderId {get;set;}
|
||||
/// <summary>
|
||||
/// 发送人姓名
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="发送人姓名")]
|
||||
[Column("SenderName")]
|
||||
[DataMember]
|
||||
public string SenderName {get;set;}
|
||||
/// <summary>
|
||||
/// 接收人组织机构字符串
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="接收人组织机构字符串")]
|
||||
[Column("ReceiverIdString")]
|
||||
[DataMember]
|
||||
public string ReceiverIdString {get;set;}
|
||||
/// <summary>
|
||||
/// 发送时间
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="发送时间")]
|
||||
[Column("SendTime")]
|
||||
[DataMember]
|
||||
public DateTime SendTime {get;set;}
|
||||
/// <summary>
|
||||
/// 1:用户发送消息 2:系统消息
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="1:用户发送消息 2:系统消息")]
|
||||
[Column("Type")]
|
||||
[DataMember]
|
||||
public int Type {get;set;}
|
||||
/// <summary>
|
||||
/// 附件(用来保存消息连接地址)
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="附件(用来保存消息连接地址)")]
|
||||
[Column("Files")]
|
||||
[DataMember]
|
||||
public string Files {get;set;}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/// <summary>
|
||||
/// 数据表实体类Map:rf_message
|
||||
/// </summary>
|
||||
public class rf_messageMap : EntityTypeConfiguration<rf_message>
|
||||
{
|
||||
public rf_messageMap()
|
||||
{
|
||||
this.ToTable("rf_message");
|
||||
this.HasKey(t => t.Id);
|
||||
this.Property(t => t.Contents).HasColumnName("Contents").IsRequired();
|
||||
this.Property(t => t.SendType).HasColumnName("SendType").IsRequired();
|
||||
this.Property(t => t.SiteMessage).HasColumnName("SiteMessage").IsRequired();
|
||||
this.Property(t => t.SenderId).HasColumnName("SenderId");
|
||||
this.Property(t => t.SenderName).HasColumnName("SenderName");
|
||||
this.Property(t => t.ReceiverIdString).HasColumnName("ReceiverIdString").IsRequired();
|
||||
this.Property(t => t.SendTime).HasColumnName("SendTime").IsRequired();
|
||||
this.Property(t => t.Type).HasColumnName("Type").IsRequired();
|
||||
this.Property(t => t.Files).HasColumnName("Files");
|
||||
}
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
|
||||
//----------rf_message结束----------
|
||||
|
||||
|
||||
78
back_end_code/Ewide.RoadFlow/Entity/rf_messageuser.cs
Normal file
78
back_end_code/Ewide.RoadFlow/Entity/rf_messageuser.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
//----------rf_messageuser开始----------
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
//using System.Data.Entity.ModelConfiguration;
|
||||
using System.Runtime.Serialization;
|
||||
using Furion.JsonSerialization;
|
||||
namespace RoadFlow.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据表实体类:rf_messageuser
|
||||
/// </summary>
|
||||
[Table("rf_messageuser")]
|
||||
[Serializable]
|
||||
public partial class rf_messageuser: BaseEntity {
|
||||
/// <summary>
|
||||
/// 无描述
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="无描述")]
|
||||
[Column("MessageId")]
|
||||
[DataMember]
|
||||
public string MessageId {get;set;}
|
||||
/// <summary>
|
||||
/// 无描述
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="无描述")]
|
||||
[Key]
|
||||
[Column("UserId")]
|
||||
[DataMember]
|
||||
public string UserId {get;set;}
|
||||
/// <summary>
|
||||
/// 无描述
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="无描述")]
|
||||
[Column("IsRead")]
|
||||
[DataMember]
|
||||
public int IsRead {get;set;}
|
||||
/// <summary>
|
||||
/// 无描述
|
||||
/// </summary>
|
||||
|
||||
[Display(Name="无描述")]
|
||||
[Column("ReadTime")]
|
||||
[DataMember]
|
||||
public DateTime? ReadTime {get;set;}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JSON.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/// <summary>
|
||||
/// 数据表实体类Map:rf_messageuser
|
||||
/// </summary>
|
||||
public class rf_messageuserMap : EntityTypeConfiguration<rf_messageuser>
|
||||
{
|
||||
public rf_messageuserMap()
|
||||
{
|
||||
this.ToTable("rf_messageuser");
|
||||
this.Property(t => t.MessageId).HasColumnName("MessageId").IsRequired();
|
||||
this.HasKey(t => t.UserId);
|
||||
this.Property(t => t.IsRead).HasColumnName("IsRead").IsRequired();
|
||||
this.Property(t => t.ReadTime).HasColumnName("ReadTime");
|
||||
}
|
||||
}
|
||||
**/
|
||||
|
||||
}
|
||||
|
||||
//----------rf_messageuser结束----------
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user