|
|
@ -1,31 +1,27 @@ |
|
|
|
package com.yxt.anrui.flowable.biz.flow2; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.map.MapUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.yxt.anrui.flowable.api.flow.Flowable; |
|
|
|
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; |
|
|
|
import com.yxt.anrui.flowable.api.flow2.FlowDelegateQuery; |
|
|
|
import com.yxt.anrui.flowable.api.flow2.FlowableMessageVo; |
|
|
|
import com.yxt.anrui.flowable.api.flowcomment.FlowComment; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTask; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.FlowTaskVo; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.DelegateQuery; |
|
|
|
import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; |
|
|
|
import com.yxt.anrui.flowable.api.processcomment.ProcessCommentDto; |
|
|
|
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; |
|
|
|
import com.yxt.anrui.flowable.biz.flowtask.FlowTaskMapper; |
|
|
|
import com.yxt.anrui.flowable.biz.flowtask.FlowTaskService; |
|
|
|
import com.yxt.anrui.flowable.biz.process.ExpressionCmd; |
|
|
|
import com.yxt.anrui.flowable.biz.process.ProcessService; |
|
|
|
import com.yxt.anrui.flowable.biz.processcomment.ProcessCommentService; |
|
|
|
import com.yxt.anrui.flowable.common.ProcessConstants; |
|
|
|
import com.yxt.anrui.flowable.exception.CustomException; |
|
|
|
import com.yxt.anrui.flowable.feign.MessageFeign; |
|
|
|
import com.yxt.anrui.flowable.feign.form.MessageFlowVo; |
|
|
|
import com.yxt.anrui.flowable.feign.form.MessageFlowableQuery; |
|
|
|
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; |
|
|
|
import com.yxt.anrui.flowable.utils.FlowableUtils; |
|
|
|
import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigQuery; |
|
|
|
import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigVvo; |
|
|
@ -37,16 +33,10 @@ import com.yxt.common.base.utils.StringUtils; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.flowable.bpmn.model.*; |
|
|
|
import org.flowable.bpmn.model.Process; |
|
|
|
import org.flowable.common.engine.api.FlowableException; |
|
|
|
import org.flowable.common.engine.api.FlowableObjectNotFoundException; |
|
|
|
import org.flowable.common.engine.impl.identity.Authentication; |
|
|
|
import org.flowable.engine.*; |
|
|
|
import org.flowable.engine.delegate.DelegateExecution; |
|
|
|
import org.flowable.engine.history.HistoricActivityInstance; |
|
|
|
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl; |
|
|
|
import org.flowable.engine.repository.ProcessDefinition; |
|
|
|
import org.flowable.engine.runtime.Execution; |
|
|
|
import org.flowable.engine.runtime.ProcessInstance; |
|
|
|
import org.flowable.task.api.DelegationState; |
|
|
|
import org.flowable.task.api.Task; |
|
|
@ -773,4 +763,36 @@ public class FlowService extends MybatisBaseService<FlowMapper, Flowable> { |
|
|
|
FlowableMessageVo flowableMessageVo = baseMapper.getMessageReminder(proDefId, proInstId); |
|
|
|
return rb.success().setData(flowableMessageVo); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean delegate(FlowDelegateQuery flowDelegateQuery) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
DelegateQuery delegateQuery = new DelegateQuery(); |
|
|
|
BeanUtil.copyProperties(flowDelegateQuery, delegateQuery); |
|
|
|
ResultBean delegate = flowTaskService.delegate(delegateQuery); |
|
|
|
String userSid = flowDelegateQuery.getUserSid(); |
|
|
|
String assignee = flowDelegateQuery.getAssignee(); |
|
|
|
String instanceId = flowDelegateQuery.getInstanceId(); |
|
|
|
String views = ""; |
|
|
|
if (StringUtils.isNotBlank(flowDelegateQuery.getViews())) { |
|
|
|
views = flowDelegateQuery.getViews(); |
|
|
|
} |
|
|
|
ResultBean<SysUserVo> userVoResultBean1 = sysUserFeign.fetchBySid(userSid); |
|
|
|
String userName = ""; |
|
|
|
if (userVoResultBean1.getData() != null) { |
|
|
|
userName = userVoResultBean1.getData().getName(); |
|
|
|
} |
|
|
|
ResultBean<SysUserVo> userVoResultBean2 = sysUserFeign.fetchBySid(assignee); |
|
|
|
ProcessCommentDto processCommentDto = new ProcessCommentDto(); |
|
|
|
processCommentDto.setReviewerSid(userSid); |
|
|
|
if (userVoResultBean2.getData() != null) { |
|
|
|
String changeName = userVoResultBean2.getData().getName(); |
|
|
|
processCommentDto.setReviewer(userName); |
|
|
|
processCommentDto.setContent(userName + "加签给" + changeName + ":" + views); |
|
|
|
} |
|
|
|
processCommentDto.setTime(new Date()); |
|
|
|
processCommentDto.setProcessId(instanceId); |
|
|
|
processCommentService.saveOrUpdateDto(processCommentDto); |
|
|
|
return rb.success(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|