perf(更换路径): 方便同步代码

approve-sys
tony 4 years ago
parent f6a9dfb7a3
commit 4aea7c26c6

@ -63,7 +63,7 @@ public class ProcessConstants {
/** /**
* *
*/ */
public static final String PROCESS_INITIATOR = "initiator"; public static final String PROCESS_INITIATOR = "INITIATOR";
/** /**

@ -11,6 +11,9 @@ import com.ruoyi.flowable.factory.FlowServiceFactory;
import com.ruoyi.flowable.service.IFlowDefinitionService; import com.ruoyi.flowable.service.IFlowDefinitionService;
import com.ruoyi.flowable.service.ISysDeployFormService; import com.ruoyi.flowable.service.ISysDeployFormService;
import com.ruoyi.system.domain.SysForm; import com.ruoyi.system.domain.SysForm;
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
@ -23,6 +26,7 @@ import org.flowable.image.impl.DefaultProcessDiagramGenerator;
import org.flowable.task.api.Task; import org.flowable.task.api.Task;
import org.flowable.task.api.TaskQuery; import org.flowable.task.api.TaskQuery;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -48,6 +52,12 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
@Resource @Resource
private ISysUserService sysUserService; private ISysUserService sysUserService;
@Resource
private ISysDeptService sysDeptService;
@Resource
private ISysPostService postService;
private static final String BPMN_FILE_SUFFIX = ".bpmn"; private static final String BPMN_FILE_SUFFIX = ".bpmn";
@Override @Override
@ -167,18 +177,18 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
if (Objects.nonNull(processDefinition) && processDefinition.isSuspended()) { if (Objects.nonNull(processDefinition) && processDefinition.isSuspended()) {
return AjaxResult.error("流程已被挂起,请先激活流程"); return AjaxResult.error("流程已被挂起,请先激活流程");
} }
// variables.put("skip", true); // variables.put("skip", true);
// variables.put(ProcessConstants.FLOWABLE_SKIP_EXPRESSION_ENABLED, true); // variables.put(ProcessConstants.FLOWABLE_SKIP_EXPRESSION_ENABLED, true);
// 设置流程发起人Id到流程中 // 设置流程发起人Id到流程中
Long userId = SecurityUtils.getLoginUser().getUser().getUserId(); SysUser sysUser = SecurityUtils.getLoginUser().getUser();
identityService.setAuthenticatedUserId(userId.toString()); identityService.setAuthenticatedUserId(sysUser.getUserId().toString());
variables.put(ProcessConstants.PROCESS_INITIATOR, userId); variables.put(ProcessConstants.PROCESS_INITIATOR, "");
ProcessInstance processInstance = runtimeService.startProcessInstanceById(procDefId, variables); ProcessInstance processInstance = runtimeService.startProcessInstanceById(procDefId, variables);
// 给第一步申请人节点设置任务执行人和意见 todo:第一个节点不设置为申请人节点有点问题? // 给第一步申请人节点设置任务执行人和意见 todo:第一个节点不设置为申请人节点有点问题?
Task task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult(); Task task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult();
if (Objects.nonNull(task)) { if (Objects.nonNull(task)) {
taskService.addComment(task.getId(), processInstance.getProcessInstanceId(), FlowComment.NORMAL.getType(), "发起流程申请"); taskService.addComment(task.getId(), processInstance.getProcessInstanceId(), FlowComment.NORMAL.getType(), sysUser.getNickName() + "发起流程申请");
taskService.setAssignee(task.getId(), userId.toString()); // taskService.setAssignee(task.getId(), sysUser.getUserId().toString());
taskService.complete(task.getId(), variables); taskService.complete(task.getId(), variables);
} }
return AjaxResult.success("流程启动成功"); return AjaxResult.success("流程启动成功");

@ -505,7 +505,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
String myTaskId = null; String myTaskId = null;
HistoricTaskInstance myTask = null; HistoricTaskInstance myTask = null;
for (HistoricTaskInstance hti : htiList) { for (HistoricTaskInstance hti : htiList) {
if (loginUser.getUserId().toString().equals(hti.getAssignee())) { if (StringUtils.isBlank(hti.getAssignee())) {
myTaskId = hti.getId(); myTaskId = hti.getId();
myTask = hti; myTask = hti;
break; break;

@ -1,4 +1,4 @@
package com.ruoyi.web.controller.survey; package com.ruoyi.flowable.survey;
import java.util.List; import java.util.List;

@ -1,4 +1,4 @@
package com.ruoyi.web.controller.survey; package com.ruoyi.flowable.survey;
import java.util.List; import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;

@ -1,4 +1,4 @@
package com.ruoyi.web.controller.survey; package com.ruoyi.flowable.survey;
import java.util.List; import java.util.List;

@ -1,4 +1,4 @@
package com.ruoyi.web.controller.survey; package com.ruoyi.flowable.survey;
import java.util.List; import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;

@ -72,9 +72,9 @@ export default {
}, },
watch: { watch: {
'formData.initiator': function(val) { 'formData.initiator': function(val) {
// if (val === '') val = null if (val === '') val = null
// //
if (val === '') val = 'INITIATOR' // if (val === '') val = 'INITIATOR'
this.updateProperties({ 'flowable:initiator': val }) this.updateProperties({ 'flowable:initiator': val })
}, },
'formData.formKey': function(val) { 'formData.formKey': function(val) {
@ -83,7 +83,7 @@ export default {
} }
}, },
created() { created() {
this.updateProperties({ 'flowable:initiator': 'INITIATOR' }) // this.updateProperties({ 'flowable:initiator': 'INITIATOR' })
this.formData = commonParse(this.element) this.formData = commonParse(this.element)
} }
} }

Loading…
Cancel
Save