mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-16 16:50:54 +08:00
fix #IAGT6Z 增加知会功能
This commit is contained in:
parent
3484c3468a
commit
bbc55bb53b
@ -1,36 +1,42 @@
|
|||||||
namespace Infrastructure
|
namespace Infrastructure
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 常量定义
|
||||||
|
/// </summary>
|
||||||
public static class Define
|
public static class Define
|
||||||
{
|
{
|
||||||
public static string USERROLE = "UserRole"; //用户角色关联KEY
|
public static string USERROLE = "UserRole"; //用户角色关联KEY
|
||||||
public const string ROLERESOURCE = "RoleResource"; //角色资源关联KEY
|
public const string ROLERESOURCE = "RoleResource"; //角色资源关联KEY
|
||||||
public const string USERORG = "UserOrg"; //用户机构关联KEY
|
public const string USERORG = "UserOrg"; //用户机构关联KEY
|
||||||
public const string ROLEELEMENT = "RoleElement"; //角色菜单关联KEY
|
public const string ROLEELEMENT = "RoleElement"; //角色菜单关联KEY
|
||||||
public const string ROLEMODULE = "RoleModule"; //角色模块关联KEY
|
public const string ROLEMODULE = "RoleModule"; //角色模块关联KEY
|
||||||
public const string ROLEDATAPROPERTY = "RoleDataProperty"; //角色数据字段权限
|
public const string ROLEDATAPROPERTY = "RoleDataProperty"; //角色数据字段权限
|
||||||
public const string MODULEPRINTERPLAN = "ModulePrinterPlan"; //模块配置打印方案
|
public const string MODULEPRINTERPLAN = "ModulePrinterPlan"; //模块配置打印方案
|
||||||
|
|
||||||
public const string DBTYPE_SQLSERVER = "SqlServer"; //sql server
|
public const string DBTYPE_SQLSERVER = "SqlServer"; //sql server
|
||||||
public const string DBTYPE_MYSQL = "MySql"; //mysql
|
public const string DBTYPE_MYSQL = "MySql"; //mysql
|
||||||
public const string DBTYPE_PostgreSQL = "PostgreSQL"; //PostgreSQL
|
public const string DBTYPE_PostgreSQL = "PostgreSQL"; //PostgreSQL
|
||||||
public const string DBTYPE_ORACLE = "Oracle"; //oracle
|
public const string DBTYPE_ORACLE = "Oracle"; //oracle
|
||||||
|
|
||||||
|
public const int INVALID_TOKEN = 50014; //token无效
|
||||||
public const int INVALID_TOKEN = 50014; //token无效
|
|
||||||
|
|
||||||
public const string TOKEN_NAME = "X-Token";
|
public const string TOKEN_NAME = "X-Token";
|
||||||
public const string TENANT_ID = "tenantId";
|
public const string TENANT_ID = "tenantId";
|
||||||
|
|
||||||
|
|
||||||
public const string SYSTEM_USERNAME = "System";
|
public const string SYSTEM_USERNAME = "System";
|
||||||
public const string SYSTEM_USERPWD = "123456";
|
public const string SYSTEM_USERPWD = "123456";
|
||||||
|
|
||||||
public const string DATAPRIVILEGE_LOGINUSER = "{loginUser}"; //数据权限配置中,当前登录用户的key
|
public const string DATAPRIVILEGE_LOGINUSER = "{loginUser}"; //数据权限配置中,当前登录用户的key
|
||||||
public const string DATAPRIVILEGE_LOGINROLE = "{loginRole}"; //数据权限配置中,当前登录用户角色的key
|
public const string DATAPRIVILEGE_LOGINROLE = "{loginRole}"; //数据权限配置中,当前登录用户角色的key
|
||||||
public const string DATAPRIVILEGE_LOGINORG = "{loginOrg}"; //数据权限配置中,当前登录用户部门的key
|
public const string DATAPRIVILEGE_LOGINORG = "{loginOrg}"; //数据权限配置中,当前登录用户部门的key
|
||||||
|
|
||||||
public const string JOBMAPKEY = "OpenJob";
|
public const string JOBMAPKEY = "OpenJob";
|
||||||
|
|
||||||
public const string DEFAULT_FORM_INSTANCE_ID_NAME = "InstanceId";
|
public const string DEFAULT_FORM_INSTANCE_ID_NAME = "InstanceId";
|
||||||
|
|
||||||
|
//流程实例知会用户
|
||||||
|
public const string INSTANCE_NOTICE_USER = "INSTANCE_NOTICE_USER";
|
||||||
|
//流程实例知会角色
|
||||||
|
public const string INSTANCE_NOTICE_ROLE = "INSTANCE_NOTICE_ROLE";
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -104,6 +104,17 @@ namespace OpenAuth.App
|
|||||||
SugarClient.Insertable(flowInstance).ExecuteCommand();
|
SugarClient.Insertable(flowInstance).ExecuteCommand();
|
||||||
wfruntime.flowInstanceId = flowInstance.Id;
|
wfruntime.flowInstanceId = flowInstance.Id;
|
||||||
|
|
||||||
|
//知会
|
||||||
|
if (addFlowInstanceReq.NoticeType.IsNullOrEmpty() && addFlowInstanceReq.NoticeIds != null)
|
||||||
|
{
|
||||||
|
_revelanceApp.Assign(new AssignReq
|
||||||
|
{
|
||||||
|
type = addFlowInstanceReq.NoticeType,
|
||||||
|
firstId = flowInstance.Id,
|
||||||
|
secIds = addFlowInstanceReq.NoticeIds.ToArray()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (flowInstance.FrmType == 1) //如果是开发者自定义的表单
|
if (flowInstance.FrmType == 1) //如果是开发者自定义的表单
|
||||||
{
|
{
|
||||||
var t = Type.GetType("OpenAuth.App." + flowInstance.DbName + "App");
|
var t = Type.GetType("OpenAuth.App." + flowInstance.DbName + "App");
|
||||||
@ -903,16 +914,43 @@ namespace OpenAuth.App
|
|||||||
.ToPageListAsync(request.page, request.limit);
|
.ToPageListAsync(request.page, request.limit);
|
||||||
result.count = await finalQuery.CountAsync();
|
result.count = await finalQuery.CountAsync();
|
||||||
}
|
}
|
||||||
else //我的流程
|
else //我的流程(包含知会我的)
|
||||||
{
|
{
|
||||||
var query = SugarClient.Queryable<FlowInstance>().Where(u => u.CreateUserId == user.User.Id);
|
var sql = $@"
|
||||||
if (!string.IsNullOrEmpty(request.key))
|
SELECT fi.*
|
||||||
|
FROM FlowInstance fi
|
||||||
|
JOIN (select Id as InstanceId
|
||||||
|
from FlowInstance
|
||||||
|
where CreateUserId = '{user.User.Id}'
|
||||||
|
union
|
||||||
|
select FirstId as InstanceId
|
||||||
|
from Relevance
|
||||||
|
where `Key` = '{Define.INSTANCE_NOTICE_USER}'
|
||||||
|
and SecondId = '{user.User.Id}'
|
||||||
|
union
|
||||||
|
select a.FirstId as InstanceId
|
||||||
|
from Relevance a
|
||||||
|
inner join (select SecondId as RoleId
|
||||||
|
from Relevance
|
||||||
|
where `Key` = '{Define.USERROLE}'
|
||||||
|
and FirstId = '{user.User.Id}') b on a.SecondId = b.RoleId
|
||||||
|
where a.`Key` = '{Define.INSTANCE_NOTICE_ROLE}') AS UniqueInstanceIds
|
||||||
|
ON fi.Id = UniqueInstanceIds.InstanceId
|
||||||
|
";
|
||||||
|
|
||||||
|
if (SugarClient.CurrentConnectionConfig.DbType == DbType.SqlServer)
|
||||||
{
|
{
|
||||||
query = query.Where(t => t.CustomName.Contains(request.key));
|
sql = sql.Replace("`Key`", "[Key]");
|
||||||
|
}else if (SugarClient.CurrentConnectionConfig.DbType == DbType.Oracle)
|
||||||
|
{
|
||||||
|
sql = sql.Replace("`Key`", "\"Key\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
result.count = await query.CountAsync();
|
var finalQuery = SugarClient.SqlQueryable<FlowInstance>(sql)
|
||||||
result.data = await query.OrderByDescending(u => u.CreateDate)
|
.WhereIF(!string.IsNullOrEmpty(request.key), t => t.CustomName.Contains(request.key));
|
||||||
|
|
||||||
|
result.count = await finalQuery.CountAsync();
|
||||||
|
result.data = await finalQuery.OrderByDescending(u => u.CreateDate)
|
||||||
.ToPageListAsync(request.page, request.limit);
|
.ToPageListAsync(request.page, request.limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,37 +8,37 @@
|
|||||||
// </autogenerated>
|
// </autogenerated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
|
||||||
namespace OpenAuth.App.Request
|
namespace OpenAuth.App.Request
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建工作流请求
|
/// 创建工作流请求
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class AddFlowInstanceReq : NodeDesignateReq
|
public class AddFlowInstanceReq : NodeDesignateReq
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 实例编号
|
||||||
|
/// </summary>
|
||||||
|
[Description("实例编号")]
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 实例编号
|
/// 自定义名称
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("实例编号")]
|
[Description("自定义名称")]
|
||||||
public string Code { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 自定义名称
|
|
||||||
/// </summary>
|
|
||||||
[Description("自定义名称")]
|
|
||||||
public string CustomName { get; set; }
|
public string CustomName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 流程模板内容
|
/// 流程模板内容
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("流程模板内容")]
|
[Description("流程模板内容")]
|
||||||
public string SchemeContent { get; set; }
|
public string SchemeContent { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 流程模板ID
|
/// 流程模板ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string SchemeId { get; set; }
|
public string SchemeId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -46,39 +46,42 @@ namespace OpenAuth.App.Request
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string SchemeCode { get; set; }
|
public string SchemeCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据库名称
|
||||||
|
/// </summary>
|
||||||
|
[Description("数据库名称")]
|
||||||
|
public string DbName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据库名称
|
/// 表单数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("数据库名称")]
|
[Description("表单数据")]
|
||||||
public string DbName { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 表单数据
|
|
||||||
/// </summary>
|
|
||||||
[Description("表单数据")]
|
|
||||||
public string FrmData { get; set; }
|
public string FrmData { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 表单类型
|
/// 表单类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("表单类型")]
|
[Description("表单类型")]
|
||||||
public int FrmType { get; set; }
|
public int FrmType { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 表单中的控件属性描述
|
/// 表单中的控件属性描述
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("表单中的控件属性描述")]
|
[Description("表单中的控件属性描述")]
|
||||||
public string FrmContentData { get; set; }
|
public string FrmContentData { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 表单控件位置模板
|
/// 表单控件位置模板
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("表单控件位置模板")]
|
[Description("表单控件位置模板")]
|
||||||
public string FrmContentParse { get; set; }
|
public string FrmContentParse { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 表单ID
|
/// 表单ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("表单ID")]
|
[Description("表单ID")]
|
||||||
public string FrmId { get; set; }
|
public string FrmId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 所属部门
|
/// 所属部门
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -86,21 +89,35 @@ namespace OpenAuth.App.Request
|
|||||||
public string OrgId { get; set; }
|
public string OrgId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建用户主键
|
/// 创建用户主键
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("创建用户主键")]
|
[Description("创建用户主键")]
|
||||||
public string CreateUserId { get; set; }
|
public string CreateUserId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 创建用户
|
/// 创建用户
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("创建用户")]
|
[Description("创建用户")]
|
||||||
public string CreateUserName { get; set; }
|
public string CreateUserName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 实例备注
|
/// 实例备注
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("实例备注")]
|
[Description("实例备注")]
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 知会类型
|
||||||
|
/// INSTANCE_NOTICE_USER :知会具体用户
|
||||||
|
/// INSTANCE_NOTICE_ROLE :知会角色
|
||||||
|
/// </summary>
|
||||||
|
[Description("知会类型")]
|
||||||
|
public string NoticeType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 知会的用户或角色ID列表
|
||||||
|
/// </summary>
|
||||||
|
[Description("知会的用户或角色ID列表")]
|
||||||
|
public List<string> NoticeIds { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user