|
|
|
@ -45,6 +45,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
|
|
import org.flowable.bpmn.constants.BpmnXMLConstants;
|
|
|
|
|
import org.flowable.bpmn.model.*;
|
|
|
|
|
import org.flowable.bpmn.model.Process;
|
|
|
|
@ -457,38 +458,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
if (taskVO.getApprovd()) {
|
|
|
|
|
//进入下一个节点
|
|
|
|
|
taskService.complete(task.getId(), variables);
|
|
|
|
|
//判断是否存在表单二次提交
|
|
|
|
|
if (StringUtils.isNotBlank(taskVO.getDocumentation()) && taskVO.getDocumentation().equals(SystemConstantsOa.OA_TASK_COMPLETE_FORM)) {
|
|
|
|
|
//获取流程类型
|
|
|
|
|
String category = processDefinition.getCategory();
|
|
|
|
|
if (StringUtils.isNotBlank(category)) {
|
|
|
|
|
Category categoryDto = this.categoryService.getCategory(category);
|
|
|
|
|
//解析页面请求,并持久化
|
|
|
|
|
IFormCustomService iFormCustomService = SpringUtils.getBean(categoryDto.getServicename());
|
|
|
|
|
|
|
|
|
|
//TODO 如果更新失败,需要撤销流程
|
|
|
|
|
if (null == iFormCustomService.editForm(request, taskVO.getFormid())) {
|
|
|
|
|
//撤销审批
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//判断是否存在表单三次提交
|
|
|
|
|
if (StringUtils.isNotBlank(taskVO.getDocumentation()) && taskVO.getDocumentation().equals(SystemConstantsOa.OA_TASK_COMPLETE_THREE_FORM)) {
|
|
|
|
|
//获取流程类型
|
|
|
|
|
String category = processDefinition.getCategory();
|
|
|
|
|
if (StringUtils.isNotBlank(category)) {
|
|
|
|
|
Category categoryDto = this.categoryService.getCategory(category);
|
|
|
|
|
//解析页面请求,并持久化
|
|
|
|
|
IFormCustomService iFormCustomService = SpringUtils.getBean(categoryDto.getServicename());
|
|
|
|
|
|
|
|
|
|
//TODO 如果更新失败,需要撤销流程
|
|
|
|
|
if (null == iFormCustomService.editForm(request, taskVO.getFormid())) {
|
|
|
|
|
//撤销审批
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
updateAssignee(task.getProcessInstanceId(), task.getProcessDefinitionId(), processDefinition);
|
|
|
|
|
String category = processDefinition.getCategory();
|
|
|
|
|
Category categoryDto = this.categoryService.getCategory(category);
|
|
|
|
@ -499,14 +468,16 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
if (null != taskList && !taskList.isEmpty()) {
|
|
|
|
|
taskData = taskList.get(0);
|
|
|
|
|
}
|
|
|
|
|
//判断节点上的描述字段,是否伟finale_judgment,如果是,记录到终审表中,如果终审表已经存在,不再重复记录
|
|
|
|
|
if (null != taskData && StringUtils.isNotBlank(taskData.getDescription()) && taskData.getDescription().equals(SystemConstantsOa.OA_TASK_COMPLETE_FINALE_FORM)) {
|
|
|
|
|
User user = userService.findByLoginname(formData.getAssignee());
|
|
|
|
|
userFinalService.save(user.getId().toString(), taskVO.getFormid());
|
|
|
|
|
if (ObjectUtils.isEmpty(taskData)) {
|
|
|
|
|
model.setFinishtime(System.currentTimeMillis());
|
|
|
|
|
model.setStates(SystemConstantsOa.OA_STATUS_TYPE_END);
|
|
|
|
|
ocrTaskchildPictureService.updateById(model);
|
|
|
|
|
} else {
|
|
|
|
|
//判断节点上的描述字段,是否伟finale_judgment,如果是,记录到终审表中,如果终审表已经存在,不再重复记录
|
|
|
|
|
if (StringUtils.isNotBlank(taskData.getDescription()) && taskData.getDescription().equals(SystemConstantsOa.OA_TASK_COMPLETE_FINALE_FORM)) {
|
|
|
|
|
User user = userService.findByLoginname(formData.getAssignee());
|
|
|
|
|
userFinalService.save(user.getId().toString(), taskVO.getFormid());
|
|
|
|
|
}
|
|
|
|
|
OcrTaskchildPicture childPicture = ocrTaskchildPictureService.getById(Long.parseLong(taskVO.getFormid()));
|
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
|
cn.jyjz.xiaoyao.common.base.vo.User byLoginname = userTokenService.findByLoginname(childPicture.getAssignee());
|
|
|
|
@ -541,7 +512,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
//3、修改业务表状态
|
|
|
|
|
//判断业务key是否存在
|
|
|
|
|
if (StringUtils.isNotBlank(businesskey)) {
|
|
|
|
|
|
|
|
|
|
String assignee = "";
|
|
|
|
|
BpmnModel bpmnModel = repositoryService.getBpmnModel(task.getProcessDefinitionId());
|
|
|
|
|
//传节点定义key获取当前节点
|
|
|
|
|