|
|
@@ -260,23 +260,11 @@ public class FlowInstance { |
|
|
|
String sqlIn = ""; |
|
|
|
for (Task act : list) { |
|
|
|
//如果办理人是当前用户,则置此任务为当前任务 |
|
|
|
// if (act_inst == null) { |
|
|
|
//我办理中的任务:非待办,且是我的任务 |
|
|
|
if (act.getStatu() != FlowConst.ActivityStatu.WAIT.value) { |
|
|
|
if (us.getUserId() == act.getHandler()) { |
|
|
|
actInst = act; |
|
|
|
} |
|
|
|
} else if (FlowHelper.isMyWaitedTask(act.getId(), us.getUserId())) { |
|
|
|
//我的待办任务 |
|
|
|
actInst = act; |
|
|
|
if (act.getStatu() == FlowConst.ActivityStatu.WAIT.value && FlowHelper.isMyWaitedTask(act.getId(), us.getUserId())) { |
|
|
|
//我的待办任务,设下值,为后面的按钮判断减轻负担 |
|
|
|
act.setHandler(us.getUserId()); |
|
|
|
} else { |
|
|
|
Activity ae = procDef.getProcInfo().findActivity(act.getActId()); |
|
|
|
if (ae != null && ae.getType() == FlowConst.ActivityType.END.value) { |
|
|
|
actInst = act; |
|
|
|
} |
|
|
|
} |
|
|
|
// } |
|
|
|
//如果当前任务为待办理,那么要找其前置任务,作为活动任务,方便取回 |
|
|
|
if (act.getStatu() == FlowConst.ActivityStatu.WAIT.value && !act.isReject() && !act.isRetake()) { |
|
|
|
sqlIn += "," + act.getEntityId(); |
|
|
@@ -286,19 +274,6 @@ public class FlowInstance { |
|
|
|
if (StringUtils.isNotEmpty(sqlIn)) { |
|
|
|
List<Task> list1 = provider.findBeforeTasks(sqlIn.substring(1)); |
|
|
|
listTask.addAll(list1); |
|
|
|
if (actInst == null) { |
|
|
|
for (Task act : list1) { |
|
|
|
//如果办理人是当前用户,则置此任务为当前任务 |
|
|
|
if (us.getUserId() == act.getHandler()) { |
|
|
|
actInst = act; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//没有我的处理任务,用流程当前任务来 |
|
|
|
if (actInst == null) { |
|
|
|
actInst = provider.findTask(procInst.getTaskId()); |
|
|
|
} |
|
|
|
|
|
|
|
listTask.addAll(list); |
|
|
|