routine update

This commit is contained in:
yubaolee 2024-12-13 09:48:07 +08:00
parent fdce44ec99
commit fb84a34b0e
4 changed files with 22 additions and 22 deletions
OpenAuth.App

View File

@ -43,7 +43,7 @@ namespace OpenAuth.App
get {
var moduleIds = SugarClient.Queryable<Relevance>().Where(
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();
return SugarClient.Queryable<ModuleView>().Where(m =>moduleIds.Contains(m.Id))
@ -70,7 +70,7 @@ namespace OpenAuth.App
{
var elementIds = SugarClient.Queryable<Relevance>().Where(
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;
}
@ -85,7 +85,7 @@ namespace OpenAuth.App
{
var resourceIds = SugarClient.Queryable<Relevance>().Where(
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();
}
}

View File

@ -38,7 +38,7 @@ namespace OpenAuth.App.Flow
InitLines(schemeContentJson);
InitNodes(schemeContentJson);
currentNodeId = (instance.ActivityId == "" ? startNodeId : instance.ActivityId);
currentNodeId = instance.ActivityId == "" ? startNodeId : instance.ActivityId;
currentNodeType = GetNodeType(currentNodeId);
FrmData = instance.FrmData;
title = schemeContentJson.title;
@ -134,7 +134,7 @@ namespace OpenAuth.App.Flow
foreach (var l in lines)
{
if (!(l.Compares.IsNullOrEmpty()) && l.Compare(frmDataJson))
if (!l.Compares.IsNullOrEmpty() && l.Compare(frmDataJson))
{
return l.to;
}

View File

@ -93,10 +93,10 @@ namespace OpenAuth.App
addFlowInstanceReq.CreateUserName = user.User.Account;
flowInstance.MakerList =
(wfruntime.GetNextNodeType() != 4 ? GetNextMakers(wfruntime, addFlowInstanceReq) : "");
flowInstance.IsFinish = (wfruntime.GetNextNodeType() == 4
wfruntime.GetNextNodeType() != 4 ? GetNextMakers(wfruntime, addFlowInstanceReq) : "";
flowInstance.IsFinish = wfruntime.GetNextNodeType() == 4
? FlowInstanceStatus.Finished
: FlowInstanceStatus.Running);
: FlowInstanceStatus.Running;
SugarClient.Ado.BeginTran();
@ -365,7 +365,7 @@ namespace OpenAuth.App
if (canCheckId == "")
{
throw (new Exception("审核异常,找不到审核节点"));
throw new Exception("审核异常,找不到审核节点");
}
var content =
@ -385,11 +385,11 @@ namespace OpenAuth.App
flowInstance.ActivityId = wfruntime.nextNodeId;
flowInstance.ActivityType = wfruntime.nextNodeType;
flowInstance.ActivityName = wfruntime.nextNode.name;
flowInstance.IsFinish = (wfruntime.nextNodeType == 4
flowInstance.IsFinish = wfruntime.nextNodeType == 4
? FlowInstanceStatus.Finished
: FlowInstanceStatus.Running);
: FlowInstanceStatus.Running;
flowInstance.MakerList =
(wfruntime.nextNodeType == 4 ? "" : GetNextMakers(wfruntime));
wfruntime.nextNodeType == 4 ? "" : GetNextMakers(wfruntime);
AddTransHistory(wfruntime);
}
@ -486,9 +486,9 @@ namespace OpenAuth.App
flowInstance.ActivityType = wfruntime.nextNodeType;
flowInstance.ActivityName = wfruntime.nextNode.name;
flowInstance.MakerList = wfruntime.nextNodeType == 4 ? "" : GetNextMakers(wfruntime, request);
flowInstance.IsFinish = (wfruntime.nextNodeType == 4
flowInstance.IsFinish = wfruntime.nextNodeType == 4
? FlowInstanceStatus.Finished
: FlowInstanceStatus.Running);
: FlowInstanceStatus.Running;
}
}
else //审批结果为不同意
@ -638,7 +638,7 @@ namespace OpenAuth.App
string makerList = "";
if (wfruntime.nextNodeId == "-1")
{
throw (new Exception("无法寻找到下一个节点"));
throw new Exception("无法寻找到下一个节点");
}
if (wfruntime.nextNodeType == 0) //如果是会签节点
@ -703,7 +703,7 @@ namespace OpenAuth.App
makerList = GetNodeMarkers(wfruntime.nextNode);
if (string.IsNullOrEmpty(makerList))
{
throw (new Exception("无法寻找到节点的审核者,请查看流程设计是否有问题!"));
throw new Exception("无法寻找到节点的审核者,请查看流程设计是否有问题!");
}
}
@ -753,12 +753,12 @@ namespace OpenAuth.App
var marker = GetNodeMarkers(node);
if (marker == "")
{
throw (new Exception($"节点{node.name}没有审核者,请检查!"));
throw new Exception($"节点{node.name}没有审核者,请检查!");
}
if (marker == "1")
{
throw (new Exception($"节点{node.name}是会签节点,不能用所有人,请检查!"));
throw new Exception($"节点{node.name}是会签节点,不能用所有人,请检查!");
}
if (markers != "")
@ -1089,10 +1089,10 @@ namespace OpenAuth.App
flowInstance.PreviousId = wfruntime.currentNodeId;
flowInstance.CreateUserId = user.User.Id;
flowInstance.CreateUserName = user.User.Account;
flowInstance.MakerList = (wfruntime.GetNextNodeType() != 4 ? GetNextMakers(wfruntime) : "");
flowInstance.IsFinish = (wfruntime.GetNextNodeType() == 4
flowInstance.MakerList = wfruntime.GetNextNodeType() != 4 ? GetNextMakers(wfruntime) : "";
flowInstance.IsFinish = wfruntime.GetNextNodeType() == 4
? FlowInstanceStatus.Finished
: FlowInstanceStatus.Running);
: FlowInstanceStatus.Running;
SugarClient.Updateable(flowInstance).ExecuteCommand();

View File

@ -58,7 +58,7 @@ namespace OpenAuth.App.SSO
{
if (_appConfiguration.Value.IsIdentityAuth)
{
return (!string.IsNullOrEmpty(_httpContextAccessor.HttpContext.User.Identity.Name));
return !string.IsNullOrEmpty(_httpContextAccessor.HttpContext.User.Identity.Name);
}
if (string.IsNullOrEmpty(token))