|
|
@@ -1012,12 +1012,12 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
|
|
|
// 预先构建用户字典,提升查询性能
|
|
|
var userDict = users.ToDictionary(u => u.Id, u => u.CnName);
|
|
|
-
|
|
|
+ bool isNodeTemplSwitchable = true;
|
|
|
var processes = processData.Select(p =>
|
|
|
{
|
|
|
var orderedNodes = p.Nodes.OrderBy(n => n.NodeOrder).ToList();
|
|
|
var totalNodes = orderedNodes.Count;
|
|
|
-
|
|
|
+ isNodeTemplSwitchable = p.OverallStatus != ProcessStatus.Completed;
|
|
|
return new ConfProcessOverInfoView()
|
|
|
{
|
|
|
Id = p.Id,
|
|
|
@@ -1060,9 +1060,14 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
};
|
|
|
}).ToList();
|
|
|
|
|
|
- return new Result { Code = 200, Data = processes, Msg = "查询成功!" };
|
|
|
- }
|
|
|
+ var view = new ConfProcessOverInfo()
|
|
|
+ {
|
|
|
+ IsNodeTemplSwitchable = isNodeTemplSwitchable,
|
|
|
+ ConfProcess = processes
|
|
|
+ };
|
|
|
|
|
|
+ return new Result { Code = 200, Data = view, Msg = "查询成功!" };
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 更新节点模板
|
|
|
@@ -1096,6 +1101,13 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
.ToListAsync();
|
|
|
if (existingProcesses.Any())
|
|
|
{
|
|
|
+ //团组会流程完成 不可切换模板
|
|
|
+ if (existingProcesses.Where(x => x.OverallStatus == ProcessStatus.Completed).ToList().Count > 0)
|
|
|
+ {
|
|
|
+ _sqlSugar.RollbackTran();
|
|
|
+ return new Result { Code = 400, Msg = $"当前团组会务流程已完成,不可切换节点模板。" };
|
|
|
+ }
|
|
|
+
|
|
|
//删除 原有的节点模板
|
|
|
var parentIds = existingProcesses.Select(x => x.Id).ToList();
|
|
|
var updProcesses = await _sqlSugar.Updateable<Grp_ConfProcessOverview>()
|