|
@@ -1,10 +1,9 @@
|
|
|
-package org.hswebframework.web.workflow.flowable.service.imp;
|
|
|
+package org.hswebframework.web.workflow.service.imp;
|
|
|
|
|
|
import org.activiti.engine.history.HistoricProcessInstance;
|
|
|
import org.activiti.engine.history.HistoricTaskInstance;
|
|
|
import org.activiti.engine.impl.RepositoryServiceImpl;
|
|
|
import org.activiti.engine.impl.TaskServiceImpl;
|
|
|
-import org.activiti.engine.impl.persistence.entity.IdentityLinkEntity;
|
|
|
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;
|
|
|
import org.activiti.engine.impl.pvm.PvmActivity;
|
|
|
import org.activiti.engine.impl.pvm.PvmTransition;
|
|
@@ -14,21 +13,11 @@ import org.activiti.engine.impl.pvm.process.TransitionImpl;
|
|
|
import org.activiti.engine.runtime.Execution;
|
|
|
import org.activiti.engine.runtime.ProcessInstance;
|
|
|
import org.activiti.engine.task.Task;
|
|
|
-import org.hswebframework.utils.ClassUtils;
|
|
|
import org.hswebframework.utils.StringUtils;
|
|
|
import org.hswebframework.web.NotFoundException;
|
|
|
-import org.hswebframework.web.entity.organizational.PersonEntity;
|
|
|
-import org.hswebframework.web.entity.workflow.ActDefEntity;
|
|
|
-import org.hswebframework.web.organizational.authorization.Personnel;
|
|
|
-import org.hswebframework.web.organizational.authorization.relation.Relation;
|
|
|
-import org.hswebframework.web.service.organizational.PersonService;
|
|
|
-import org.hswebframework.web.service.organizational.RelationDefineService;
|
|
|
-import org.hswebframework.web.service.organizational.RelationInfoService;
|
|
|
-import org.hswebframework.web.service.workflow.ActDefService;
|
|
|
-import org.hswebframework.web.workflow.flowable.service.BpmActivityService;
|
|
|
-import org.hswebframework.web.workflow.flowable.service.BpmTaskService;
|
|
|
-import org.hswebframework.web.workflow.flowable.service.BpmUtilsService;
|
|
|
-import org.hswebframework.web.workflow.flowable.utils.FlowableAbstract;
|
|
|
+import org.hswebframework.web.workflow.service.BpmActivityService;
|
|
|
+import org.hswebframework.web.workflow.service.BpmTaskService;
|
|
|
+import org.hswebframework.web.workflow.service.BpmUtilsService;
|
|
|
import org.hswebframework.web.workflow.flowable.utils.JumpTaskCmd;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -38,8 +27,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.*;
|
|
|
-import java.util.stream.Collector;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
import static org.hswebframework.web.commons.entity.param.QueryParamEntity.single;
|
|
|
|
|
@@ -49,15 +36,13 @@ import static org.hswebframework.web.commons.entity.param.QueryParamEntity.singl
|
|
|
*/
|
|
|
@Service
|
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
|
-public class BpmTaskServiceImp extends FlowableAbstract implements BpmTaskService {
|
|
|
+public class BpmTaskServiceImp extends AbstractFlowableService implements BpmTaskService {
|
|
|
|
|
|
protected Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
|
|
|
@Resource
|
|
|
private BpmActivityService bpmActivityService;
|
|
|
@Autowired
|
|
|
- ActDefService actDefService;
|
|
|
- @Autowired
|
|
|
BpmUtilsService bpmUtilsService;
|
|
|
|
|
|
@Override
|
|
@@ -277,19 +262,19 @@ public class BpmTaskServiceImp extends FlowableAbstract implements BpmTaskServic
|
|
|
public void addCandidateUser(String taskId, String actId, String userId) {
|
|
|
if (!StringUtils.isNullOrEmpty(actId)) {
|
|
|
// 获取节点配置信息
|
|
|
- ActDefEntity actDefEntity = actDefService.selectSingle(single(ActDefEntity.actId, actId));
|
|
|
+// ActDefEntity actDefEntity = actDefService.selectSingle(single(ActDefEntity.actId, actId));
|
|
|
// 根据配置类型 获取人员信息 设置待办人
|
|
|
- if (actDefEntity!=null) {
|
|
|
- List<String> list = bpmUtilsService.selectUserIdsBy(userId,actDefEntity);
|
|
|
- list.forEach(uId -> taskService.addCandidateUser(taskId,uId));
|
|
|
- } else {
|
|
|
+// if (actDefEntity!=null) {
|
|
|
+// List<String> list = bpmUtilsService.selectUserIdsBy(userId,actDefEntity);
|
|
|
+// list.forEach(uId -> taskService.addCandidateUser(taskId,uId));
|
|
|
+// } else {
|
|
|
taskService.addCandidateUser(taskId,
|
|
|
runtimeService.getIdentityLinksForProcessInstance(selectTaskByTaskId(taskId).getProcessInstanceId())
|
|
|
.stream()
|
|
|
.filter(linkEntity -> "starter".equals(linkEntity.getType()))
|
|
|
.findFirst().orElseThrow(()-> new NotFoundException("发起人获取失败")).getUserId()
|
|
|
);
|
|
|
- }
|
|
|
+// }
|
|
|
} else {
|
|
|
taskService.addCandidateUser(taskId, userId);
|
|
|
}
|