|
|
@@ -39,7 +39,7 @@ namespace WorkFlowApi.Business.Scheme
|
|
39
|
39
|
/// <param name="level">流程等级</param>
|
|
40
|
40
|
/// <param name="auditors">下一节点审核人</param>
|
|
41
|
41
|
/// <param name="userInfo">当前操作人信息</param>
|
|
42
|
|
- public void CreateFlow(string schemeCode, string processId, string title, int level, string auditors, T_Sys_UserAccount userInfo, out List<T_WF_TaskView> t_WF_TaskViews)
|
|
|
42
|
+ public void CreateFlow(string schemeCode, string processId, string title, int level,string branchnodeCode, T_Sys_UserAccount userInfo, out List<T_WF_TaskView> t_WF_TaskViews, List<WFAuditor> auditors = null )
|
|
43
|
43
|
{
|
|
44
|
44
|
|
|
45
|
45
|
// 初始化流程引擎
|
|
|
@@ -50,11 +50,11 @@ namespace WorkFlowApi.Business.Scheme
|
|
50
|
50
|
WFNodeInfo nodeInfo = nWFIEngine.GetStartNode();
|
|
51
|
51
|
// 获取下一节点信息
|
|
52
|
52
|
List<WFLineInfo> lineList = new List<WFLineInfo>();
|
|
53
|
|
- List<WFNodeInfo> list = nWFIEngine.GetNextTaskNode(nodeInfo, "agree", false, lineList);
|
|
|
53
|
+ List<WFNodeInfo> list = nWFIEngine.GetNextTaskNode(nodeInfo, "agree", false, lineList, branchnodeCode);
|
|
54
|
54
|
|
|
55
|
|
-
|
|
|
55
|
+ string codelist = nWFIEngine.GetButonList(list.FirstOrDefault().id, lineList);
|
|
56
|
56
|
// 创建任务
|
|
57
|
|
- List<T_WF_TaskView> taskList = _CreateTask(list, nodeInfo, nWFEngineParamConfig);
|
|
|
57
|
+ List<T_WF_TaskView> taskList = _CreateTask(list, nodeInfo, nWFEngineParamConfig, codelist);
|
|
58
|
58
|
List<T_WF_Task> taskListEntity = taskList.MapToList<T_WF_Task>();
|
|
59
|
59
|
t_WF_TaskViews = taskList;
|
|
60
|
60
|
// nextTaskinfos = taskList.MapToList<NextTaskinfo>();
|
|
|
@@ -106,6 +106,14 @@ namespace WorkFlowApi.Business.Scheme
|
|
106
|
106
|
};
|
|
107
|
107
|
nWFTaskLogEntity.Create();
|
|
108
|
108
|
// 保存信息
|
|
|
109
|
+ save(nWFProcessEntity, taskList, nWFTaskLogEntity);
|
|
|
110
|
+
|
|
|
111
|
+
|
|
|
112
|
+
|
|
|
113
|
+ }
|
|
|
114
|
+
|
|
|
115
|
+ private void save(T_WF_Process nWFProcessEntity, List<T_WF_TaskView> taskList, T_WF_TaskLog nWFTaskLogEntity)
|
|
|
116
|
+ {
|
|
109
|
117
|
var wFProcessEntityTmp = GetEntity(nWFProcessEntity.F_Id);
|
|
110
|
118
|
if (wFProcessEntityTmp == null)
|
|
111
|
119
|
{
|
|
|
@@ -118,28 +126,30 @@ namespace WorkFlowApi.Business.Scheme
|
|
118
|
126
|
|
|
119
|
127
|
foreach (var task in taskList)
|
|
120
|
128
|
{
|
|
121
|
|
- task.F_ModifyDate = DateTime.Now;
|
|
122
|
|
- wFTaskBusiness.InsertExe(task);
|
|
123
|
|
- int num = 1;
|
|
124
|
|
- if (task.nWFUserInfoList != null)
|
|
|
129
|
+ if (task.nWFUserInfoList != null && task.nWFUserInfoList.Count > 0 && task.F_Type != null)
|
|
125
|
130
|
{
|
|
126
|
|
- foreach (var taskUser in task.nWFUserInfoList)
|
|
|
131
|
+ task.F_ModifyDate = DateTime.Now;
|
|
|
132
|
+ wFTaskBusiness.InsertExe(task);
|
|
|
133
|
+ int num = 1;
|
|
|
134
|
+ if (task.nWFUserInfoList != null)
|
|
127
|
135
|
{
|
|
128
|
|
- T_WF_TaskRelation nWFTaskRelationEntity = new T_WF_TaskRelation();
|
|
129
|
|
- nWFTaskRelationEntity.Create();
|
|
130
|
|
- nWFTaskRelationEntity.F_TaskId = task.F_Id;
|
|
131
|
|
- nWFTaskRelationEntity.F_UserId = taskUser.Id;
|
|
132
|
|
- nWFTaskRelationEntity.F_Mark = taskUser.Mark;
|
|
133
|
|
- nWFTaskRelationEntity.F_Result = 0;
|
|
134
|
|
- nWFTaskRelationEntity.F_Sort = num;
|
|
135
|
|
- wFTaskTaskRelationBusiness.InsertExe(nWFTaskRelationEntity);
|
|
136
|
|
- num++;
|
|
|
136
|
+ foreach (var taskUser in task.nWFUserInfoList)
|
|
|
137
|
+ {
|
|
|
138
|
+ T_WF_TaskRelation nWFTaskRelationEntity = new T_WF_TaskRelation();
|
|
|
139
|
+ nWFTaskRelationEntity.Create();
|
|
|
140
|
+ nWFTaskRelationEntity.F_TaskId = task.F_Id;
|
|
|
141
|
+ nWFTaskRelationEntity.F_UserId = taskUser.Id;
|
|
|
142
|
+ nWFTaskRelationEntity.F_Mark = taskUser.Mark;
|
|
|
143
|
+ nWFTaskRelationEntity.F_Result = 0;
|
|
|
144
|
+ nWFTaskRelationEntity.F_Sort = num;
|
|
|
145
|
+ wFTaskTaskRelationBusiness.InsertExe(nWFTaskRelationEntity);
|
|
|
146
|
+ num++;
|
|
|
147
|
+ }
|
|
137
|
148
|
}
|
|
138
|
149
|
}
|
|
|
150
|
+
|
|
139
|
151
|
}
|
|
140
|
152
|
logBusiness.InsertExe(nWFTaskLogEntity);
|
|
141
|
|
-
|
|
142
|
|
-
|
|
143
|
153
|
}
|
|
144
|
154
|
|
|
145
|
155
|
/// <summary>
|
|
|
@@ -148,7 +158,7 @@ namespace WorkFlowApi.Business.Scheme
|
|
148
|
158
|
/// <param name="processId"></param>
|
|
149
|
159
|
/// <param name="userInfo"></param>
|
|
150
|
160
|
/// <param name=""></param>
|
|
151
|
|
- public void AgainCreateFlow(string processId, T_Sys_UserAccount userInfo, out List<T_WF_TaskView> t_WF_TaskViews)
|
|
|
161
|
+ public void AgainCreateFlow(string processId, string branchnodeCode, T_Sys_UserAccount userInfo, out List<T_WF_TaskView> t_WF_TaskViews)
|
|
152
|
162
|
{
|
|
153
|
163
|
|
|
154
|
164
|
// 初始化流程引擎
|
|
|
@@ -211,9 +221,9 @@ namespace WorkFlowApi.Business.Scheme
|
|
211
|
221
|
// 获取下一节点信息
|
|
212
|
222
|
List<WFLineInfo> lineList = new List<WFLineInfo>();
|
|
213
|
223
|
List<WFNodeInfo> list = nWFIEngine.GetNextTaskNode(nodeInfo, "agree", false, lineList);
|
|
214
|
|
-
|
|
|
224
|
+ string codelist = nWFIEngine.GetButonList(nodeInfo.id, lineList);
|
|
215
|
225
|
// 创建任务
|
|
216
|
|
- List<T_WF_TaskView> taskList = _CreateTask(list, nodeInfo, nWFEngineParamConfig);
|
|
|
226
|
+ List<T_WF_TaskView> taskList = _CreateTask(list, nodeInfo, nWFEngineParamConfig,codelist);
|
|
217
|
227
|
List<T_WF_Task> taskListEntity = taskList.MapToList<T_WF_Task>();
|
|
218
|
228
|
t_WF_TaskViews = taskList;
|
|
219
|
229
|
|
|
|
@@ -249,24 +259,28 @@ namespace WorkFlowApi.Business.Scheme
|
|
249
|
259
|
|
|
250
|
260
|
foreach (var task in taskList)
|
|
251
|
261
|
{
|
|
252
|
|
- task.F_ModifyDate = DateTime.Now;
|
|
253
|
|
- wFTaskBusiness.InsertExe(task);
|
|
254
|
|
- int num = 1;
|
|
255
|
|
- if (task.nWFUserInfoList != null)
|
|
|
262
|
+ if (task.nWFUserInfoList != null && task.nWFUserInfoList.Count > 0 && task.F_Type != null)
|
|
256
|
263
|
{
|
|
257
|
|
- foreach (var taskUser in task.nWFUserInfoList)
|
|
|
264
|
+ task.F_ModifyDate = DateTime.Now;
|
|
|
265
|
+ wFTaskBusiness.InsertExe(task);
|
|
|
266
|
+ int num = 1;
|
|
|
267
|
+ if (task.nWFUserInfoList != null)
|
|
258
|
268
|
{
|
|
259
|
|
- T_WF_TaskRelation _WF_TaskRelation = new T_WF_TaskRelation();
|
|
260
|
|
- _WF_TaskRelation.Create();
|
|
261
|
|
- _WF_TaskRelation.F_TaskId = task.F_Id;
|
|
262
|
|
- _WF_TaskRelation.F_UserId = taskUser.Id;
|
|
263
|
|
- _WF_TaskRelation.F_Mark = taskUser.Mark;
|
|
264
|
|
- _WF_TaskRelation.F_Result = 0;
|
|
265
|
|
- _WF_TaskRelation.F_Sort = num;
|
|
266
|
|
- wFTaskTaskRelationBusiness.InsertExe(_WF_TaskRelation);
|
|
267
|
|
- num++;
|
|
|
269
|
+ foreach (var taskUser in task.nWFUserInfoList)
|
|
|
270
|
+ {
|
|
|
271
|
+ T_WF_TaskRelation _WF_TaskRelation = new T_WF_TaskRelation();
|
|
|
272
|
+ _WF_TaskRelation.Create();
|
|
|
273
|
+ _WF_TaskRelation.F_TaskId = task.F_Id;
|
|
|
274
|
+ _WF_TaskRelation.F_UserId = taskUser.Id;
|
|
|
275
|
+ _WF_TaskRelation.F_Mark = taskUser.Mark;
|
|
|
276
|
+ _WF_TaskRelation.F_Result = 0;
|
|
|
277
|
+ _WF_TaskRelation.F_Sort = num;
|
|
|
278
|
+ wFTaskTaskRelationBusiness.InsertExe(_WF_TaskRelation);
|
|
|
279
|
+ num++;
|
|
|
280
|
+ }
|
|
268
|
281
|
}
|
|
269
|
282
|
}
|
|
|
283
|
+
|
|
270
|
284
|
}
|
|
271
|
285
|
|
|
272
|
286
|
|
|
|
@@ -283,7 +297,7 @@ namespace WorkFlowApi.Business.Scheme
|
|
283
|
297
|
/// <param name="stamp"></param>
|
|
284
|
298
|
/// <param name="signUrl"></param>
|
|
285
|
299
|
/// <param name="userInfo"></param>
|
|
286
|
|
- public void AuditFlow(string operationCode, string operationName, string processId, string taskId, string des, string auditors, string stamp, string signUrl, T_Sys_UserAccount userInfo, out List<T_WF_TaskView> t_WF_TaskViews)
|
|
|
300
|
+ public void AuditFlow(string operationCode, string operationName, string processId, string taskId, string des , string stamp, string signUrl, string branchnodeCode, T_Sys_UserAccount userInfo, out List<T_WF_TaskView> t_WF_TaskViews, List<WFAuditor> auditors = null)
|
|
287
|
301
|
{
|
|
288
|
302
|
// 初始化流程引擎
|
|
289
|
303
|
WFIEngine nWFIEngine = _Bootstraper("", processId, taskId, userInfo);
|
|
|
@@ -356,7 +370,7 @@ namespace WorkFlowApi.Business.Scheme
|
|
356
|
370
|
{
|
|
357
|
371
|
nWFTaskRelationEntity.F_Result = 1;
|
|
358
|
372
|
}
|
|
359
|
|
- else if (operationCode == "disagree")
|
|
|
373
|
+ else if (operationCode == "refuse")
|
|
360
|
374
|
{
|
|
361
|
375
|
nWFTaskRelationEntity.F_Result = 2;
|
|
362
|
376
|
}
|
|
|
@@ -368,13 +382,17 @@ namespace WorkFlowApi.Business.Scheme
|
|
368
|
382
|
|
|
369
|
383
|
// 获取下一节点信息
|
|
370
|
384
|
List<WFLineInfo> lineList = new List<WFLineInfo>();
|
|
371
|
|
- List<WFNodeInfo> list = nWFIEngine.GetNextTaskNode(nodeInfo, operationCode, false, lineList);
|
|
372
|
|
-
|
|
373
|
|
- List<T_WF_Task> closeTaskList = new List<T_WF_Task>();
|
|
|
385
|
+ List<WFNodeInfo> list = nWFIEngine.GetNextTaskNode(nodeInfo, operationCode, false, lineList, branchnodeCode);
|
|
|
386
|
+ var codelist = string.Empty;
|
|
|
387
|
+ if (list != null && list.Count() > 0)
|
|
|
388
|
+ {
|
|
|
389
|
+ codelist = nWFIEngine.GetButonList(list.FirstOrDefault().id, lineList);
|
|
|
390
|
+ }
|
|
374
|
391
|
|
|
375
|
392
|
|
|
|
393
|
+
|
|
376
|
394
|
// 创建任务
|
|
377
|
|
- List<T_WF_TaskView> taskList = _CreateTask(list, nodeInfo, nWFEngineParamConfig);
|
|
|
395
|
+ List<T_WF_TaskView> taskList = _CreateTask(list, nodeInfo, nWFEngineParamConfig, codelist);
|
|
378
|
396
|
List<T_WF_Task> taskListEntity = taskList.MapToList<T_WF_Task>();
|
|
379
|
397
|
t_WF_TaskViews = taskList;
|
|
380
|
398
|
|
|
|
@@ -429,24 +447,28 @@ namespace WorkFlowApi.Business.Scheme
|
|
429
|
447
|
|
|
430
|
448
|
foreach (var task in taskList)
|
|
431
|
449
|
{
|
|
432
|
|
- task.F_ModifyDate = DateTime.Now;
|
|
433
|
|
- wFTaskBusiness.InsertExe(task);
|
|
434
|
|
- int num = 1;
|
|
435
|
|
- if (task.nWFUserInfoList != null)
|
|
|
450
|
+ if(task.nWFUserInfoList!= null&& task.nWFUserInfoList.Count>0&& task.F_Type!=null)
|
|
436
|
451
|
{
|
|
437
|
|
- foreach (var taskUser in task.nWFUserInfoList)
|
|
|
452
|
+ task.F_ModifyDate = DateTime.Now;
|
|
|
453
|
+ wFTaskBusiness.InsertExe(task);
|
|
|
454
|
+ int num = 1;
|
|
|
455
|
+ if (task.nWFUserInfoList != null)
|
|
438
|
456
|
{
|
|
439
|
|
- T_WF_TaskRelation _WF_TaskRelation = new T_WF_TaskRelation();
|
|
440
|
|
- _WF_TaskRelation.Create();
|
|
441
|
|
- _WF_TaskRelation.F_TaskId = task.F_Id;
|
|
442
|
|
- _WF_TaskRelation.F_UserId = taskUser.Id;
|
|
443
|
|
- _WF_TaskRelation.F_Mark = taskUser.Mark;
|
|
444
|
|
- _WF_TaskRelation.F_Result = 0;
|
|
445
|
|
- _WF_TaskRelation.F_Sort = num;
|
|
446
|
|
- wFTaskTaskRelationBusiness.InsertExe(_WF_TaskRelation);
|
|
447
|
|
- num++;
|
|
|
457
|
+ foreach (var taskUser in task.nWFUserInfoList)
|
|
|
458
|
+ {
|
|
|
459
|
+ T_WF_TaskRelation _WF_TaskRelation = new T_WF_TaskRelation();
|
|
|
460
|
+ _WF_TaskRelation.Create();
|
|
|
461
|
+ _WF_TaskRelation.F_TaskId = task.F_Id;
|
|
|
462
|
+ _WF_TaskRelation.F_UserId = taskUser.Id;
|
|
|
463
|
+ _WF_TaskRelation.F_Mark = taskUser.Mark;
|
|
|
464
|
+ _WF_TaskRelation.F_Result = 0;
|
|
|
465
|
+ _WF_TaskRelation.F_Sort = num;
|
|
|
466
|
+ wFTaskTaskRelationBusiness.InsertExe(_WF_TaskRelation);
|
|
|
467
|
+ num++;
|
|
|
468
|
+ }
|
|
448
|
469
|
}
|
|
449
|
470
|
}
|
|
|
471
|
+
|
|
450
|
472
|
}
|
|
451
|
473
|
|
|
452
|
474
|
|
|
|
@@ -590,7 +612,7 @@ namespace WorkFlowApi.Business.Scheme
|
|
590
|
612
|
/// <param name="nodeList">节点信息</param>
|
|
591
|
613
|
/// <param name="paramConfig">流程配置信息</param>
|
|
592
|
614
|
/// <returns></returns>
|
|
593
|
|
- private List<T_WF_TaskView> _CreateTask(List<WFNodeInfo> nodeList, WFNodeInfo currentNodeInfo, WFEngineParamConfig paramConfig)
|
|
|
615
|
+ private List<T_WF_TaskView> _CreateTask(List<WFNodeInfo> nodeList, WFNodeInfo currentNodeInfo, WFEngineParamConfig paramConfig,string codelist)
|
|
594
|
616
|
{
|
|
595
|
617
|
List<T_WF_TaskView> list = new List<T_WF_TaskView>();
|
|
596
|
618
|
foreach (var node in nodeList)
|
|
|
@@ -623,7 +645,13 @@ namespace WorkFlowApi.Business.Scheme
|
|
623
|
645
|
nWFTaskEntity.F_TimeoutStrategy = node.timeoutStrategy;
|
|
624
|
646
|
}
|
|
625
|
647
|
nWFTaskEntity.nWFUserInfoList = _GetNodeAuditors(node.auditors, node, paramConfig);
|
|
626
|
|
- nWFTaskEntity.auditors = node.auditors;
|
|
|
648
|
+ nWFTaskEntity.auditors = _GetNodeAuditors3(node.auditors, node, paramConfig);
|
|
|
649
|
+ nWFTaskEntity.btnList = codelist;
|
|
|
650
|
+
|
|
|
651
|
+
|
|
|
652
|
+
|
|
|
653
|
+
|
|
|
654
|
+ nWFTaskEntity.nodeType = node.type;
|
|
627
|
655
|
|
|
628
|
656
|
switch (node.type)
|
|
629
|
657
|
{
|
|
|
@@ -645,10 +673,11 @@ namespace WorkFlowApi.Business.Scheme
|
|
645
|
673
|
|
|
646
|
674
|
break;
|
|
647
|
675
|
}
|
|
648
|
|
- if (nWFTaskEntity.nWFUserInfoList.Count > 0 && nWFTaskEntity.F_Type != null)
|
|
649
|
|
- {
|
|
650
|
|
- list.Add(nWFTaskEntity);
|
|
651
|
|
- }
|
|
|
676
|
+ list.Add(nWFTaskEntity);
|
|
|
677
|
+ //if (nWFTaskEntity.nWFUserInfoList.Count > 0 && nWFTaskEntity.F_Type != null)
|
|
|
678
|
+ //{
|
|
|
679
|
+ // list.Add(nWFTaskEntity);
|
|
|
680
|
+ //}
|
|
652
|
681
|
}
|
|
653
|
682
|
return list;
|
|
654
|
683
|
}
|
|
|
@@ -681,44 +710,7 @@ namespace WorkFlowApi.Business.Scheme
|
|
681
|
710
|
}
|
|
682
|
711
|
|
|
683
|
712
|
List<T_WF_TaskRelation> taskUserList = wFTaskTaskRelationBusiness.GetList($"F_TaskId='{taskEntiy.F_Id}'", "");
|
|
684
|
|
-
|
|
685
|
|
- if (nodeInfo.type == "stepnode" && nodeInfo.isAllAuditor == "2")
|
|
686
|
|
- {
|
|
687
|
|
- List<T_WF_TaskRelation> taskUserList2;
|
|
688
|
|
- // 如果普通节点设置了所有人都需要审核的情况
|
|
689
|
|
- if (nodeInfo.auditorAgainType == "1")
|
|
690
|
|
- {
|
|
691
|
|
- //审核通过的人不需要再审核:获取未审核通过的人。但是在大家都通过的情况下就获取所有人
|
|
692
|
|
- taskUserList2 = taskUserList.FindAll(t => t.F_Result != 1);
|
|
693
|
|
- if (taskUserList2.Count == 0)
|
|
694
|
|
- {
|
|
695
|
|
- taskUserList2 = taskUserList;
|
|
696
|
|
- }
|
|
697
|
|
- }
|
|
698
|
|
- else
|
|
699
|
|
- {
|
|
700
|
|
- taskUserList2 = taskUserList;
|
|
701
|
|
- }
|
|
702
|
|
- if (taskUserList2.Count > 0)
|
|
703
|
|
- {
|
|
704
|
|
- foreach (var item in taskUserList2)
|
|
705
|
|
- {
|
|
706
|
|
- var taskUserEntity = user.GetEntity(item.F_UserId);
|
|
707
|
|
- if (taskUserEntity != null)
|
|
708
|
|
- {
|
|
709
|
|
- list.Add(new WFUserInfo()
|
|
710
|
|
- {
|
|
711
|
|
- Id = taskUserEntity.F_UserId.ToString(),
|
|
712
|
|
- Account = taskUserEntity.F_UserCode,
|
|
713
|
|
- Name = taskUserEntity.F_UserName
|
|
714
|
|
- });
|
|
715
|
|
- }
|
|
716
|
|
- }
|
|
717
|
|
- return list;
|
|
718
|
|
- }
|
|
719
|
|
- }
|
|
720
|
|
- else
|
|
721
|
|
- {
|
|
|
713
|
+
|
|
722
|
714
|
T_WF_TaskRelation taskUser = taskUserList.Find(t => t.F_Result != 0 && t.F_Result != 3);
|
|
723
|
715
|
if (taskUser != null)
|
|
724
|
716
|
{
|
|
|
@@ -737,54 +729,55 @@ namespace WorkFlowApi.Business.Scheme
|
|
737
|
729
|
if (list2.Find(t => t.Id == _userId) == null)
|
|
738
|
730
|
{
|
|
739
|
731
|
if (list2.Count == 0)
|
|
740
|
|
- {// 未找到审核人,默认成系统管理员
|
|
741
|
|
- if (nodeInfo.noPeopleGz == 3)
|
|
742
|
|
- {
|
|
|
732
|
+ {
|
|
|
733
|
+ // 找不到审核人无法提交
|
|
|
734
|
+ // if (nodeInfo.noPeopleGz == 3)
|
|
|
735
|
+ // {
|
|
743
|
736
|
throw (new Exception("下一节点没有审核人,无法提交!"));
|
|
744
|
|
- }
|
|
|
737
|
+ // }
|
|
745
|
738
|
// 如果找不到审核人就默认超级管理员才能审核
|
|
746
|
|
- var adminEntityList = user.GetList("F_RoleId=4", "");
|
|
747
|
|
- foreach (var item in adminEntityList)
|
|
748
|
|
- {
|
|
749
|
|
- list2.Add(new WFUserInfo()
|
|
750
|
|
- {
|
|
751
|
|
- Id = item.F_UserId.ToString(),
|
|
752
|
|
- Account = item.F_UserCode,
|
|
753
|
|
- Name = item.F_UserName,
|
|
754
|
|
- noPeople = true
|
|
755
|
|
- });
|
|
756
|
|
- }
|
|
|
739
|
+ //var adminEntityList = user.GetList("F_RoleId=4", "");
|
|
|
740
|
+ //foreach (var item in adminEntityList)
|
|
|
741
|
+ //{
|
|
|
742
|
+ // list2.Add(new WFUserInfo()
|
|
|
743
|
+ // {
|
|
|
744
|
+ // Id = item.F_UserId.ToString(),
|
|
|
745
|
+ // Account = item.F_UserCode,
|
|
|
746
|
+ // Name = item.F_UserName,
|
|
|
747
|
+ // noPeople = true
|
|
|
748
|
+ // });
|
|
|
749
|
+ //}
|
|
757
|
750
|
}
|
|
758
|
751
|
return list2;
|
|
759
|
752
|
}
|
|
760
|
753
|
return list;
|
|
761
|
754
|
}
|
|
762
|
755
|
}
|
|
763
|
|
- }
|
|
|
756
|
+
|
|
764
|
757
|
}
|
|
765
|
758
|
}
|
|
766
|
759
|
|
|
767
|
760
|
list.AddRange(list2);
|
|
768
|
761
|
|
|
769
|
|
- if (list.Count == 0)
|
|
770
|
|
- {// 未找到审核人,默认成系统管理员
|
|
771
|
|
- if (nodeInfo.noPeopleGz == 3)
|
|
772
|
|
- {
|
|
773
|
|
- throw (new Exception("下一节点没有审核人,无法提交!"));
|
|
774
|
|
- }
|
|
775
|
|
- // 如果找不到审核人就默认超级管理员才能审核
|
|
776
|
|
- var adminEntityList = user.GetList("F_RoleId=4", "");
|
|
777
|
|
- foreach (var item in adminEntityList)
|
|
778
|
|
- {
|
|
779
|
|
- list.Add(new WFUserInfo()
|
|
780
|
|
- {
|
|
781
|
|
- Id = item.F_UserId.ToString(),
|
|
782
|
|
- Account = item.F_UserCode,
|
|
783
|
|
- Name = item.F_UserName,
|
|
784
|
|
- noPeople = true
|
|
785
|
|
- });
|
|
786
|
|
- }
|
|
787
|
|
- }
|
|
|
762
|
+ //if (list.Count == 0)
|
|
|
763
|
+ //{// 未找到审核人,默认成系统管理员
|
|
|
764
|
+ // if (nodeInfo.noPeopleGz == 3)
|
|
|
765
|
+ // {
|
|
|
766
|
+ // throw (new Exception("下一节点没有审核人,无法提交!"));
|
|
|
767
|
+ // }
|
|
|
768
|
+ // // 如果找不到审核人就默认超级管理员才能审核
|
|
|
769
|
+ // var adminEntityList = user.GetList("F_RoleId=4", "");
|
|
|
770
|
+ // foreach (var item in adminEntityList)
|
|
|
771
|
+ // {
|
|
|
772
|
+ // list.Add(new WFUserInfo()
|
|
|
773
|
+ // {
|
|
|
774
|
+ // Id = item.F_UserId.ToString(),
|
|
|
775
|
+ // Account = item.F_UserCode,
|
|
|
776
|
+ // Name = item.F_UserName,
|
|
|
777
|
+ // noPeople = true
|
|
|
778
|
+ // });
|
|
|
779
|
+ // }
|
|
|
780
|
+ //}
|
|
788
|
781
|
|
|
789
|
782
|
return list;
|
|
790
|
783
|
}
|
|
|
@@ -806,22 +799,22 @@ namespace WorkFlowApi.Business.Scheme
|
|
806
|
799
|
return list;
|
|
807
|
800
|
}
|
|
808
|
801
|
|
|
809
|
|
- if (nodeAuditorList.Count == 0)
|
|
810
|
|
- {
|
|
811
|
|
- // 如果找不到审核人就默认超级管理员才能审核
|
|
812
|
|
- var adminEntityList = user.GetList("F_RoleId=4", "");
|
|
813
|
|
- foreach (var item in adminEntityList)
|
|
814
|
|
- {
|
|
815
|
|
- list.Add(new WFUserInfo()
|
|
816
|
|
- {
|
|
817
|
|
- Id = item.F_UserId.ToString(),
|
|
818
|
|
- Account = item.F_UserCode,
|
|
819
|
|
- Name = item.F_UserName
|
|
820
|
|
- });
|
|
821
|
|
- }
|
|
822
|
|
- }
|
|
823
|
|
- else
|
|
824
|
|
- {
|
|
|
802
|
+ //if (nodeAuditorList.Count == 0)
|
|
|
803
|
+ //{
|
|
|
804
|
+ // // 如果找不到审核人就默认超级管理员才能审核
|
|
|
805
|
+ // var adminEntityList = user.GetList("F_RoleId=4", "");
|
|
|
806
|
+ // foreach (var item in adminEntityList)
|
|
|
807
|
+ // {
|
|
|
808
|
+ // list.Add(new WFUserInfo()
|
|
|
809
|
+ // {
|
|
|
810
|
+ // Id = item.F_UserId.ToString(),
|
|
|
811
|
+ // Account = item.F_UserCode,
|
|
|
812
|
+ // Name = item.F_UserName
|
|
|
813
|
+ // });
|
|
|
814
|
+ // }
|
|
|
815
|
+ //}
|
|
|
816
|
+ // else
|
|
|
817
|
+ //{
|
|
825
|
818
|
foreach (var item in nodeAuditorList)
|
|
826
|
819
|
{
|
|
827
|
820
|
switch (item.type)//1.部门2.角色3.用户
|
|
|
@@ -890,11 +883,61 @@ namespace WorkFlowApi.Business.Scheme
|
|
890
|
883
|
Name = userEntity6.F_UserName
|
|
891
|
884
|
});
|
|
892
|
885
|
}
|
|
|
886
|
+
|
|
|
887
|
+ }
|
|
|
888
|
+ break;
|
|
|
889
|
+ }
|
|
|
890
|
+ }
|
|
|
891
|
+ // }
|
|
|
892
|
+ return list;
|
|
|
893
|
+ }
|
|
|
894
|
+
|
|
|
895
|
+ private List<WFAuditor> _GetNodeAuditors3(List<WFAuditor> nodeAuditorList, WFNodeInfo nodeInfo, WFEngineParamConfig paramConfig)
|
|
|
896
|
+ {
|
|
|
897
|
+ List<WFAuditor> list = new List<WFAuditor>();
|
|
|
898
|
+ if (nodeAuditorList != null)
|
|
|
899
|
+ {
|
|
|
900
|
+ foreach (var item in nodeAuditorList)
|
|
|
901
|
+ {
|
|
|
902
|
+ switch (item.type)//1.部门2.角色3.用户
|
|
|
903
|
+ {
|
|
|
904
|
+ case 1:// 部门
|
|
|
905
|
+
|
|
|
906
|
+ list.Add(item);
|
|
|
907
|
+ break;
|
|
|
908
|
+ case 2:// 角色
|
|
|
909
|
+ //var userRelationList2 = userRelation.GetList($"where F_ObjectId='{item.auditorId}'", "");
|
|
|
910
|
+ list.Add(item);
|
|
|
911
|
+ break;
|
|
|
912
|
+ case 3:// 用户
|
|
|
913
|
+ list.Add(item);
|
|
|
914
|
+
|
|
|
915
|
+ break;
|
|
|
916
|
+ case 4:// 某一个节点执行人
|
|
|
917
|
+ var task = logBusiness.GetList($"F_NodeId='{item.auditorId}' and F_ProcessId='{paramConfig.ProcessId}' and F_TaskType<>3 and F_TaskType<>6", "").FirstOrDefault();
|
|
|
918
|
+ if (task != null && !string.IsNullOrEmpty(task.F_CreateUserId))
|
|
|
919
|
+ {
|
|
|
920
|
+ var userEntity6 = user.GetEntity(task.F_CreateUserId);
|
|
|
921
|
+ if (userEntity6 != null)
|
|
|
922
|
+ {
|
|
|
923
|
+ list.Add(new WFAuditor()
|
|
|
924
|
+ {
|
|
|
925
|
+ id = userEntity6.F_UserId.ToString(),
|
|
|
926
|
+ auditorId = userEntity6.F_UserId.ToString(),
|
|
|
927
|
+ auditorAccount = userEntity6.F_UserCode,
|
|
|
928
|
+ auditorName = userEntity6.F_UserName,
|
|
|
929
|
+ type = 2
|
|
|
930
|
+
|
|
|
931
|
+ });
|
|
|
932
|
+ }
|
|
|
933
|
+
|
|
893
|
934
|
}
|
|
894
|
935
|
break;
|
|
895
|
936
|
}
|
|
896
|
937
|
}
|
|
897
|
938
|
}
|
|
|
939
|
+
|
|
|
940
|
+
|
|
898
|
941
|
return list;
|
|
899
|
942
|
}
|
|
900
|
943
|
|