|
|
@ -7,17 +7,23 @@ package com.yxt.anrui.flowable.biz.flowdefinition; |
|
|
|
*/ |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.yxt.anrui.flowable.api.flowcomment.FlowComment; |
|
|
|
import com.yxt.anrui.flowable.api.flowdefinition.FlowDefinitionVo; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTask; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; |
|
|
|
import com.yxt.anrui.flowable.api.processcomment.ProcessCommentDto; |
|
|
|
import com.yxt.anrui.flowable.api.sysform.SysForm; |
|
|
|
import com.yxt.anrui.flowable.biz.flow.FlowableRest; |
|
|
|
import com.yxt.anrui.flowable.biz.flow.FlowableService; |
|
|
|
import com.yxt.anrui.flowable.biz.flowtask.FlowTaskService; |
|
|
|
import com.yxt.anrui.flowable.biz.processcomment.ProcessCommentService; |
|
|
|
import com.yxt.anrui.flowable.biz.sysdeployform.SysDeployFormService; |
|
|
|
import com.yxt.anrui.flowable.api.flowcomment.FlowComment; |
|
|
|
import com.yxt.anrui.flowable.common.ProcessConstants; |
|
|
|
import com.yxt.anrui.flowable.factory.FlowServiceFactory; |
|
|
|
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
|
|
|
import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigQuery; |
|
|
|
import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigVvo; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUser; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
@ -49,6 +55,12 @@ public class FlowDefinitionService extends FlowServiceFactory { |
|
|
|
private SysUserFeign sysUserFeign; |
|
|
|
@Autowired |
|
|
|
private FlowableService flowableService; |
|
|
|
@Autowired |
|
|
|
private SysFlowableConfigFeign sysFlowableConfigFeign; |
|
|
|
@Autowired |
|
|
|
private ProcessCommentService processCommentService; |
|
|
|
@Autowired |
|
|
|
private FlowableRest flowableRest; |
|
|
|
/** |
|
|
|
* 导入流程文件 |
|
|
|
* |
|
|
@ -200,10 +212,46 @@ public class FlowDefinitionService extends FlowServiceFactory { |
|
|
|
taskService.complete(task.getId(), variables); |
|
|
|
|
|
|
|
} |
|
|
|
String firstSid = ""; |
|
|
|
String firstName = ""; |
|
|
|
boolean isChange = false; |
|
|
|
List<String> nextUserList = Arrays.asList(nextNodeUserSids.split(",")); |
|
|
|
if(nextUserList.size() == 1){ |
|
|
|
firstSid = nextUserList.get(0); |
|
|
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(firstSid); |
|
|
|
if(userVoResultBean.getData() != null){ |
|
|
|
firstName = userVoResultBean.getData().getName(); |
|
|
|
} |
|
|
|
SysFlowableConfigQuery sysFlowableConfigQuery = new SysFlowableConfigQuery(); |
|
|
|
sysFlowableConfigQuery.setUserSid(firstSid); |
|
|
|
sysFlowableConfigQuery.setNowDate(new Date()); |
|
|
|
ResultBean<SysFlowableConfigVvo> sysFlowableConfigVvoResultBean = sysFlowableConfigFeign.selectByUserSid(sysFlowableConfigQuery); |
|
|
|
if(sysFlowableConfigVvoResultBean.getData() != null){ |
|
|
|
if(StringUtils.isNotBlank(sysFlowableConfigVvoResultBean.getData().getChangeUserSid())){ |
|
|
|
nextNodeUserSids = sysFlowableConfigVvoResultBean.getData().getChangeUserSid(); |
|
|
|
isChange = true; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
ResultBean<List<LatestTaskVo>> latestTasksNew = flowTaskService.getLatestTasksNew(processInstance.getId()); |
|
|
|
List<LatestTaskVo> data = latestTasksNew.getData(); |
|
|
|
LatestTaskVo latestTaskVo = data.get(0); |
|
|
|
String id_ = latestTaskVo.getId_(); |
|
|
|
if(isChange){//添加评论
|
|
|
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(nextNodeUserSids); |
|
|
|
ProcessCommentDto processCommentDto = new ProcessCommentDto(); |
|
|
|
processCommentDto.setReviewerSid(firstSid); |
|
|
|
if(userVoResultBean.getData() != null){ |
|
|
|
String changeName = userVoResultBean.getData().getName(); |
|
|
|
processCommentDto.setReviewer(firstName); |
|
|
|
processCommentDto.setContent("交"+changeName+"转办"); |
|
|
|
} |
|
|
|
processCommentDto.setTime(new Date()); |
|
|
|
processCommentDto.setProcessId(procDefId); |
|
|
|
processCommentDto.setProcessInstSid(processInstance.getProcessInstanceId()); |
|
|
|
processCommentService.saveOrUpdateDto(processCommentDto); |
|
|
|
} |
|
|
|
taskService.setAssignee(id_,nextNodeUserSids); |
|
|
|
ResultBean<FlowTask> rb = new ResultBean<>(); |
|
|
|
FlowTask flowTask = new FlowTask(); |
|
|
|