|
@@ -2171,7 +2171,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
public async Task<Result> SetNodeInfoAsync(ConfProcessSetActualDoneDto dto)
|
|
public async Task<Result> SetNodeInfoAsync(ConfProcessSetActualDoneDto dto)
|
|
|
{
|
|
{
|
|
|
//参与人验证
|
|
//参与人验证
|
|
|
- if (dto.Participators?.Any() != true) throw new BusinessException("参与人不能为空。");
|
|
|
|
|
|
|
+ if (dto.Participators?.Any() != true) return new Result { Code = 400, Msg = "参与人不能为空。" };
|
|
|
|
|
|
|
|
var isDtNul = DateTime.TryParse(dto.ActualDone, out DateTime actualDone);
|
|
var isDtNul = DateTime.TryParse(dto.ActualDone, out DateTime actualDone);
|
|
|
|
|
|
|
@@ -2183,18 +2183,17 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
|
|
// 1. 获取并验证节点和流程
|
|
// 1. 获取并验证节点和流程
|
|
|
var node = await _sqlSugar.Queryable<Grp_ConfProcessNode>()
|
|
var node = await _sqlSugar.Queryable<Grp_ConfProcessNode>()
|
|
|
- .FirstAsync(n => n.Id == nodeId && n.IsDel == 0)
|
|
|
|
|
- ?? throw new BusinessException("当前节点不存在或已被删除。");
|
|
|
|
|
|
|
+ .FirstAsync(n => n.Id == nodeId && n.IsDel == 0);
|
|
|
|
|
+
|
|
|
|
|
+ if (node == null) return new Result { Code = 400, Msg = "当前节点不存在或已被删除。" };
|
|
|
|
|
|
|
|
// 1.2. 用户权限验证
|
|
// 1.2. 用户权限验证
|
|
|
- if (!HasConfNodeOperationPermission(node, currUserId))
|
|
|
|
|
- {
|
|
|
|
|
- throw new BusinessException("当前用户没有操作此节点的权限。");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (!HasConfNodeOperationPermission(node, currUserId)) return new Result { Code = 400, Msg = "当前用户没有操作此节点的权限。" };
|
|
|
|
|
|
|
|
var process = await _sqlSugar.Queryable<Grp_ConfProcessOverview>()
|
|
var process = await _sqlSugar.Queryable<Grp_ConfProcessOverview>()
|
|
|
- .FirstAsync(p => p.Id == node.ProcessId && p.IsDel == 0)
|
|
|
|
|
- ?? throw new BusinessException("当前流程不存在或已被删除。");
|
|
|
|
|
|
|
+ .FirstAsync(p => p.Id == node.ProcessId && p.IsDel == 0);
|
|
|
|
|
+
|
|
|
|
|
+ if (process == null) return new Result { Code = 400, Msg = "当前流程不存在或已被删除。" };
|
|
|
|
|
|
|
|
// 2.1 存储更新前流程及节点信息
|
|
// 2.1 存储更新前流程及节点信息
|
|
|
var nodeBefore = CloneConfNode(node);
|
|
var nodeBefore = CloneConfNode(node);
|
|
@@ -2236,7 +2235,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return new Result { Code = 200, Msg = "实际操作时间设置成功。" };
|
|
|
|
|
|
|
+ return new Result { Code = 200, Msg = "设置成功。" };
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
#endregion
|