mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-04-05 17:38:01 +08:00
routine update
This commit is contained in:
parent
fdce44ec99
commit
fb84a34b0e
@ -43,7 +43,7 @@ namespace OpenAuth.App
|
|||||||
get {
|
get {
|
||||||
var moduleIds = SugarClient.Queryable<Relevance>().Where(
|
var moduleIds = SugarClient.Queryable<Relevance>().Where(
|
||||||
u =>
|
u =>
|
||||||
(u.Key == Define.ROLEMODULE && _userRoleIds.Contains(u.FirstId))).Select(u => u.SecondId).ToList();
|
u.Key == Define.ROLEMODULE && _userRoleIds.Contains(u.FirstId)).Select(u => u.SecondId).ToList();
|
||||||
var elementIds = GetElementIds();
|
var elementIds = GetElementIds();
|
||||||
|
|
||||||
return SugarClient.Queryable<ModuleView>().Where(m =>moduleIds.Contains(m.Id))
|
return SugarClient.Queryable<ModuleView>().Where(m =>moduleIds.Contains(m.Id))
|
||||||
@ -70,7 +70,7 @@ namespace OpenAuth.App
|
|||||||
{
|
{
|
||||||
var elementIds = SugarClient.Queryable<Relevance>().Where(
|
var elementIds = SugarClient.Queryable<Relevance>().Where(
|
||||||
u =>
|
u =>
|
||||||
(u.Key == Define.ROLEELEMENT && _userRoleIds.Contains(u.FirstId))).Select(u => u.SecondId).ToList();
|
u.Key == Define.ROLEELEMENT && _userRoleIds.Contains(u.FirstId)).Select(u => u.SecondId).ToList();
|
||||||
return elementIds;
|
return elementIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ namespace OpenAuth.App
|
|||||||
{
|
{
|
||||||
var resourceIds = SugarClient.Queryable<Relevance>().Where(
|
var resourceIds = SugarClient.Queryable<Relevance>().Where(
|
||||||
u =>
|
u =>
|
||||||
(u.Key == Define.ROLERESOURCE && _userRoleIds.Contains(u.FirstId))).Select(u => u.SecondId).ToList();
|
u.Key == Define.ROLERESOURCE && _userRoleIds.Contains(u.FirstId)).Select(u => u.SecondId).ToList();
|
||||||
return SugarClient.Queryable<Resource>().Where(u => resourceIds.Contains(u.Id)).ToList();
|
return SugarClient.Queryable<Resource>().Where(u => resourceIds.Contains(u.Id)).ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ namespace OpenAuth.App.Flow
|
|||||||
InitLines(schemeContentJson);
|
InitLines(schemeContentJson);
|
||||||
InitNodes(schemeContentJson);
|
InitNodes(schemeContentJson);
|
||||||
|
|
||||||
currentNodeId = (instance.ActivityId == "" ? startNodeId : instance.ActivityId);
|
currentNodeId = instance.ActivityId == "" ? startNodeId : instance.ActivityId;
|
||||||
currentNodeType = GetNodeType(currentNodeId);
|
currentNodeType = GetNodeType(currentNodeId);
|
||||||
FrmData = instance.FrmData;
|
FrmData = instance.FrmData;
|
||||||
title = schemeContentJson.title;
|
title = schemeContentJson.title;
|
||||||
@ -134,7 +134,7 @@ namespace OpenAuth.App.Flow
|
|||||||
|
|
||||||
foreach (var l in lines)
|
foreach (var l in lines)
|
||||||
{
|
{
|
||||||
if (!(l.Compares.IsNullOrEmpty()) && l.Compare(frmDataJson))
|
if (!l.Compares.IsNullOrEmpty() && l.Compare(frmDataJson))
|
||||||
{
|
{
|
||||||
return l.to;
|
return l.to;
|
||||||
}
|
}
|
||||||
|
@ -93,10 +93,10 @@ namespace OpenAuth.App
|
|||||||
addFlowInstanceReq.CreateUserName = user.User.Account;
|
addFlowInstanceReq.CreateUserName = user.User.Account;
|
||||||
|
|
||||||
flowInstance.MakerList =
|
flowInstance.MakerList =
|
||||||
(wfruntime.GetNextNodeType() != 4 ? GetNextMakers(wfruntime, addFlowInstanceReq) : "");
|
wfruntime.GetNextNodeType() != 4 ? GetNextMakers(wfruntime, addFlowInstanceReq) : "";
|
||||||
flowInstance.IsFinish = (wfruntime.GetNextNodeType() == 4
|
flowInstance.IsFinish = wfruntime.GetNextNodeType() == 4
|
||||||
? FlowInstanceStatus.Finished
|
? FlowInstanceStatus.Finished
|
||||||
: FlowInstanceStatus.Running);
|
: FlowInstanceStatus.Running;
|
||||||
|
|
||||||
|
|
||||||
SugarClient.Ado.BeginTran();
|
SugarClient.Ado.BeginTran();
|
||||||
@ -365,7 +365,7 @@ namespace OpenAuth.App
|
|||||||
|
|
||||||
if (canCheckId == "")
|
if (canCheckId == "")
|
||||||
{
|
{
|
||||||
throw (new Exception("审核异常,找不到审核节点"));
|
throw new Exception("审核异常,找不到审核节点");
|
||||||
}
|
}
|
||||||
|
|
||||||
var content =
|
var content =
|
||||||
@ -385,11 +385,11 @@ namespace OpenAuth.App
|
|||||||
flowInstance.ActivityId = wfruntime.nextNodeId;
|
flowInstance.ActivityId = wfruntime.nextNodeId;
|
||||||
flowInstance.ActivityType = wfruntime.nextNodeType;
|
flowInstance.ActivityType = wfruntime.nextNodeType;
|
||||||
flowInstance.ActivityName = wfruntime.nextNode.name;
|
flowInstance.ActivityName = wfruntime.nextNode.name;
|
||||||
flowInstance.IsFinish = (wfruntime.nextNodeType == 4
|
flowInstance.IsFinish = wfruntime.nextNodeType == 4
|
||||||
? FlowInstanceStatus.Finished
|
? FlowInstanceStatus.Finished
|
||||||
: FlowInstanceStatus.Running);
|
: FlowInstanceStatus.Running;
|
||||||
flowInstance.MakerList =
|
flowInstance.MakerList =
|
||||||
(wfruntime.nextNodeType == 4 ? "" : GetNextMakers(wfruntime));
|
wfruntime.nextNodeType == 4 ? "" : GetNextMakers(wfruntime);
|
||||||
|
|
||||||
AddTransHistory(wfruntime);
|
AddTransHistory(wfruntime);
|
||||||
}
|
}
|
||||||
@ -486,9 +486,9 @@ namespace OpenAuth.App
|
|||||||
flowInstance.ActivityType = wfruntime.nextNodeType;
|
flowInstance.ActivityType = wfruntime.nextNodeType;
|
||||||
flowInstance.ActivityName = wfruntime.nextNode.name;
|
flowInstance.ActivityName = wfruntime.nextNode.name;
|
||||||
flowInstance.MakerList = wfruntime.nextNodeType == 4 ? "" : GetNextMakers(wfruntime, request);
|
flowInstance.MakerList = wfruntime.nextNodeType == 4 ? "" : GetNextMakers(wfruntime, request);
|
||||||
flowInstance.IsFinish = (wfruntime.nextNodeType == 4
|
flowInstance.IsFinish = wfruntime.nextNodeType == 4
|
||||||
? FlowInstanceStatus.Finished
|
? FlowInstanceStatus.Finished
|
||||||
: FlowInstanceStatus.Running);
|
: FlowInstanceStatus.Running;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else //审批结果为不同意
|
else //审批结果为不同意
|
||||||
@ -638,7 +638,7 @@ namespace OpenAuth.App
|
|||||||
string makerList = "";
|
string makerList = "";
|
||||||
if (wfruntime.nextNodeId == "-1")
|
if (wfruntime.nextNodeId == "-1")
|
||||||
{
|
{
|
||||||
throw (new Exception("无法寻找到下一个节点"));
|
throw new Exception("无法寻找到下一个节点");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wfruntime.nextNodeType == 0) //如果是会签节点
|
if (wfruntime.nextNodeType == 0) //如果是会签节点
|
||||||
@ -703,7 +703,7 @@ namespace OpenAuth.App
|
|||||||
makerList = GetNodeMarkers(wfruntime.nextNode);
|
makerList = GetNodeMarkers(wfruntime.nextNode);
|
||||||
if (string.IsNullOrEmpty(makerList))
|
if (string.IsNullOrEmpty(makerList))
|
||||||
{
|
{
|
||||||
throw (new Exception("无法寻找到节点的审核者,请查看流程设计是否有问题!"));
|
throw new Exception("无法寻找到节点的审核者,请查看流程设计是否有问题!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -753,12 +753,12 @@ namespace OpenAuth.App
|
|||||||
var marker = GetNodeMarkers(node);
|
var marker = GetNodeMarkers(node);
|
||||||
if (marker == "")
|
if (marker == "")
|
||||||
{
|
{
|
||||||
throw (new Exception($"节点{node.name}没有审核者,请检查!"));
|
throw new Exception($"节点{node.name}没有审核者,请检查!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (marker == "1")
|
if (marker == "1")
|
||||||
{
|
{
|
||||||
throw (new Exception($"节点{node.name}是会签节点,不能用所有人,请检查!"));
|
throw new Exception($"节点{node.name}是会签节点,不能用所有人,请检查!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (markers != "")
|
if (markers != "")
|
||||||
@ -1089,10 +1089,10 @@ namespace OpenAuth.App
|
|||||||
flowInstance.PreviousId = wfruntime.currentNodeId;
|
flowInstance.PreviousId = wfruntime.currentNodeId;
|
||||||
flowInstance.CreateUserId = user.User.Id;
|
flowInstance.CreateUserId = user.User.Id;
|
||||||
flowInstance.CreateUserName = user.User.Account;
|
flowInstance.CreateUserName = user.User.Account;
|
||||||
flowInstance.MakerList = (wfruntime.GetNextNodeType() != 4 ? GetNextMakers(wfruntime) : "");
|
flowInstance.MakerList = wfruntime.GetNextNodeType() != 4 ? GetNextMakers(wfruntime) : "";
|
||||||
flowInstance.IsFinish = (wfruntime.GetNextNodeType() == 4
|
flowInstance.IsFinish = wfruntime.GetNextNodeType() == 4
|
||||||
? FlowInstanceStatus.Finished
|
? FlowInstanceStatus.Finished
|
||||||
: FlowInstanceStatus.Running);
|
: FlowInstanceStatus.Running;
|
||||||
|
|
||||||
SugarClient.Updateable(flowInstance).ExecuteCommand();
|
SugarClient.Updateable(flowInstance).ExecuteCommand();
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ namespace OpenAuth.App.SSO
|
|||||||
{
|
{
|
||||||
if (_appConfiguration.Value.IsIdentityAuth)
|
if (_appConfiguration.Value.IsIdentityAuth)
|
||||||
{
|
{
|
||||||
return (!string.IsNullOrEmpty(_httpContextAccessor.HttpContext.User.Identity.Name));
|
return !string.IsNullOrEmpty(_httpContextAccessor.HttpContext.User.Identity.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(token))
|
if (string.IsNullOrEmpty(token))
|
||||||
|
Loading…
Reference in New Issue
Block a user