diff --git a/OpenAuth.App/AuthStrategies/NormalAuthStrategy.cs b/OpenAuth.App/AuthStrategies/NormalAuthStrategy.cs index 9fd04ba5..899144e5 100644 --- a/OpenAuth.App/AuthStrategies/NormalAuthStrategy.cs +++ b/OpenAuth.App/AuthStrategies/NormalAuthStrategy.cs @@ -43,7 +43,7 @@ namespace OpenAuth.App get { var moduleIds = SugarClient.Queryable().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().Where(m =>moduleIds.Contains(m.Id)) @@ -70,7 +70,7 @@ namespace OpenAuth.App { var elementIds = SugarClient.Queryable().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().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().Where(u => resourceIds.Contains(u.Id)).ToList(); } } diff --git a/OpenAuth.App/Flow/FlowRuntime.cs b/OpenAuth.App/Flow/FlowRuntime.cs index 207d0353..53dee5e9 100644 --- a/OpenAuth.App/Flow/FlowRuntime.cs +++ b/OpenAuth.App/Flow/FlowRuntime.cs @@ -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; } diff --git a/OpenAuth.App/FlowInstance/FlowInstanceApp.cs b/OpenAuth.App/FlowInstance/FlowInstanceApp.cs index 6acba715..8a1d11f9 100644 --- a/OpenAuth.App/FlowInstance/FlowInstanceApp.cs +++ b/OpenAuth.App/FlowInstance/FlowInstanceApp.cs @@ -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(); diff --git a/OpenAuth.App/SSO/LocalAuth.cs b/OpenAuth.App/SSO/LocalAuth.cs index d532191a..fb604ef5 100644 --- a/OpenAuth.App/SSO/LocalAuth.cs +++ b/OpenAuth.App/SSO/LocalAuth.cs @@ -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))